:root {
    --navbar-height: 56px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 40px;
  /*--bs-body-bg: #fbfdf8;*/
  /*--bs-body-color: #2b2c2b;*/

}


/*[data-bs-theme="dark"] {*/
/*  --bs-body-bg: #464744;*/
/*  --bs-body-color: #e4eadf;*/

/*}*/


/* ===================== */
/* GLOBAL                */
/* ===================== */
body {
    margin: 0;
    overflow-x: hidden;
    padding-top: 0; /* Reset previous padding */
}

.navbar {
    z-index: 1030;
    height: var(--navbar-height);
}

/* ===================== */
/* LAYOUT WRAPPER        */
/* ===================== */
.app-layout {
    margin-top: calc(var(--navbar-height) + 1.5rem);
    display: flex;
    min-height: calc(100vh - var(--navbar-height) - 1.5rem);
}

#sidebar {
    width: var(--sidebar-width);
    flex-shrink: 1;
    /*display: flex;*/
    /*flex-direction: column;*/
    /*height: 100%;*/
}

.content-wrapper {
    flex: 1;
    min-width: 0;
}

/* Navigation Links */
.nav-link {
    white-space: nowrap;
    /*color: #333;*/
    /*padding: 0.75rem 1rem;*/
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    /*color: #0d6efd;*/
    /*background-color: #e9ecef;*/
}

.nav-link i {
    margin-right: 0.5rem;
    width: 1.25rem;
    text-align: center;
    display: inline-block;
    font-size: 1.1rem;
}

.nav-link span {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    /*background-color: #f8f9fa;*/
}

/* ===================== */
/* DESKTOP BEHAVIOR      */
/* ===================== */
@media (min-width: 992px) {

    /* Sidebar becomes part of flex layout (not fixed overlay) */
    #sidebar {
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        width: var(--sidebar-width);
        flex-shrink: 0;
        /*height: 100%;*/
    }

    /* Hide mobile toggle */
    .d-lg-none {
        display: none !important;
    }

    /* === COLLAPSED STATE === */
    
    /* 1. Shrink width */
    body.sidebar-collapsed #sidebar {
        width: var(--sidebar-collapsed-width);
    }

    /* 2. Hide text labels */
    body.sidebar-collapsed #sidebar .nav-link span,
    body.sidebar-collapsed #sidebar .offcanvas-title,
    body.sidebar-collapsed #sidebar .bi-chevron-down {
        display: none;
        opacity: 0;
        pointer-events: none;
    }

    /* 3. Hide footer content or adjust it */
    body.sidebar-collapsed #sidebar .sidebar-footer {
        display: none; /* Or adjust to show icons only */
    }
    
    /* 4. Center icons */
    body.sidebar-collapsed #sidebar .nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    body.sidebar-collapsed #sidebar .nav-link i {
        margin-right: 0;
    }

    /* 5. Hide submenus in collapsed state to prevent layout breaking */
    body.sidebar-collapsed #sidebar .collapse.show {
        display: none !important;
    }
}

/* ===================== */
/* MOBILE BEHAVIOR       */
/* ===================== */
/*@media (max-width: 991.98px) {*/
/*    #sidebar {*/
/*        !* Standard Offcanvas behavior on mobile *!*/
/*        position: fixed;*/
/*        top: var(--navbar-height); !* Starts below navbar *!*/
/*        bottom: 0;*/
/*        z-index: 1045;*/
/*        width: 100%; !* Full width or standard offcanvas width *!*/
/*        height: calc(100vh - var(--navbar-height));*/
/*        !* Offcanvas class handles transform/visibility *!*/
/*    }*/
/*    */
/*    !* Adjust offcanvas-start to account for top spacing if needed *!*/
/*    .offcanvas-start {*/
/*        top: var(--navbar-height); */
/*    }*/
/*}*/

@media (max-width: 991.98px) {
    .app-layout {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .content-wrapper {
        width: 100%;
    }
}


/* Loading Modal */
#loadingModal .modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}