/* ==========================================================================
   Spectrum CRM - Left sidebar (Yeoman / Metronic "dark aside" look)
   --------------------------------------------------------------------------
   Spacing, typography and states are taken 1:1 from the Yeoman project
   (public/assets/css/style.bundle.css + dark.css). The palette is Spectrum's
   own navy instead of Metronic's charcoal: #212e53 is the same colour as the
   old top navbar (.cc_bgNavbar in customColors.css), #18213c is its hover /
   active shade, and the muted greys were lifted to #7683ab / #8f99bb so icons,
   arrows and bullets stay legible against navy.

   Yeoman renders with a 13px root font size, so every "rem" value from the
   original theme is written here in its resolved px value.

   Everything is scoped to .aside / #kt_header_mobile / .aside-overlay so the
   rest of the Spectrum UI is untouched.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout wrapper
   -------------------------------------------------------------------------- */
.cc-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: padding-left 0.3s ease;
}

@media (min-width: 992px) {
    .cc-wrapper {
        padding-left: 265px;
    }

    body.aside-minimize .cc-wrapper {
        padding-left: 70px;
    }
}

@media (max-width: 991.98px) {
    .cc-wrapper {
        padding-top: 55px;
    }
}

/* The page used to sit under a top navbar - keep a little breathing room now
   that the navigation moved to the side. */
@media (min-width: 992px) {
    .cc-wrapper > main {
        padding-top: 15px;
    }
}

/* --------------------------------------------------------------------------
   Mobile header (visible below 992px only)
   -------------------------------------------------------------------------- */
.header-mobile {
    display: none;
}

@media (max-width: 991.98px) {
    .header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        height: 55px;
        min-height: 55px;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 97;
        background-color: #ffffff;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.075);
    }
}

.header-mobile .header-mobile-logo img {
    max-height: 30px;
    width: auto;
}

/* Burger icon */
.burger-icon {
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    background-color: transparent;
    outline: none !important;
    margin: 0;
    padding: 0;
    display: inline-block;
    position: relative;
    overflow: hidden;
    font-size: 0;
    text-indent: -9999px;
    width: 24px;
    height: 24px;
    transition: all 0.3s;
}

.burger-icon span {
    display: block;
    position: absolute;
    border-radius: 3px;
    transition: all 0.3s;
    top: 10px;
    height: 3px;
    min-height: 3px;
    width: 100%;
    background-color: #B5B5C3;
}

.burger-icon span::before,
.burger-icon span::after {
    position: absolute;
    display: block;
    left: 0;
    width: 100%;
    height: 3px;
    min-height: 3px;
    content: "";
    transition: all 0.3s;
    border-radius: 3px;
    background-color: #B5B5C3;
}

.burger-icon span::before {
    top: -8px;
}

.burger-icon span::after {
    bottom: -8px;
}

.burger-icon-left span::before {
    left: auto;
    right: 0;
    width: 50%;
}

.burger-icon-left span::after {
    left: auto;
    right: 0;
    width: 75%;
}

/* --------------------------------------------------------------------------
   Aside
   -------------------------------------------------------------------------- */
.aside {
    display: flex;
    flex-direction: column;
    width: 265px;
    background-color: #212e53;
    font-family: Poppins, Helvetica, "sans-serif";
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

@media (min-width: 992px) {
    .aside {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 98;
        transition: width 0.3s ease;
    }

    body.aside-minimize .aside {
        width: 70px;
    }
}

/* Off canvas below 992px */
@media (max-width: 991.98px) {
    .aside {
        z-index: 1001;
        position: fixed;
        top: 0;
        bottom: 0;
        left: -295px;
        width: 275px;
        transition: left 0.3s ease;
    }

    .aside.aside-on {
        left: 0;
    }

    .aside-overlay {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        overflow: hidden;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.1);
        animation: aside-overlay-fade-in 0.6s ease 1;
    }

    body[data-offcanvas-aside="on"] {
        overflow: hidden !important;
    }
}

@media (max-width: 325px) {
    .aside {
        width: 90% !important;
    }
}

@keyframes aside-overlay-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */
.aside .brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    flex-shrink: 0;
    padding: 0 25px;
    height: 96px;
}

.aside .brand .brand-logo {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.aside .brand .brand-logo img {
    max-height: 42px;
    max-width: 100%;
    width: auto;
}

.aside .brand .brand-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 34px;
    width: 34px;
    border: 0;
    border-radius: 0.42rem;
}

.aside .brand .brand-toggle .svg-icon {
    display: flex;
    line-height: 0;
}

.aside .brand .brand-toggle .svg-icon svg {
    height: 22px;
    width: 22px;
    transition: all 0.15s ease;
}

body.aside-minimize .aside .brand {
    justify-content: center;
    padding: 0 10px;
}

body.aside-minimize .aside .brand .brand-logo {
    display: none;
}

body.aside-minimize .aside .brand .brand-toggle {
    margin-left: 0 !important;
}

body.aside-minimize .aside .brand .brand-toggle .svg-icon svg {
    transform: rotate(180deg);
}

@media (max-width: 991.98px) {
    .aside .brand .brand-toggle {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Menu container + scrollbar
   -------------------------------------------------------------------------- */
.aside .aside-menu-wrapper {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
}

.aside .aside-menu {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #637099 transparent;
}

.aside .aside-menu::-webkit-scrollbar {
    width: 4px;
}

.aside .aside-menu::-webkit-scrollbar-track {
    background-color: transparent;
}

.aside .aside-menu::-webkit-scrollbar-thumb {
    background-color: #637099;
    border-radius: 0.42rem;
}

/* --------------------------------------------------------------------------
   Menu nav
   -------------------------------------------------------------------------- */
.aside .menu-nav {
    margin: 0;
    list-style: none;
    padding: 15px 0;
}

.aside .menu-nav .menu-item {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    float: none;
    padding: 0;
    margin: 0;
    position: relative;
    list-style: none;
}

.aside .menu-nav .menu-item > .menu-link {
    display: flex;
    flex-grow: 1;
    align-items: center;
    margin: 0;
    text-decoration: none;
    position: relative;
    outline: none !important;
    cursor: pointer;
    transition: background-color 0.3s;
}

.aside .menu-nav .menu-item > .menu-link:hover,
.aside .menu-nav .menu-item > .menu-link:focus {
    text-decoration: none;
}

.aside .menu-nav .menu-item > .menu-link .menu-text {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding: 0;
}

.aside .menu-nav .menu-item > .menu-link .menu-icon {
    display: flex;
    align-items: center;
    line-height: 0;
}

.aside .menu-nav .menu-item > .menu-link .menu-bullet {
    display: flex;
    align-items: center;
    line-height: 0;
}

.aside .menu-nav .menu-item > .menu-link .menu-arrow {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    line-height: 0;
    flex: 0 0 20px;
    transition: all 0.3s ease;
}

/* Chevron - stands in for the theme's "Ki" arrow glyph */
.aside .menu-nav .menu-item > .menu-link .menu-arrow::before {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.aside .menu-nav .menu-item.menu-item-open > .menu-link .menu-arrow::before {
    transform: rotate(135deg);
}

/* ---- Root level items ---------------------------------------------------- */
.aside .menu-nav > .menu-item > .menu-link {
    padding: 9px 25px;
    min-height: 44px;
}

.aside .menu-nav > .menu-item > .menu-link .menu-text {
    font-weight: 400;
    font-size: 13px;
    text-transform: initial;
    color: #ffffff;
}

.aside .menu-nav > .menu-item > .menu-link .menu-icon {
    flex: 0 0 35px;
    font-size: 17px;
    color: #7683ab;
}

.aside .menu-nav > .menu-item > .menu-link .menu-icon svg {
    height: 23px;
    width: 23px;
    margin-left: -2px;
}

.aside .menu-nav > .menu-item > .menu-link .menu-icon.svg-icon svg g [fill] {
    transition: fill 0.3s ease;
    fill: #7683ab;
}

.aside .menu-nav > .menu-item > .menu-link .menu-arrow {
    color: #8f99bb;
    font-size: 8px;
}

/* Root level: open / here / active / hover */
.aside .menu-nav > .menu-item.menu-item-open > .menu-link,
.aside .menu-nav > .menu-item.menu-item-here > .menu-link,
.aside .menu-nav > .menu-item.menu-item-active > .menu-link,
.aside .menu-nav > .menu-item:not(.menu-item-open):not(.menu-item-here):not(.menu-item-active) > .menu-link:hover {
    background-color: #18213c;
    transition: background-color 0.3s;
}

.aside .menu-nav > .menu-item.menu-item-open > .menu-link .menu-text,
.aside .menu-nav > .menu-item.menu-item-here > .menu-link .menu-text,
.aside .menu-nav > .menu-item.menu-item-active > .menu-link .menu-text,
.aside .menu-nav > .menu-item:not(.menu-item-open):not(.menu-item-here):not(.menu-item-active) > .menu-link:hover .menu-text {
    color: #ffffff;
}

.aside .menu-nav > .menu-item.menu-item-open > .menu-link .menu-icon,
.aside .menu-nav > .menu-item.menu-item-here > .menu-link .menu-icon,
.aside .menu-nav > .menu-item.menu-item-active > .menu-link .menu-icon,
.aside .menu-nav > .menu-item:not(.menu-item-open):not(.menu-item-here):not(.menu-item-active) > .menu-link:hover .menu-icon {
    color: #3699FF;
}

.aside .menu-nav > .menu-item.menu-item-open > .menu-link .menu-icon.svg-icon svg g [fill],
.aside .menu-nav > .menu-item.menu-item-here > .menu-link .menu-icon.svg-icon svg g [fill],
.aside .menu-nav > .menu-item.menu-item-active > .menu-link .menu-icon.svg-icon svg g [fill],
.aside .menu-nav > .menu-item:not(.menu-item-open):not(.menu-item-here):not(.menu-item-active) > .menu-link:hover .menu-icon.svg-icon svg g [fill] {
    transition: fill 0.3s ease;
    fill: #3699FF;
}

.aside .menu-nav > .menu-item.menu-item-open > .menu-link .menu-arrow,
.aside .menu-nav > .menu-item.menu-item-here > .menu-link .menu-arrow,
.aside .menu-nav > .menu-item.menu-item-active > .menu-link .menu-arrow,
.aside .menu-nav > .menu-item:not(.menu-item-open):not(.menu-item-here):not(.menu-item-active) > .menu-link:hover .menu-arrow {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Submenu (accordion)
   -------------------------------------------------------------------------- */
.aside .menu-nav .menu-item .menu-submenu {
    display: none;
    float: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.aside .menu-nav .menu-item.menu-item-open > .menu-submenu {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
}

.aside .menu-nav .menu-item .menu-submenu .menu-subnav {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 3px solid #fff;
}

.aside .menu-nav > .menu-item > .menu-submenu .menu-subnav > .menu-item > .menu-link {
    padding: 0 25px 0 40px;
    min-height: 40px;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item > .menu-link .menu-text {
    font-weight: 400;
    font-size: 13px;
    text-transform: initial;
    color: #CCAD6E;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item > .menu-link .menu-bullet {
    flex: 0 0 20px;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item > .menu-link .menu-bullet.menu-bullet-dot > span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 100%;
    background-color: #8f99bb;
    transition: background-color 0.3s ease;
}

/* Submenu: active / hover */
.aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link,
.aside .menu-nav > .menu-item .menu-submenu .menu-item:not(.menu-item-active) > .menu-link:hover {
    background-color: #18213c;
    transition: background-color 0.3s;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link .menu-text,
.aside .menu-nav > .menu-item .menu-submenu .menu-item:not(.menu-item-active) > .menu-link:hover .menu-text {
    color: #ffffff;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link .menu-bullet.menu-bullet-dot > span,
.aside .menu-nav > .menu-item .menu-submenu .menu-item:not(.menu-item-active) > .menu-link:hover .menu-bullet.menu-bullet-dot > span {
    background-color: #3699FF;
}

/* THE CURRENT PAGE, as distinct from a hovered one.
   ------------------------------------------------
   The two rules above give active and hover the same #18213c background, which
   was fine while no submenu item was ever marked active. Now that the open page
   is marked (App\Services\Menu::activeItem), the two need to differ, or moving
   the mouse down the list makes every item in turn look like the one you are on.

   Active gets a blue accent bar down its left edge and a heavier label; hover
   keeps the plain darker fill. Only the active rule is restated, so the hover
   behaviour above is untouched. */
.aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link {
    background-color: #1b2647;
    box-shadow: inset 3px 0 0 0 #3699FF;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link .menu-text {
    color: #ffffff;
    font-weight: 600;
}

/* Separator inside a submenu (mirrors the divider used by the Inventory menu) */
.aside .menu-nav .menu-separator {
    margin: 10px 0;
    height: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* --------------------------------------------------------------------------
   User block (white block under the brand - same as Yeoman)
   Kept outside the scrolling menu so its dropdown is never clipped.
   -------------------------------------------------------------------------- */
.aside .aside-user {
    background-color: #ffffff;
    flex-shrink: 0;
}

.aside .aside-user .user-wrapper {
    padding: 0 10px;
}

/* The toggle is the whole strip - icon, name, role and caret - so the target is
   the size it looks, and the menu below anchors to the full width rather than to
   a 40px button. */
.aside .aside-user .user-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    border-radius: 0.42rem;
    transition: background-color 0.2s ease;
}

.aside .aside-user .user-toggle:hover,
.aside .aside-user .user-toggle:focus,
.aside .aside-user .user-toggle[aria-expanded="true"] {
    background-color: #F3F6F9;
    text-decoration: none;
    outline: none;
}

.aside .aside-user .btn-user {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 40px;
    width: 40px;
    padding: 0;
    margin: 12px 15px;
    border: 0;
    border-radius: 0.42rem;
    background-color: #F3F6F9;
    transition: background-color 0.3s ease;
}

.aside .aside-user .user-toggle:hover .btn-user,
.aside .aside-user .user-toggle[aria-expanded="true"] .btn-user {
    background-color: #FFF4DE;
}

/* Points down at rest, up while the panel is open - the only thing on the strip
   that says it opens something. */
.aside .aside-user .user-caret {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 14px;
    font-size: 11px;
    color: #B5B5C3;
    transition: transform 0.2s ease;
}

.aside .aside-user .user-toggle[aria-expanded="true"] .user-caret {
    transform: rotate(180deg);
}

.aside .aside-user .btn-user svg {
    height: 24px;
    width: 24px;
}

.aside .aside-user .btn-user svg g [fill] {
    fill: #212121;
}

.aside .aside-user .user-info {
    display: block;
    flex: 1 1 auto;
    /* min-width:0 is what lets the ellipsis below actually fire. A flex item
       will not shrink past its content without it, so a long name pushed the
       caret off the strip instead of truncating. */
    min-width: 0;
    padding: 8px 0;
    overflow: hidden;
}

.aside .aside-user .user-info .user-name {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #212121;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aside .aside-user .user-info .user-role {
    display: block;
    font-size: 12px;
    color: #80808F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Placed by CSS, not by Popper - the toggle carries data-display="static".
   Pinned to both edges so the panel is exactly as wide as the sidebar and sits
   flush under the user strip, instead of being a floating box shoved sideways
   over the menu. The top border is what separates two white surfaces. */
.aside .aside-user .dropdown-menu {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-top: 1px solid #EBEDF3;
    border-radius: 0;
    box-shadow: 0 10px 24px rgba(82, 63, 105, 0.18);
}

.aside .aside-user .navi {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0;
}

.aside .aside-user .navi-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: #3F4254;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Logging out is not an ordinary navigation, so it reads as the one destructive
   thing on the strip rather than as another blue link. */
.aside .aside-user .navi-link:hover,
.aside .aside-user .navi-link:focus {
    background-color: #FFF5F8;
    color: #F64E60;
    text-decoration: none;
}

.aside .aside-user .navi-icon {
    display: flex;
    align-items: center;
    flex: 0 0 2rem;
    font-size: 15px;
    color: #B5B5C3;
}

.aside .aside-user .navi-link:hover .navi-icon,
.aside .aside-user .navi-link:focus .navi-icon {
    color: #F64E60;
}

body.aside-minimize .aside .aside-user .user-info,
body.aside-minimize .aside .aside-user .user-caret {
    display: none;
}

body.aside-minimize .aside .aside-user .user-wrapper {
    padding: 0;
}

body.aside-minimize .aside .aside-user .user-toggle {
    justify-content: center;
}

body.aside-minimize .aside .aside-user .btn-user {
    margin: 12px 0;
}

/* --------------------------------------------------------------------------
   Minimized aside (desktop only) - icons only, submenus fly out
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
    body.aside-minimize .aside .menu-nav > .menu-item > .menu-link {
        justify-content: center;
        padding: 9px 0;
    }

    body.aside-minimize .aside .menu-nav > .menu-item > .menu-link .menu-text,
    body.aside-minimize .aside .menu-nav > .menu-item > .menu-link .menu-arrow {
        display: none;
    }

    body.aside-minimize .aside .menu-nav > .menu-item > .menu-link .menu-icon {
        flex: 0 0 auto;
        justify-content: center;
    }

    body.aside-minimize .aside .menu-nav > .menu-item > .menu-submenu {
        display: none !important;
    }

    body.aside-minimize .aside .menu-nav > .menu-item.menu-item-submenu:hover > .menu-submenu {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: -5px;
        left: 70px;
        z-index: 98;
        width: 265px;
        padding: 10px 0;
        border-radius: 4px;
        background-color: #ffffff;
        box-shadow: 0px 0px 50px 0px rgba(82, 63, 105, 0.15);
        animation: aside-menu-submenu-fade-in 0.3s ease 1;
    }

    body.aside-minimize .aside .menu-nav > .menu-item.menu-item-submenu:hover > .menu-submenu .menu-subnav {
        border-left: 0;
    }

    body.aside-minimize .aside .menu-nav > .menu-item > .menu-submenu .menu-subnav > .menu-item > .menu-link {
        padding: 0 25px 0 30px;
    }

    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item > .menu-link .menu-text {
        color: #696e92;
    }

    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item > .menu-link .menu-bullet.menu-bullet-dot > span {
        background-color: #a8aabb;
    }

    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link,
    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item:not(.menu-item-active) > .menu-link:hover {
        background-color: #F3F6F9;
    }

    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link .menu-text,
    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item:not(.menu-item-active) > .menu-link:hover .menu-text {
        color: #3699FF;
    }

    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link .menu-bullet.menu-bullet-dot > span,
    body.aside-minimize .aside .menu-nav > .menu-item .menu-submenu .menu-item:not(.menu-item-active) > .menu-link:hover .menu-bullet.menu-bullet-dot > span {
        background-color: #3699FF;
    }

    body.aside-minimize .aside .menu-nav .menu-separator {
        border-bottom-color: rgba(0, 0, 0, 0.07);
    }
}

@keyframes aside-menu-submenu-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
