.mantine-Switch-root {
    cursor: pointer !important;
}

.table-purple th,
.table-purple thead th,
.table.table-purple thead th {
    background-color: rgba(156, 0, 191, 1) !important; /* Purple */
    color: white !important; /* Text color */
}

/* =============================================================================
   NAVIGATION - Active State & Hover Effects
   ============================================================================= */

/* Active nav link - prominent purple highlight */
.nav-link.active {
    background-color: rgba(156, 0, 191, 0.25) !important; /* Purple with transparency */
    color: #ffffff !important;
    border-radius: 6px;
    font-weight: 600 !important;
    position: relative;
}

/* Underline effect for active nav link - only on xl screens (matches navbar expand="xl" breakpoint) */
@media (min-width: 1200px) {
    .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background-color: #9C00BF; /* Purple underline */
        border-radius: 1px;
    }
}

/* Hover effect for nav links */
.nav-link:hover:not(.active) {
    background-color: rgba(156, 0, 191, 0.1) !important; /* Subtle purple hover */
    border-radius: 6px;
}

/* Logout button styling */
#signout-button {
    transition: all 0.2s ease;
}

#signout-button:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: white !important;
    color: white !important;
    cursor: pointer;
}

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

/* Base Sidebar Container */
.sidebar-container {
    position: fixed;
    top: 0;
    height: 100vh;
    background-color: #2a3439; /* charcoal_hex */
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: width 0.3s ease;
    overflow: hidden;
}

/* Hidden sidebar for top/bottom navbar compatibility */
.sidebar-hidden {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Position-specific styles */
.sidebar-container.left {
    left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-container.right {
    right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Expanded/Collapsed states */
.sidebar-container.expanded {
    width: 220px;
}

.sidebar-container.collapsed {
    width: 60px;
}

/* --- Sidebar Brand --- */
.sidebar-brand {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(156, 0, 191, 0.4); /* purple_rgb4 */
    min-height: 60px;
}

.sidebar-brand-img {
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar-container.collapsed .sidebar-brand-img {
    opacity: 0;
    width: 0;
    display: none;
}

/* Logo/icon shown when sidebar is collapsed */
.sidebar-brand-collapsed-img {
    display: none;
    transition: opacity 0.2s ease;
}

.sidebar-container.collapsed .sidebar-brand-collapsed-img {
    display: block;
}

/* --- Sidebar User Info --- */
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(156, 0, 191, 0.4);
}

.sidebar-container.collapsed .sidebar-user-info {
    padding: 12px 8px;
    align-items: center;
}

.sidebar-container.collapsed .sidebar-user-info .mantine-Badge-root {
    padding: 4px;
    min-width: auto;
}

.sidebar-container.collapsed .sidebar-user-info .mantine-Badge-label {
    display: none;
}

/* --- Sidebar Toggle Button --- */
.sidebar-toggle-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(156, 0, 191, 0.4);
    transition: background-color 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(156, 0, 191, 0.2);
}

/* --- Sidebar Navigation --- */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Sidebar links (dark sidebar default) */
.sidebar-link {
    display: flex !important;
    align-items: center;
    gap: 9px;
    padding: 6px 14px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 0 !important;
}

.sidebar-link:hover {
    background-color: rgba(156, 0, 191, 0.2) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.sidebar-link.active {
    background-color: rgba(156, 0, 191, 0.4) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Remove underline from sidebar link container */
.sidebar-link.active::after {
    display: none !important;
}

/* Add underline to sidebar label text only */
.sidebar-link.active .sidebar-label {
    position: relative;
}

.sidebar-link.active .sidebar-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #9C00BF;
    border-radius: 1px;
}

/* Active state border */
.sidebar-container.left .sidebar-link.active {
    border-left: 3px solid #9C00BF;
}

.sidebar-container.right .sidebar-link.active {
    border-right: 3px solid #9C00BF;
}

.sidebar-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.sidebar-label {
    font-size: 0.9rem;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-container.collapsed .sidebar-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-container.collapsed .sidebar-link {
    padding: 8px;
    justify-content: center;
}

/* --- Sidebar Logout --- */
.sidebar-logout {
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid rgba(156, 0, 191, 0.4);
    padding: 15px;
    padding-bottom: 25px;
}

.sidebar-logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

.sidebar-logout-link:hover {
    background-color: rgba(255, 100, 100, 0.2) !important;
}

/* --- Content Wrapper for Sidebar Layouts --- */
.content-with-sidebar-left {
    margin-left: 220px;
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
    max-width: calc(100vw - 220px);
}

.content-with-sidebar-left.sidebar-collapsed {
    margin-left: 60px;
    max-width: calc(100vw - 60px);
}

.content-with-sidebar-right {
    margin-right: 220px;
    transition: margin-right 0.3s ease;
    overflow-x: hidden;
    max-width: calc(100vw - 220px);
}

.content-with-sidebar-right.sidebar-collapsed {
    margin-right: 60px;
    max-width: calc(100vw - 60px);
}

/* --- Layout Flexbox for Sidebar --- */
.layout-left,
.layout-right {
    display: flex;
    flex-direction: row;
}

.layout-right {
    flex-direction: row-reverse;
}

/* --- Light Mode Sidebar --- */
.sidebar-container.sidebar-light {
    background-color: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
}

.sidebar-container.sidebar-light .sidebar-brand,
.sidebar-container.sidebar-light .sidebar-user-info,
.sidebar-container.sidebar-light .sidebar-toggle-btn,
.sidebar-container.sidebar-light .sidebar-logout {
    border-color: rgba(0, 0, 0, 0.1);
}

.sidebar-container.sidebar-light.left {
    border-right-color: rgba(0, 0, 0, 0.1);
}

.sidebar-container.sidebar-light.right {
    border-left-color: rgba(0, 0, 0, 0.1);
}

.sidebar-container.sidebar-light .sidebar-toggle-btn {
    color: #212529;
}

.sidebar-container.sidebar-light .sidebar-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.sidebar-container.sidebar-light .sidebar-link {
    color: #212529 !important;
}

.sidebar-container.sidebar-light .sidebar-link:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    color: #000 !important;
}

.sidebar-container.sidebar-light .sidebar-link.active {
    background-color: rgba(156, 0, 191, 0.15) !important;
    color: #000 !important;
}

/* --- Responsive Sidebar --- */
@media (max-width: 991px) {
    .sidebar-container {
        width: 60px !important;
    }

    .sidebar-container .sidebar-label,
    .sidebar-container .sidebar-brand-img {
        opacity: 0;
        width: 0;
    }

    .sidebar-container .sidebar-link {
        padding: 12px;
        justify-content: center;
    }

    .content-with-sidebar-left {
        margin-left: 60px !important;
        max-width: calc(100vw - 60px) !important;
    }

    .content-with-sidebar-right {
        margin-right: 60px !important;
        max-width: calc(100vw - 60px) !important;
    }
}

@media (max-width: 576px) {
    .sidebar-container {
        width: 50px !important;
    }

    .content-with-sidebar-left {
        margin-left: 50px !important;
        max-width: calc(100vw - 50px) !important;
    }

    .content-with-sidebar-right {
        margin-right: 50px !important;
        max-width: calc(100vw - 50px) !important;
    }

    .sidebar-icon {
        font-size: 1rem;
    }
}