/* Site-wide readable typography.
   Keep icon font classes excluded so Bootstrap Icons and Font Awesome remain intact. */
:root {
    --font-normal: "Segoe UI", Arial, Helvetica, sans-serif;
}

html,
body {
    font-family: var(--font-normal) !important;
}

body *:not(svg):not(path):not(use):not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat) {
    font-family: var(--font-normal) !important;
}

/* Keep every role sidebar stable: only the menu scrolls, while the footer
   stays pinned at the bottom of the viewport. */
.sidebar {
    width: 258px;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
}

.sidebar-header,
.sidebar-user,
.sidebar-footer {
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-footer {
    margin-top: auto;
}

/* Admin pages use a flex-grow main wrapper beside the sidebar. Once the
   sidebar is fixed, reserve its space so report content never slides under it. */
.sidebar + .flex-grow-1 {
    min-width: 0;
    margin-left: 258px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 258px !important;
        min-width: 258px !important;
        max-width: 258px !important;
        transform: translateX(-105%);
        transition: transform .25s ease, box-shadow .25s ease;
        z-index: 1200;
        padding: 0 !important;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 14px 0 35px rgba(2, 6, 23, .3) !important;
    }

    .sidebar-header {
        display: block !important;
    }

    .sidebar-user {
        display: flex !important;
    }

    .sidebar-section-label {
        display: block !important;
    }

    .sidebar .nav-link span,
    .sidebar-footer .nav-link span {
        display: inline !important;
    }

    .sidebar .nav-link .nav-badge {
        display: inline-block !important;
    }

    .sidebar-nav {
        padding: 16px 0 !important;
    }

    .sidebar .nav-link {
        justify-content: flex-start !important;
        padding: 10px 14px !important;
        margin: 2px 12px !important;
        gap: 10px !important;
        border-left: 0 !important;
    }

    .sidebar .nav-link i {
        flex: 0 0 20px;
        font-size: 1.05rem !important;
        margin: 0 !important;
    }

    .sidebar .nav-link.active {
        border-left: 3px solid currentColor !important;
        padding-left: 11px !important;
    }

    .sidebar-footer {
        display: block !important;
        padding-bottom: 10px;
    }

    .sidebar-toggle {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1300;
        display: flex;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(148, 163, 184, .25);
        border-radius: 12px;
        background: #090d1a;
        color: #fff;
        box-shadow: 0 8px 22px rgba(2, 6, 23, .22);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .sidebar-toggle:focus-visible {
        outline: 3px solid rgba(34, 197, 94, .45);
        outline-offset: 2px;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(2, 6, 23, .62);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar + .flex-grow-1,
    .main,
    .page-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        margin-left: 0 !important;
    }

    .dash-topbar {
        padding-left: 68px !important;
    }

    .sidebar + .flex-grow-1 {
        overflow-x: hidden;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle,
    .sidebar-overlay {
        display: none !important;
    }
}

@media print {
    .sidebar-toggle,
    .sidebar-overlay {
        display: none !important;
    }
}
