/* ============================================================================
   SecuMetrix — modern sidebar markup (smx-nav-*) styled on the TEMPLATE's DARK
   theme (secumetrix.css .app-side: --ink #0B232F bg + glow, teal active).
   The base .app-side already supplies the dark background, brand, footer and
   layout; here we only style the new smx-nav item classes (the base .nav a /
   .acc-* rules don't match them). Scoped under .app-side.smx to beat .nav a.
   ============================================================================ */
.app-side.smx {
    --smx-teal: #0E8C8E;
    --smx-teal-600: #0A7375;
}

/* ---------- brand (logo image) ---------- */
/* Logos are dark artwork → invert to pure white for the dark sidebar. Bigger logo, same section height. */
.app-side.smx .brand { display: flex; align-items: center; padding-top: 12px; padding-bottom: 12px; }
.app-side.smx .brand .smx-logo-lg { display: inline-flex; align-items: center; }
.app-side.smx .brand .smx-logo-sm { display: none; align-items: center; }
.app-side.smx .brand .smx-logo-lg img { max-height: 44px; width: auto; filter: brightness(0) invert(1); }
.app-side.smx .brand .smx-logo-sm img { max-height: 36px; width: auto; filter: brightness(0) invert(1); }
@media (min-width: 992px) {
    .app-side.smx.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
    .app-side.smx.collapsed .brand .smx-logo-lg { display: none; }
    .app-side.smx.collapsed .brand .smx-logo-sm { display: inline-flex; margin: 0 auto; }
}

/* ---------- nav container ---------- */
.app-side.smx .nav {
    padding: 6px 12px 16px; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin;                                   /* Firefox */
    scrollbar-color: rgba(255,255,255,.07) transparent;
}
/* WebKit: hairline + very low visibility, even on hover/active. Once ::-webkit-scrollbar is styled,
   Chrome draws the increment/decrement arrow buttons unless they are explicitly hidden. */
.app-side.smx .nav::-webkit-scrollbar { width: 3px; }
.app-side.smx .nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.app-side.smx .nav::-webkit-scrollbar-track,
.app-side.smx .nav::-webkit-scrollbar-corner { background: transparent; }
.app-side.smx .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.07); border-radius: 3px; }
.app-side.smx .nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.app-side.smx .nav::-webkit-scrollbar-thumb:hover,
.app-side.smx .nav::-webkit-scrollbar-thumb:active { background: rgba(255,255,255,.16); }

.app-side.smx .smx-nav, .app-side.smx .smx-nav-sub { list-style: none; margin: 0; padding: 0; }
.app-side.smx .smx-nav-item { margin: 2px 0; }

/* ---------- top-level link ---------- */
.app-side.smx .smx-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9.5px 12px; border-radius: 10px;
    color: #AFC2C8; text-decoration: none;
    font-size: 13.5px; font-weight: 500; line-height: 1.25;
    position: relative; cursor: pointer; transition: background .15s, color .15s;
    border: none; background: none; width: 100%; text-align: left;
}
.app-side.smx .smx-nav-link:hover { background: #ffffff0d; color: #EAF2F4; }

.app-side.smx .smx-nav-ic { flex: 0 0 22px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.app-side.smx .smx-nav-ic img { width: 18px; height: 18px; object-fit: contain; transition: filter .15s; }
/* .app-side.smx .smx-nav-link:hover .smx-nav-ic img { filter: brightness(0) invert(1); } */

.app-side.smx .smx-nav-tx { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: normal; word-break: break-word; }
.app-side.smx .smx-nav-label { flex: 1 1 auto; }
.app-side.smx .smx-nav-info { color: var(--smx-teal); font-size: 12px; cursor: pointer; }

/* caret */
.app-side.smx .smx-nav-caret {
    flex: 0 0 auto; width: 7px; height: 7px; margin-left: 4px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); opacity: .5; transition: transform .22s ease;
}
.app-side.smx .smx-nav-parent-li.smx-open > .smx-nav-link > .smx-nav-caret,
.app-side.smx .smx-nav-parent-li.smx-open > .smx-nav-sublink > .smx-nav-caret { transform: rotate(45deg); opacity: .85; }

/* active */
.app-side.smx .smx-nav-link.smx-active {
    background: linear-gradient(90deg, var(--smx-teal), var(--smx-teal-600));
    color: #fff; box-shadow: 0 6px 16px -6px var(--smx-teal);
}
.app-side.smx .smx-nav-link.smx-active .smx-nav-ic img { filter: brightness(0) invert(1); }
.app-side.smx .smx-nav-link.smx-active .smx-nav-caret { opacity: .9; }

/* ---------- submenu (accordion) ---------- */
.app-side.smx .smx-nav-sub { max-height: 0; overflow: hidden; transition: max-height .28s ease; padding-left: 6px; }
.app-side.smx .smx-nav-parent-li.smx-open > .smx-nav-sub { max-height: 1600px; }

.app-side.smx .smx-nav-sublink {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px 8px 44px; border-radius: 9px;
    color: #8fa6ad; text-decoration: none;
    font-size: 13px; font-weight: 500; line-height: 1.3;
    position: relative; cursor: pointer; transition: background .15s, color .15s;
    border: none; background: none; width: 100%; text-align: left;
}
.app-side.smx .smx-nav-sublink::before {
    content: ""; position: absolute; left: 26px; top: 50%;
    width: 5px; height: 5px; border-radius: 50%; background: #ffffff33; transform: translateY(-50%); transition: background .15s;
}
.app-side.smx .smx-nav-sublink:hover { background: #ffffff0d; color: #EAF2F4; }
.app-side.smx .smx-nav-sublink:hover::before { background: var(--smx-teal); }
.app-side.smx .smx-nav-sublink.smx-active { color: #fff; font-weight: 700; background: #ffffff10; }
.app-side.smx .smx-nav-sublink.smx-active::before { background: var(--smx-teal); }
.app-side.smx .smx-nav-subtx { flex: 1 1 auto; white-space: normal; word-break: break-word; }

.app-side.smx .smx-nav-sub-nested .smx-nav-sublink { padding-left: 56px; }
.app-side.smx .smx-nav-sub-nested .smx-nav-sublink::before { left: 40px; }

/* deactivated */
.app-side.smx .smx-nav-link.deactivated-menu, .app-side.smx .smx-nav-sublink.deactivated-menu { opacity: .4; cursor: not-allowed; }

/* ---------- collapsed (desktop) ---------- */
@media (min-width: 992px) {
    .app-side.smx.collapsed .smx-nav-tx, .app-side.smx.collapsed .smx-nav-caret { display: none; }
    .app-side.smx.collapsed .smx-nav-link { justify-content: center; padding: 11px 0; gap: 0; }
    .app-side.smx.collapsed .smx-nav-sub { display: none !important; }
}

/* ===========================================================================
   Fly-out panel (collapsed) — PORTALED to <body>, so GLOBAL. Dark to match.
   =========================================================================== */
.smx-nav-flyout {
    position: fixed; z-index: 1085; min-width: 210px; max-width: 280px;
    background: #102E3B; border: 1px solid #ffffff14; border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0,0,0,.45); padding: 8px; animation: smxFlyIn .14s ease;
}
@keyframes smxFlyIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }
.smx-nav-flyout .smx-nav-sub, .smx-nav-flyout .smx-nav-sub-nested { list-style: none; margin: 0; padding: 0; max-height: none !important; overflow: visible; display: block !important; }
.smx-nav-flyout-title { font-size: 12.5px; font-weight: 700; color: #EAF2F4; padding: 6px 10px 9px; border-bottom: 1px solid #ffffff14; margin-bottom: 6px; }
.smx-nav-flyout .smx-nav-caret { display: none; }
.smx-nav-flyout .smx-nav-sublink {
    display: flex; align-items: center; padding: 9px 12px; border-radius: 8px; color: #AFC2C8;
    text-decoration: none; font-size: 13px; position: relative; cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.smx-nav-flyout .smx-nav-sublink:hover { background: #ffffff0d; color: #fff; }
.smx-nav-flyout .smx-nav-sublink.smx-active { color: #fff; font-weight: 700; background: #ffffff12; }
.smx-nav-flyout .smx-nav-sub-nested { border-left: 2px solid #ffffff14; margin-left: 12px; padding-left: 4px; }
.smx-nav-flyout .smx-nav-sub-nested .smx-nav-sublink { padding-left: 12px; }
.smx-nav-flyout .smx-nav-flyout-tip { display: block; padding: 8px 12px; color: #EAF2F4; font-weight: 600; font-size: 13px; text-decoration: none; }
