/* custom-sidebar.css - vFINAL */
body {
    overflow-x: hidden;
}

#wrapper {
    padding-left: 0;
}

#sidebar-wrapper {
    z-index: 1000;
    position: fixed;
    left: 250px;
    width: 0; /* Default closed state */
    height: 100%;
    margin-left: -250px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

/* Wide screens: Sidebar open by default */
@media (min-width: 768px) {
    #wrapper #sidebar-wrapper {
        width: 250px; /* Open by default */
    }
    #wrapper #page-content-wrapper,
    #wrapper ~ footer {
        margin-left: 250px; /* Shift content for open sidebar */
        width: calc(100% - 250px);
    }
    #wrapper .page-top-bar {
        left: 250px;
        width: calc(100% - 250px);
    }
    #wrapper.toggled #sidebar-wrapper {
        width: 0; /* Allow closing on wide screens */
    }
    #wrapper.toggled #page-content-wrapper,
    #wrapper.toggled ~ footer {
        margin-left: 0;
        width: 100%;
    }
    #wrapper.toggled .page-top-bar {
        left: 0;
        width: 100%;
    }
}
/* Mobile screens: Sidebar closed by default */
@media (max-width: 767px) {
    #wrapper #sidebar-wrapper {
        width: 0; /* Ensure closed by default */
    }
    #wrapper #page-content-wrapper,
    #wrapper ~ footer {
        margin-left: 0;
        width: 100%;
    }
    #wrapper .page-top-bar {
        left: 0;
        width: 100%;
    }
    #wrapper.toggled #sidebar-wrapper {
        width: 250px; /* Open state when toggled */
    }
    #wrapper.toggled #page-content-wrapper,
    #wrapper.toggled ~ footer {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
    #wrapper.toggled .page-top-bar {
        left: 250px;
        width: calc(100% - 250px);
    }
}

#page-content-wrapper {
    width: 100%;
    position: relative;
    padding: 0 15px;
    padding-top: 60px; /* Space for fixed .page-top-bar */
}

/* Transitions for all toggles */
#wrapper.toggled #sidebar-wrapper,
#wrapper:not(.toggled) #sidebar-wrapper,
#wrapper.toggled #page-content-wrapper,
#wrapper:not(.toggled) #page-content-wrapper,
#wrapper.toggled .page-top-bar,
#wrapper:not(.toggled) .page-top-bar,
#wrapper.toggled ~ footer,
#wrapper:not(.toggled) ~ footer {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* Slim Top Bar */
.page-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 999;
}

.page-top-bar {
    font-size: 0.9em;
    color: #555;
}

/* Hamburger button */
.hamburger-btn {
    font-size: 18px;
    margin-right: 15px;
    color: #333;
    background-color: transparent;
    border: none;
    padding: 8px 10px;
    line-height: 1;
}
.hamburger-btn:hover,
.hamburger-btn:focus {
    color: #000;
}

/* Company selector styles */
.page-top-bar .company-selector-dropdown-actual {
    position: relative;
    margin-left: 5px;
}
.page-top-bar .company-selector-dropdown-actual .dropdown-toggle {
    color: #337ab7;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    display: inline-block;
}
.page-top-bar .company-selector-dropdown-actual .dropdown-toggle:hover,
.page-top-bar .company-selector-dropdown-actual .dropdown-toggle:focus {
    text-decoration: underline;
}
.page-top-bar .company-selector-dropdown-actual .dropdown-menu {
    margin-top: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    background-color: #ffffff;
    min-width: 240px;
    padding-top: 5px;
    padding-bottom: 5px;
    z-index: 1001;
}
.page-top-bar .company-selector-dropdown-actual .dropdown-menu > li > a,
.page-top-bar .company-selector-dropdown-actual .dropdown-menu > a.dropdown-item {
    color: #333;
    padding: 8px 15px;
    font-size: 0.95em;
    white-space: nowrap;
    display: block;
    clear: both;
    font-weight: normal;
    text-decoration: none;
}
.page-top-bar .company-selector-dropdown-actual .dropdown-menu > li > a:hover,
.page-top-bar .company-selector-dropdown-actual .dropdown-menu > a.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #000;
}

/* Sidebar navigation */
.sidebar-nav {
    position: absolute;
    top: 0;
    width: 250px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
}
.sidebar-nav > .sidebar-brand {
    height: auto;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #f0f0f0;
}
.sidebar-nav > .sidebar-brand a {
    color: #343a40;
    text-decoration: none;
    display: inline-block;
    border: none;
}
.sidebar-nav > .sidebar-brand a:hover {
    background: none;
}
.sidebar-nav > .sidebar-brand img.logo {
    max-height: 40px;
    width: auto;
    margin: 0;
    display: block;
}
.sidebar-nav li {
    line-height: 20px;
}
.sidebar-nav li a {
    display: block;
    text-decoration: none;
    color: #337ab7;
    padding: 10px 15px;
    border-bottom: 1px solid #e7e7e7;
}
.sidebar-nav li:last-child a {
    border-bottom: none;
}
.sidebar-nav li a:hover, .sidebar-nav li.open > a {
    text-decoration: none;
    color: #23527c;
    background: #f0f0f0;
}
.sidebar-nav li.dropdown > .dropdown-menu {
    position: static;
    float: none;
    width: auto;
    margin-top: 0;
    background-color: transparent;
    border: 0;
    box-shadow: none;
    padding-left: 15px;
}
.sidebar-nav li.dropdown > .dropdown-menu > li > a {
    padding: 8px 15px;
    color: #555;
    border-bottom: none;
}
.sidebar-nav li.dropdown > .dropdown-menu > li > a:hover {
    color: #000;
    background-color: #e7e7e7;
}
.sidebar-nav #logoutFormSidebar button {
    padding: 10px 15px;
    text-align: left;
    width: 100%;
    border: none;
    background: none;
    color: #337ab7;
    line-height: 20px;
}
.sidebar-nav #logoutFormSidebar button:hover {
    color: #23527c;
    background: #f0f0f0;
}
.sidebar-nav li.nav-item.active > a.nav-link,
.sidebar-nav li.nav-item.dropdown.active > a.dropdown-toggle {
    font-weight: bold;
    color: #0056b3;
}
.sidebar-nav .dropdown-menu a.dropdown-item.active {
    font-weight: bold;
    color: #0056b3;
    background-color: #f0f0f0;
}

/* Sidebar profile section */
.sidebar-profile {
    margin-top: auto;
    padding: 10px 15px;
    border-top: 1px solid #dee2e6;
    background-color: #f0f0f0;
    position: relative;
}
.sidebar-profile .profile-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    width: 100%;
}
.sidebar-profile .profile-toggle:hover,
.sidebar-profile .profile-toggle:focus {
    text-decoration: none;
}
.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    margin-right: 10px;
    flex-shrink: 0;
}
.profile-info {
    flex-grow: 1;
    overflow: hidden;
}
.profile-name {
    display: block;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-role {
    display: block;
    font-size: 0.8em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-caret {
    margin-left: auto;
    color: #555;
}
.sidebar-profile .profile-dropdown-menu {
    border: 1px solid #ccc;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    background-color: #fff;
    width: calc(100% + 2px);
    left: -1px;
    bottom: 100%;
    margin-bottom: 5px;
    min-width: 0;
}
.profile-dropdown-menu .dropdown-item {
    padding: 8px 15px;
    color: #333;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}
.profile-dropdown-menu .dropdown-item .glyphicon {
    margin-right: 8px;
    opacity: 0.7;
}
.profile-dropdown-menu .dropdown-item:hover {
    background-color: #f5f5f5;
    color: #000;
}
.profile-dropdown-menu .btn-logout {
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

/* .ra-not-production theme */
.ra-not-production #sidebar-wrapper {
    background: lightseagreen !important;
    border-right-color: #00796b !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav li a,
.ra-not-production #sidebar-wrapper .sidebar-nav > .sidebar-brand a {
    color: white !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav li:last-child a {
    border-bottom: none !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav li a:hover,
.ra-not-production #sidebar-wrapper .sidebar-nav li.open > a {
    background-color: rgba(0, 0, 0, 0.15) !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav #logoutFormSidebar button,
.ra-not-production #sidebar-wrapper .sidebar-nav .manage-account-link {
    color: white !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav #logoutFormSidebar button:hover,
.ra-not-production #sidebar-wrapper .sidebar-nav .manage-account-link:hover {
    background-color: rgba(0, 0, 0, 0.15) !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav li.nav-item.active > a.nav-link,
.ra-not-production #sidebar-wrapper .sidebar-nav li.nav-item.dropdown.active > a.dropdown-toggle {
    color: #ffffff !important;
}
.ra-not-production #sidebar-wrapper .sidebar-nav .dropdown-menu a.dropdown-item.active {
    color: #ffffff !important;
    background-color: rgba(0,0,0,0.25) !important;
}
.ra-not-production .page-top-bar {
    background: #00796b !important;
    border-bottom-color: #004d40 !important;
    color: #e0e0e0 !important;
}
.ra-not-production .page-top-bar .hamburger-btn {
    color: white !important;
}
.ra-not-production .page-top-bar .hamburger-btn:hover,
.ra-not-production .page-top-bar .hamburger-btn:focus {
    color: #e0e0e0 !important;
}
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-toggle {
    color: white !important;
}
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-toggle:hover,
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-toggle:focus {
    color: #f0f0f0 !important;
}
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-menu {
    background-color: #00695c !important;
    border: 1px solid #004d40 !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-menu > li > a,
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-menu > a.dropdown-item {
    color: white !important;
}
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-menu > li > a:hover,
.ra-not-production .page-top-bar .company-selector-dropdown-actual .dropdown-menu > a.dropdown-item:hover {
    background-color: #00796b !important;
    color: #f0f0f0 !important;
}
.ra-not-production .sidebar-profile {
    background-color: #00695c;
    border-top-color: #004d40;
}
.ra-not-production .sidebar-profile .profile-toggle {
    color: white;
}
.ra-not-production .profile-avatar {
    background-color: lightseagreen;
    color: #004d40;
}
.ra-not-production .profile-role {
    color: #b2dfdb;
}
.ra-not-production .profile-caret {
    color: #e0e0e0;
}
.ra-not-production .sidebar-profile .profile-dropdown-menu,
.ra-not-production .sidebar-nav > .sidebar-brand {
    background-color: #00796b;
    border-color: #004d40;
}
.ra-not-production .profile-dropdown-menu .dropdown-item,
.ra-not-production .profile-dropdown-menu .btn-logout {
    color: white;
}
.ra-not-production .profile-dropdown-menu .dropdown-item:hover,
.ra-not-production .profile-dropdown-menu .btn-logout:hover {
    background-color: #00695c;
    color: #f0f0f0;
}
.ra-not-production .profile-dropdown-menu .dropdown-item .glyphicon {
    opacity: 0.8;
}