/* Shared Bizzcube shell. Keep page content styling scoped to its own page root. */
:root {
    --bc-header-height: 66px;
    --bc-sidebar-width: 264px;
    --bc-purple: #6427d7;
    --bc-purple-hover: #5317c0;
    --bc-ink: #17131d;
    --bc-muted: #77717e;
    --bc-border: #e8e2f0;
    --bc-content-padding-x: clamp(20px, 3vw, 48px);
    --bc-content-padding-y: 30px;
}

/* Bootstrap-compatible box model without loading Bootstrap into page content. */
html body *,
html body *::before,
html body *::after {
    box-sizing: border-box !important;
}

/* Hide scrollbar chrome everywhere without disabling scrolling. */
html,
body,
html body * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
html body *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}


/* One source of truth for the shared application frame. */
html body .header-bar {
    box-sizing: border-box !important;
    position: fixed !important;
    inset: 0 0 auto !important;
    z-index: 1100 !important;
    width: 100% !important;
    height: var(--bc-header-height) !important;
}

html body .sidebar {
    box-sizing: border-box !important;
    position: fixed !important;
    top: var(--bc-header-height) !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1040 !important;
    width: var(--bc-sidebar-width) !important;
    max-width: var(--bc-sidebar-width) !important;
    height: calc(100vh - var(--bc-header-height)) !important;
}

html body .content-container[class],
html body .content-container[class] * {
    box-sizing: border-box !important;
}

html body .content-container[class] {
    box-sizing: border-box !important;
    width: calc(100% - var(--bc-sidebar-width)) !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: var(--bc-sidebar-width) !important;
    padding: var(--bc-content-padding-y) var(--bc-content-padding-x) !important;
}

html body .content-container[class] > .content {
    width: 100%;
    max-width: none;
}

html body .sidebar-nav {
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Normalize list behavior so the sidebar does not depend on Bootstrap resets. */
html body .sidebar .sidebar-nav > .nav.flex-column,
html body .sidebar .sidebar-nav > .sidebar-nav-list {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

html body .sidebar .nav-item,
html body .sidebar .sidebar-item {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

html body .sidebar .submenu,
html body .sidebar .sidebar-submenu {
    margin: 0 !important;
    list-style: none !important;
}

/* Keep opened menu panels and selectable result lists consistent across pages. */
html body .dropdown-menu,
html body .custom-dropdown,
html body .select2-dropdown,
html body .choices__list--dropdown,
html body [role="listbox"] {
    overflow: hidden;
    border-radius: 6px !important;
    box-shadow: 0 8px 22px rgba(38, 25, 55, .12);
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
html body .dropdown-menu::-webkit-scrollbar,
html body .custom-dropdown::-webkit-scrollbar,
html body .select2-dropdown::-webkit-scrollbar,
html body .choices__list--dropdown::-webkit-scrollbar,
html body [role="listbox"]::-webkit-scrollbar { display:none !important; width:0 !important; height:0 !important; }

/* Sidebar groups remain expandable; hide only their decorative disclosure arrows. */
html body .sidebar .submenu-caret { display:none !important; }

/* Round the opened native select picker where customizable-select CSS is supported. */
@supports (appearance: base-select) {
    html body select:not([multiple]):not([size]),
    html body select:not([multiple]):not([size])::picker(select) {
        appearance: base-select !important;
    }

    html body select:not([multiple]):not([size])::picker(select) {
        top: calc(anchor(bottom) + 4px);
        left: anchor(left);
        right: auto;
        width: max-content;
        min-width: anchor-size(width);
        max-width: min(90vw, calc(100vw - anchor(left) - 12px));
        position-try-fallbacks: none;
        max-height: min(60vh, 420px);
        margin: 0;
        padding: 4px;
        overflow: auto;
        border: 1px solid #e4deec;
        border-radius: 7px;
        background: #fff;
        box-shadow: 0 10px 28px rgba(32, 22, 46, .16);
    }

    html body select:not([multiple]):not([size]) option {
        min-height: 34px;
        padding: 7px 9px;
        border-radius: 4px;
        color: #302a37;
        background: #fff;
        white-space: normal;
    }

    html body select:not([multiple]):not([size]) option:checked {
        color: #5317c0;
        background: #f3edff;
    }

    html body select:not([multiple]):not([size]) option::checkmark {
        display: none !important;
    }

    html body select:not([multiple]):not([size])::picker-icon {
        display: none !important;
    }

    html body select:not([multiple]):not([size])::picker(select) {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    html body select:not([multiple]):not([size])::picker(select)::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
}

/* Keep the closed control rounded in every browser, including legacy select renderers. */
html body select,
html body .form-select {
    border-radius: 5px !important;
}

@media (max-width: 760px) {
    :root {
        --bc-header-height: 60px;
        --bc-content-padding-x: 15px;
        --bc-content-padding-y: 22px;
    }

    html body .content-container[class] {
        width: 100% !important;
        margin-left: 0 !important;
        padding: var(--bc-content-padding-y) var(--bc-content-padding-x) calc(92px + env(safe-area-inset-bottom)) !important;
    }

    html body .sidebar {
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100vh - var(--bc-header-height)) !important;
    }
}
