/* =================================== */
/* SIDEBAR NAVIGATION STYLES */
/* =================================== */

.sidebar {
    width: 230px;
    height: 100vh;
    background-color: rgb(var(--card));
    border-right: 1px solid rgb(var(--border));
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgb(var(--border));
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: rgb(var(--foreground));
    font-size: 1.1rem;
    transition: opacity 0.3s ease;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: rgb(var(--primary));
}

.sidebar.collapsed .sidebar-brand .brand-text {
    display: none;
}

.sidebar-brand .version-text {
    margin-left: 0.5rem;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.5;
    color: rgb(var(--muted-foreground));
}

.sidebar.collapsed .sidebar-brand .version-text {
    display: none;
}

.sidebar.collapsed .sidebar-brand i {
    display: none;
}

.sidebar-toggle {
    border: none;
    background: none;
    color: rgb(var(--muted-foreground));
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: rgb(var(--accent));
    color: rgb(var(--foreground));
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgb(var(--muted-foreground) / 0.2) transparent;
}

/* Slim scrollbar for expanded sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgb(var(--muted-foreground) / 0.2);
    border-radius: 2px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--muted-foreground) / 0.4);
}

/* Hide scrollbar entirely when collapsed — prevents icon shift */
.sidebar.collapsed .sidebar-nav {
    overflow-y: hidden;
    scrollbar-width: none;
}
.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
    display: none;
}

/* Subtle scrollbar for main sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgb(var(--muted-foreground) / 0.15);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--muted-foreground) / 0.3);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.45rem 1.25rem;
    color: rgb(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
    cursor: pointer;
    font-size: 0.835rem;
}

.nav-item:hover {
    background-color: rgb(var(--accent));
    color: rgb(var(--accent-foreground));
    text-decoration: none;
}

.nav-item.active {
    background-color: rgb(var(--primary) / 0.1);
    color: rgb(var(--primary-text));
    border-right: 3px solid rgb(var(--primary));
}

.nav-item i {
    width: 18px;
    margin-right: 0.65rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-item {
    padding: 0.45rem;
    justify-content: center;
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
}

.nav-divider {
    height: 1px;
    background-color: rgb(var(--border));
    margin: 0.35rem 1rem;
}

.sidebar.collapsed .nav-divider {
    margin: 0.5rem;
}

.nav-section-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgb(var(--muted-foreground));
    opacity: 0.5;
    padding: 0.6rem 1.25rem 0.15rem;
    user-select: none;
}

.nav-section-label:first-child {
    padding-top: 0.15rem;
}

.sidebar.collapsed .nav-section-label {
    font-size: 0;
    padding: 0;
    margin: 0.5rem 0.75rem;
    height: 1px;
    background-color: rgb(var(--border));
    opacity: 0.3;
    overflow: hidden;
}

#adminNavItems.collapsed {
    display: none !important;
}

#adminNavItems {
    display: block;
}

.nav-section-label .fa-chevron-down {
    transition: transform 0.15s;
}

.nav-section-label.expanded .fa-chevron-down {
    transform: rotate(180deg);
}

/* Nav item with action button (e.g., Jobs with info icon) */
.nav-item-with-action {
    display: flex;
    align-items: center;
}

.nav-item-with-action .nav-item {
    flex: 1;
}

.nav-info-btn {
    background: transparent;
    border: none;
    color: rgb(var(--muted-foreground));
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.nav-info-btn:hover {
    opacity: 1;
    color: rgb(var(--primary));
}

/* Inline icon button inside nav-item (e.g., info icon on Jobs) */
.nav-pill-btn {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.nav-pill-btn i {
    width: auto;
    margin-right: 0;
    font-size: 1rem;
}

.nav-pill-btn:hover {
    opacity: 1;
    color: rgb(var(--primary));
}

.sidebar.collapsed .nav-pill-btn,
.sidebar.collapsed .nav-badge {
    display: none;
}

/* Removed submenu/accordion styles - admin links now display directly */

/* Cost widget in sidebar */
.sidebar .cost-widget {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.cost-summary {
    font-size: 0.75rem;
    border-top: 1px solid rgb(var(--border));
    margin-top: 0.5rem;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgb(var(--border));
    margin-top: auto;
}

.user-dropdown {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    color: rgb(var(--foreground));
    border: none;
    background: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
    text-decoration: none;
}

.user-dropdown:hover,
.user-dropdown:focus {
    text-decoration: none;
}

.user-dropdown:hover {
    background-color: rgb(var(--accent));
    border-radius: 0.375rem;
}

.user-dropdown i.fas.fa-user-circle {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: rgb(var(--primary));
}

.user-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .user-name,
.sidebar.collapsed .user-dropdown i.fas.fa-chevron-up {
    display: none;
}

.sidebar.collapsed .user-dropdown {
    justify-content: center;
}
