/* Sidebar unified with internal theme */
:root {
    --sidebar-width: 15rem;
    --sidebar-surface: #eef3f2;
    --sidebar-heading: #eef3f2;
    --sidebar-border: #eef3f2;
    --sidebar-text: #425257;
    --sidebar-muted: #6f7f84;
    --sidebar-primary: #5c6f6c;
    --sidebar-secondary: #849d9a;
    --sidebar-hover-bg: #edf6f4;
    --sidebar-active-shadow: 0 8px 18px rgba(92, 111, 108, 0.2);
}

#wrapper {
    display: flex;
    position: relative;
    min-height: 100vh;
}

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: calc(-1 * var(--sidebar-width));
    transition: margin 0.25s ease-out;
    background: var(--sidebar-surface);
    border-right: 1px solid var(--sidebar-border);
    position: relative;
    width: var(--sidebar-width);
}

#sidebar-wrapper .sidebar-heading {
    padding: 0.9rem 1.2rem 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2a2d;
    background: var(--sidebar-heading);
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

#sidebar-wrapper .sidebar-headings {
    padding: 0.1rem 1.2rem 0.65rem !important;
    font-size: 0.84rem;
    color: var(--sidebar-muted) !important;
    background: var(--sidebar-heading);
}

#sidebar-wrapper hr {
    border-top: 1px solid var(--sidebar-border);
}

#sidebar-wrapper .list-group {
    width: var(--sidebar-width);
    padding: 0.35rem 0.4rem 3.4rem;
    gap: 0.18rem;
    background: var(--sidebar-surface);
}

#sidebar-wrapper .sidebar-dropdown-ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: none;
}

#sidebar-wrapper .nav-item {
    width: 100%;
}

#sidebar-wrapper .list-group-item {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.62rem 0.85rem;
    color: var(--sidebar-text);
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    position: relative;
    font-weight: 500;
    background: transparent !important;
}

#sidebar-wrapper .list-group-item i {
    margin-right: 0.45rem;
    color: #5f7278;
    transition: color 0.2s ease;
}

#sidebar-wrapper .list-group-item:hover {
    background: var(--sidebar-hover-bg) !important;
    color: #30444a;
    border-color: #d6e5e2;
    transform: translateX(1px);
}

#sidebar-wrapper .list-group-item:hover i {
    color: #3f585f;
}

#sidebar-wrapper .list-group-item.active {
    background: linear-gradient(135deg, var(--sidebar-primary), var(--sidebar-secondary)) !important;
    color: #ffffff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: var(--sidebar-active-shadow);
}

#sidebar-wrapper .list-group-item.active i {
    color: #ffffff;
}

#sidebar-wrapper .dropdown-toggle::after {
    margin-left: auto;
}

#sidebar-wrapper .dropdown-menu {
    border: 1px solid var(--sidebar-border);
    background: #ffffff;
    box-shadow: 0 14px 24px rgba(31, 42, 45, 0.12);
    margin: 0.2rem 0 0.2rem 0.35rem;
    padding: 0.4rem;
    border-radius: 10px;
    min-width: 12.2rem;
}

#sidebar-wrapper .dropdown-item {
    padding: 0.5rem 0.62rem;
    color: var(--sidebar-text);
    transition: all 0.2s ease;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.88rem;
}

#sidebar-wrapper .dropdown-item:hover {
    background: var(--sidebar-hover-bg);
    color: #30444a;
    border-color: #d6e5e2;
}

#sidebar-wrapper .dropdown-item.active {
    background: #e8f3f1;
    color: #2f4b50;
    font-weight: 700;
    border-color: #d2e3df;
}

#menu-toggle {
    background: var(--sidebar-heading);
    border: 1px solid var(--sidebar-border);
    border-left: none;
    padding: 0.5rem;
    width: var(--sidebar-width);
    height: 3rem;
    color: #4d6167;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

#menu-toggle:hover {
    background: #e8f1ef;
    color: #33484e;
}

#menu-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

#wrapper.toggled #menu-toggle {
    width: 3rem;
}

#wrapper.toggled #menu-toggle i {
    transform: rotate(180deg);
}

#page-content-wrapper {
    min-width: 100vw;
    margin-left: 0;
    display: flex;
    flex-direction: column;
}

#page-content-wrapper .container-fluid {
    display: flex;
    flex-direction: column;
}

#page-content-wrapper .row {
    width: 100%;
}

#page-content-wrapper .col-12 {
    display: flex;
    justify-content: flex-start;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
    }
}

.title {
    padding: 0.875rem 1.25rem;
    font-size: 1.5rem;
    background: var(--sidebar-heading);
    border-bottom: 1px solid var(--sidebar-border);
    margin: 0;
    color: #40545a;
    display: flex;
    align-items: center;
    width: 100%;
    height: 3.5rem;
    font-weight: 700;
}

.title .btn {
    margin-left: 0.5rem;
}

.text-center.pt-2 {
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-heading);
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-headings.text-center.small.text-muted.ps-3 {
    background: var(--sidebar-surface);
    border-bottom: 1px solid var(--sidebar-border);
}