/* Bootstrap 5 Dashboard Layout Glue */

body {
    min-height: 100vh;
    display: flex;
    overflow: auto;
    flex-direction: column;
    scroll-behavior: smooth;
    /* overflow: hidden; Removed to fix mouse wheel scroll */
    /* Prevent body scroll, let sidebar and content scroll independently */
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    /* Above Table Headers (1020) and Navbar (1030) */
    background-color: #fff;
    border-right: 1px solid rgba(0, 0, 0, .1);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    /* Enable sidebar scroll */
    padding-top: 60px;
    /* Height of navbar */
    padding-bottom: 20px;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

/* Main Content */
.content-wrapper {
    margin-left: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Full height */
    overflow-y: auto;
    /* Enable content scroll */
    padding-top: 60px;
    /* Height of navbar */
    transition: margin-left 0.3s ease-in-out;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

@media (min-width: 992px) {
    .content-wrapper {
        margin-left: 280px;
    }
}

@media (max-width: 991.98px) {
    .sidebar-toggler {
        display: block;
    }
}

/* Navbar */
.navbar-fixed-top,
.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    /* Lower than modal (1055) */
    height: 60px;
}

/* Disable Table Hover */
.table-hover tbody tr:hover {
    background-color: transparent;
    color: inherit;
}

/* Active Navigation Item */
.nav-pills .nav-link.active {
    background-color: rgba(255, 117, 31, 0.1);
    /* Light Orange */
    color: var(--primary-color) !important;
    /* Dark Orange */
    font-weight: 600;
    border-radius: 0.25rem;
}

/* Large Checkbox */
.form-check-lg {
    min-height: 1.5rem;
    padding-left: 2.5em;
    margin-bottom: 0.5rem;
}

.form-check-lg .form-check-input {
    float: left;
    margin-left: -2.5em;
    width: 1.8em;
    height: 1.8em;
    margin-top: 0;
    border: 2px solid #adb5bd;
    cursor: pointer;
}

.form-check-lg .form-check-input:checked {
    background-color: var(--primary-color) !important;
    /* Orange */
    border-color: var(--primary-color) !important;
}

.form-check-lg .form-check-label {
    padding-left: 0.5em;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.8em;
    /* Align with checkbox height */
    cursor: pointer;
    color: #333;
}

/* Tree Layout Styling */
.tree-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.module-block {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.module-header {
    background-color: #93c9ff !important;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.module-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
}

.module-body {
    padding: 20px;
    background-color: #fff;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.permission-item {
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.permission-item:hover {
    background-color: #fff8f3;
    /* Very light orange tint */
}

/* Navigation Styling */
.nav {
    font-weight: 500;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}