.sidebar {
    width: 200px;
    height: 100vh;
    background-color: #343a40;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    color: #ffffff;
    transition: transform 0.3s ease;
    overflow-x: hidden;
    overflow-y: hidden;
}





.sidebar-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 1rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.sidebar-item {
    width: 100%;
}

    .sidebar-item a {
        display: flex;
        align-items: center;
        padding: 10px 15px;
        font-size: 1rem;
        color: #ffffff;
        text-decoration: none;
        transition: background-color 0.3s;
    }

    .sidebar-item i {
        font-size: 1.2rem; /* Уменьшено для иконок */
        margin-right: 8px; /* Уменьшено с 10px */
    }

    .sidebar-item a:hover,
    .sidebar-item.active a {
        background-color: #495057;
        color: #8c92ce;
    }

    .sidebar-item.logout a {
        margin-top: auto;
        padding-bottom: 15px; /* Уменьшено */
        color: #dc3545;
    }

        .sidebar-item.logout a:hover {
            background-color: #721c24;
        }





.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px; 
    left: 10px; 
    background-color: rgba(52, 58, 64, 0.26); 
    color: #f8f9fa; 
    border: none;
    border-radius: 4px;
    padding: 5px;
    font-size: 20px; 
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); 
    transition: background-color 0.3s ease, transform 0.3s ease; 
}

    .sidebar-toggle:hover {
        background-color: rgba(52, 58, 64, 1);
        transform: scale(1.05); 
    }


.main-content {
    margin-left: 200px;
    transition: margin-left 0.3s ease;
}
.sidebar {
    z-index: 300;
}

    .sidebar.hidden {
        transform: translateX(-200px);
    }
    .sidebar .close-sidebar {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: rgba(52, 58, 64, 0.26);
        color: #f8f9fa;
        border: none;
        border-radius: 4px;
        padding: 5px;
        font-size: 20px;
        cursor: pointer;
        z-index: 3;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: background-color 0.3s ease, transform 0.3s ease;
    }

        .sidebar .close-sidebar:hover {
            background-color: rgba(52, 58, 64, 1);
            transform: scale(1.05);
        }
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }

        .sidebar.hidden {
            transform: translateX(-100%);
        }


    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}
#overlay {
    position: fixed; /* Фиксированное положение на экране */
    top: 0;
    left: 0;
    width: 100%; /* Занимает всю ширину */
    height: 100%; /* Занимает всю высоту */
    background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный черный фон */
    z-index: 2; /* Должен быть выше контента */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}


@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }
}
