:root {
    --navbarheight: 90px;
    --sidebarwidth: 250px;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {

}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Layout wrapper */
#wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar (desktop default) */
#sidebar-wrapper {
    width: 250px;
    min-height: calc(100vh - var(--navbarheight));
    transition: all .25s ease-in-out;
    background: #f8f9fa;
    overflow-x: hidden;
    white-space: nowrap;
    z-index: 1030; /* stay above content */
}

/* Collapsed sidebar (desktop only) */
#wrapper.toggled #sidebar-wrapper {
    width: 200px; /* pick one value here */
}

/* Sidebar items */
#sidebar-wrapper .list-group-item {
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    #sidebar-wrapper .list-group-item i {
        width: 20px;
        text-align: center;
        color: #0d6efd; /* Bootstrap primary blue */
    }

    #sidebar-wrapper .list-group-item:hover {
        background-color: #f0f4ff;
        color: #0d6efd;
    }

/* Content area */
#page-content-wrapper {
    flex: 1;
    transition: margin-left .25s ease-out;
}

/* --- MOBILE MODE (<992px) --- */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: var(--navbarheight); /* below navbar */
        left: -250px; /* hidden by default */
        height: calc(100% - var(--navbarheight));
        box-shadow: 2px 0 5px rgba(0,0,0,.3);
    }

    #wrapper.toggled #sidebar-wrapper {
        left: 0; /* slide in */
    }

    /* Dark overlay when sidebar is open */
    #overlay {
        display: none;
        position: fixed;
        top: var(--navbarheight);
        left: 0;
        width: 100%;
        height: calc(100% - var(--navbarheight));
        background: rgba(0,0,0,.5);
        z-index: 1020;
    }

        #overlay.active {
            display: block;
        }
}

@media (max-width: 991.98px) {
    .navbar-brand {
        margin: auto;
    }
}

.sidebar {
    background: linear-gradient(180deg, #0d6efd, #0a58ca);
    color: #fff;
    margin-top: var(--navbarheight);
    position: fixed;
}

.main-background {
    background-color: #f0f0f0;
}

.main-content {
    margin-top: var(--navbarheight);
    margin-left: var(--sidebarwidth);
    min-height: calc(100vh - var(--navbarheight));
}

.main-content-login {
    margin-top: var(--navbarheight);
    min-height: calc(100vh - var(--navbarheight));
}

.alert {
    z-index: 9999;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        margin-top: 0; 
    }
}



/* Components */
.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    animation: fadein 0.3s, fadeout 0.3s 2.7s;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sorted-asc::after {
    font-family: "Font Awesome 5 Free";
    content: " \f0d7";
}

th.sorted-desc::after {
    font-family: "Font Awesome 5 Free";
    content: " \f0d8";
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}
