/* ==========================================================
   Exollium - sidebar polish (matches UltimatePOS demo feel)
   Targets the real markup:
     aside.side-bar > (logo) + (search) + #side-bar (menu list)
   1) compact menu spacing
   2) menu list scrolls on its own; logo + search stay fixed
   ========================================================== */

/* ---------- 1. Compact menu items ---------- */
#side-bar {
    gap: 0 !important;
    row-gap: 0 !important;
    padding-top: 6px !important;
    padding-bottom: 12px !important;
    padding-left: 8px !important;     /* demo uses 8px, was 12px */
    padding-right: 8px !important;
}

/* uniform icon box so all texts start at the same x (modules use 24px icons) */
#side-bar a svg,
#side-bar a img {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    flex-shrink: 0 !important;
    object-fit: contain;
}
#side-bar a > i {
    display: inline-block;
    width: 20px !important;
    min-width: 20px !important;
    text-align: center;
    flex-shrink: 0 !important;
}

/* every top-level item (plain <a> or <div> wrapper with sub menu) */
#side-bar > * {
    margin: 0 0 4px 0 !important;      /* gap between two menu items */
}

/* the clickable row of each top-level item */
#side-bar > a,
#side-bar > div > a {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    min-height: 0 !important;
    line-height: 1.35 !important;
}

/* sub menu: kill every source of extra gap (flex gap, space-y margins, fixed heights) */
#side-bar .chiled {
    gap: 0 !important;
    row-gap: 0 !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
#side-bar .chiled > * {
    margin: 0 0 2px 0 !important;
}
#side-bar .chiled a {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    line-height: 1.35 !important;
    font-size: 13.5px !important;
}

/* ---------- typography: lighter text like the demo ---------- */
#side-bar a,
#side-bar a span,
#side-bar .chiled a {
    font-weight: 400 !important;
}

/* lighter icons (outline icons only; filled/coloured module icons are left alone) */
#side-bar a svg[stroke="currentColor"] {
    stroke-width: 1.5 !important;
}
#side-bar a svg {
    opacity: .85;
}

/* ---------- 2. Independent sidebar scroll (desktop) ---------- */
@media (min-width: 1024px) {
    aside.side-bar {
        position: sticky !important;
        top: 0 !important;
        align-self: flex-start !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
    }

    aside.side-bar #side-bar {
        flex: 1 1 0% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    aside.side-bar #side-bar::-webkit-scrollbar {
        width: 5px;
    }

    aside.side-bar #side-bar::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
}