/* Enhanced Refined Header and Sidebar Layout */

/* Global CSS Variables for Multi-tenant Support */
/* Tenant colors are loaded via tenant_css_variables template tag in base.html */
:root {
    /* Layout and neutral colors */
    --white: #FFFFFF;
    --header-bg: var(--tenant-primary);
    --sidebar-bg: var(--white);
    --sidebar-selected-bg: var(--tenant-primary-light);
    --primary-text: var(--tenant-primary);
    --secondary-text: #6B7280;
    --border-color: #E5E7EB;
    --hover-bg: #F9FAFB;
    --sidebar-width: 320px;
    --transition-duration: 0.3s;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Header Styles */
.refined-header {
    display: flex;
    width: 100%;
    height: 78px;
    padding: 0 32px 0 24px;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--tenant-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

.header-logo .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo .logo-image {
    width: 180px;
    height: 40px;
    object-fit: contain;
}

/* Header Right Section */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Notification Bell */
.notification-section {
    position: relative;
}

.notification-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: var(--tenant-primary-hover);
    transform: scale(1.05);
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Section */
.profile-section {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.profile-btn:hover {
    background: var(--tenant-primary-hover);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.profile-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.profile-dropdown-arrow {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease;
}

/* Auth Links for Non-authenticated Users */
.auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.auth-btn.outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.auth-btn.outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auth-btn.primary {
    background: var(--tenant-secondary);
    color: white;
}

.auth-btn.primary:hover {
    background: white;
    color: var(--tenant-secondary);
}



.refined-sidebar.open {
    transform: translateX(0);
}

/* Smooth transitions for all sidebar elements */
.refined-sidebar * {
    transition: all var(--transition-duration) ease;
}

/* Enhanced Organization Header in Sidebar */
.sidebar-org-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.org-logo-section {
    margin-bottom: 16px;
    position: relative;
}

.org-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
}

.org-logo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.org-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-text) 0%, #6366f1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
}

.org-avatar-placeholder:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.org-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-text);
    text-align: center;
    margin-bottom: 4px;
    transition: opacity var(--transition-duration) ease;
}

.org-type {
    font-size: 12px;
    color: var(--secondary-text);
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity var(--transition-duration) ease;
}

/* Enhanced Sidebar Navigation */
.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding: 0 24px;
    transition: opacity var(--transition-duration) ease;
}

.nav-links-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.nav-link-item {
    display: flex;
    width: calc(100% - 24px);
    min-height: 48px;
    padding: 12px 20px;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--primary-text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 24px 24px 0;
    margin-left: 24px;
    position: relative;
    overflow: hidden;
}

.nav-link-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-text);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-link-item:hover {
    background: var(--hover-bg);
    transform: translateX(4px);
    box-shadow: var(--shadow-light);
}

.nav-link-item:hover::before {
    transform: scaleY(1);
}

.nav-link-item.active {
    background: var(--sidebar-selected-bg);
    color: var(--primary-text);
    font-weight: 600;
    box-shadow: var(--shadow-light);
}

.nav-link-item.active::before {
    transform: scaleY(1);
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-link-item:hover .nav-link-icon {
    transform: scale(1.1);
}

.nav-link-text {
    color: inherit;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    flex: 1;
    white-space: nowrap;
    transition: opacity var(--transition-duration) ease;
}

.nav-link-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Enhanced Sidebar Footer */
.sidebar-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    backdrop-filter: blur(10px);
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-light);
}

.sidebar-collapse-btn:hover {
    background: var(--primary-text);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.sidebar-collapse-btn svg {
    transition: transform 0.2s ease;
}

.sidebar-collapse-btn:hover svg {
    transform: scale(1.1);
}

/* Enhanced Sidebar Styles */
.refined-sidebar {
    position: fixed;
    top: 78px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 78px);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    transform: translateX(-100%);
    transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-medium);
}

.refined-sidebar.open {
    transform: translateX(0);
}

/* Removed collapsed state - sidebar is now either open or closed */

/* Smooth transitions for all sidebar elements */
.refined-sidebar * {
    transition: all var(--transition-duration) ease;
}

/* Enhanced Organization Header in Sidebar */
.sidebar-org-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.org-logo-section {
    margin-bottom: 16px;
    position: relative;
}

.org-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
}

.org-logo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.org-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-text) 0%, #6366f1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
}

.org-avatar-placeholder:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.org-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-text);
    text-align: center;
    margin-bottom: 4px;
    transition: opacity var(--transition-duration) ease;
}

.org-type {
    font-size: 12px;
    color: var(--secondary-text);
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity var(--transition-duration) ease;
}

/* Enhanced Sidebar Navigation */
.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding: 0 24px;
    transition: opacity var(--transition-duration) ease;
}

.nav-links-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.nav-link-item {
    display: flex;
    width: calc(100% - 24px);
    min-height: 48px;
    padding: 12px 20px;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--primary-text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 24px 24px 0;
    margin-left: 24px;
    position: relative;
    overflow: hidden;
}

.nav-link-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-text);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-link-item:hover {
    background: var(--hover-bg);
    transform: translateX(4px);
    box-shadow: var(--shadow-light);
}

.nav-link-item:hover::before {
    transform: scaleY(1);
}

.nav-link-item.active {
    background: var(--sidebar-selected-bg);
    color: var(--primary-text);
    font-weight: 600;
    box-shadow: var(--shadow-light);
}

.nav-link-item.active::before {
    transform: scaleY(1);
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-link-item:hover .nav-link-icon {
    transform: scale(1.1);
}

.nav-link-text {
    color: inherit;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    flex: 1;
    white-space: nowrap;
    transition: opacity var(--transition-duration) ease;
}

.nav-link-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Enhanced Sidebar Footer */
.sidebar-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    backdrop-filter: blur(10px);
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-light);
}

.sidebar-collapse-btn:hover {
    background: var(--primary-text);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.sidebar-collapse-btn svg {
    transition: transform 0.2s ease;
}

.sidebar-collapse-btn:hover svg {
    transform: scale(1.1);
}

/* Removed collapsed state adjustments */

/* Enhanced Main Content Adjustment */
.main-content {
    transition: margin-left var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
    min-height: calc(100vh - 78px);
    position: relative;
}

.main-content.sidebar-open {
    margin-left: var(--sidebar-width);
}

/* Removed collapsed state margin */

/* Floating Action Button for Sidebar */
.sidebar-fab {
    position: fixed;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: var(--primary-text);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) scale(0.8);
}

.sidebar-fab.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.sidebar-fab:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sidebar-fab:active {
    transform: translateY(-50%) scale(0.95);
}

.sidebar-fab svg {
    transition: transform 0.2s ease;
}

.sidebar-fab:hover svg {
    transform: scale(1.1);
}

/* FAB tooltip */
.sidebar-fab::after {
    content: 'Open Sidebar';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.sidebar-fab:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(4px);
}

/* Page wrapper for better layout control */
.page-wrapper {
    display: flex;
    min-height: calc(100vh - 78px);
}

.content-area {
    flex: 1;
    padding: 24px;
    background: #f8fafc;
    transition: all var(--transition-duration) ease;
}

/* Ensure content doesn't overlap with FAB */
.main-content {
    padding-left: 0;
    transition: padding-left var(--transition-duration) ease;
}

.main-content.fab-visible {
    padding-left: 80px; /* Space for FAB */
}

@media (max-width: 768px) {
    .main-content.fab-visible {
        padding-left: 64px; /* Less space on mobile */
    }
}

/* Sidebar toggle button in header */
.sidebar-toggle-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle-header:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sidebar-toggle-header svg {
    transition: transform 0.2s ease;
}

.sidebar-toggle-header.sidebar-open svg {
    transform: rotate(180deg);
}

/* Simplified sidebar toggle states */
.sidebar-toggle-header svg {
    transition: transform 0.2s ease;
}


/* Enhanced Mobile Responsive */
@media (min-width: 1024px) {
    .refined-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .refined-sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .sidebar-toggle-header {
        display: flex;
    }
    
    .main-content.sidebar-open,
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }
    
    .refined-header {
        padding: 0 16px;
        height: var(--header-height);
    }
    
    /* Mobile logo sizing */
    .header-logo .logo-image {
        width: 140px;
        height: 32px;
    }
    
    .refined-sidebar {
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        width: min(var(--sidebar-width), 90vw);
        border-radius: 0 16px 0 0;
    }
    
    .main-content {
        min-height: calc(100vh - var(--header-height));
    }
    
    .profile-info {
        display: none;
    }
    
    .auth-section {
        gap: 8px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .notification-btn,
    .sidebar-toggle-header {
        width: 36px;
        height: 36px;
    }
    
    /* Mobile dropdown adjustments */
    .dropdown-menu {
        right: 0;
        min-width: 280px;
        max-width: calc(100vw - 32px);
        transform-origin: top right;
    }
    
    .profile-btn {
        min-width: auto;
        padding: 8px 12px;
    }
    
    .profile-dropdown-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .refined-sidebar {
        width: 100vw;
        border-radius: 0;
    }
    
    .refined-header {
        padding: 0 12px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .sidebar-fab {
        width: 48px;
        height: 48px;
        left: 16px;
    }
    
    .sidebar-fab::after {
        display: none; /* Hide tooltip on mobile */
    }
    
    /* Full width dropdowns on small screens */
    .dropdown-menu {
        right: -8px;
        left: 8px;
        min-width: auto;
        max-width: none;
        width: calc(100vw - 16px);
    }
    
    .profile-btn {
        padding: 6px 8px;
    }
    
    .profile-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .notification-btn,
    .sidebar-toggle-header {
        width: 32px;
        height: 32px;
    }
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

.dropdown-header {
    padding: 16px;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-text);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
}

.dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-info {
    flex: 1;
}

.dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 2px;
}

.dropdown-email {
    font-size: 12px;
    color: var(--secondary-text);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--primary-text);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Tenant Color Customization */
.tenant-colors {
    --header-bg: var(--primary-color, #522A84);
    --sidebar-selected-bg: var(--primary-bg-light, #F5E4FF);
    --primary-text: var(--primary-color, #522A84);
}

/* Enhanced Animations and Interactions */
@keyframes slideInSidebar {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutSidebar {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Simplified animations - only slide in/out */
.refined-sidebar.open {
    animation: slideInSidebar var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.active {
    animation: fadeIn 0.2s ease;
}

/* Hover effects for better UX */
.nav-link-item {
    position: relative;
}

.nav-link-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid var(--primary-text);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-link-item:hover::after {
    opacity: 0.3;
}

.nav-link-item.active::after {
    opacity: 1;
}

/* Loading states */
.sidebar-loading {
    position: relative;
    overflow: hidden;
}

.sidebar-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-text), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Focus states for accessibility */
.nav-link-item:focus,
.sidebar-collapse-btn:focus,
.sidebar-toggle-header:focus {
    outline: 2px solid var(--primary-text);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/
* Sidebar Profile Dropdown Styles */
.org-profile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.org-profile-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.org-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    width: 100%;
}

.org-dropdown-arrow {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--secondary-text);
    transition: transform 0.2s ease;
}

.org-profile-btn:hover .org-dropdown-arrow {
    color: var(--primary-text);
}

.org-profile-btn.active .org-dropdown-arrow {
    transform: rotate(180deg);
}

/* Sidebar Profile Dropdown */
.sidebar-profile-dropdown {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    z-index: 1001;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.sidebar-profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sidebar-profile-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    color: var(--primary-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--primary-text);
    text-decoration: none;
}

.sidebar-dropdown-item svg {
    flex-shrink: 0;
    color: var(--secondary-text);
    transition: color 0.2s ease;
}

.sidebar-dropdown-item:hover svg {
    color: var(--primary-text);
}

.sidebar-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.sidebar-logout-form {
    width: 100%;
}

.sidebar-dropdown-item.logout-item {
    color: #ef4444;
}

.sidebar-dropdown-item.logout-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.sidebar-dropdown-item.logout-item svg {
    color: #ef4444;
}

.sidebar-dropdown-item.logout-item:hover svg {
    color: #dc2626;
}

/* Mobile responsive adjustments for sidebar profile dropdown */
@media (max-width: 768px) {
    .sidebar-profile-dropdown {
        left: 8px;
        right: 8px;
    }
    
    .sidebar-dropdown-item {
        padding: 14px 16px;
        font-size: 16px;
    }
}/* 
Sidebar Logout Button */
.sidebar-logout-form {
    width: 100%;
    margin-bottom: 12px;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-light);
}

.sidebar-logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.sidebar-logout-btn svg {
    transition: transform 0.2s ease;
}

.sidebar-logout-btn:hover svg {
    transform: scale(1.1);
}
/* New
 Feature Badge Styles */
.nav-link-badge.new-feature {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}