:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --danger-color: #ef4444;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #1e293b;
    --white: #ffffff;
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 80px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --border-radius-lg: 20px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-danger: linear-gradient(135deg, #f43f5e 0%, #ef4444 100%);
    --blur-amount: 20px;
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Vazir', Arial, Tahoma, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    margin: 0;
    padding: 0;
}

/* Ensure all containers don't overflow */
*, *::before, *::after {
    box-sizing: border-box;
}

.container, .container-fluid {
    overflow-x: hidden;
    max-width: 100%;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    border-radius: 0 0 0 var(--border-radius-lg);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 199, 255, 0.1) 0%, transparent 50%);
    opacity: 0.5;
    pointer-events: none;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .section-title,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: translateX(20px);
}

/* Collapsed sidebar - center icons */
.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .sidebar-toggle {
    margin: 0;
}

.sidebar.collapsed .user-profile {
    flex-direction: column;
    padding: 1rem 0.5rem;
    margin: 0 0.5rem 1rem;
    justify-content: center;
}

.sidebar.collapsed .user-avatar {
    font-size: 2rem;
    margin: 0;
}

.sidebar.collapsed .menu-link {
    justify-content: center;
    margin: 0 0.5rem;
    padding: 1rem 0.5rem;
    border-right: none;
    transform: none;
}

.sidebar.collapsed .menu-link:hover {
    transform: translateY(-2px);
    border-right: none;
}

.sidebar.collapsed .menu-link.active {
    border-right: none;
    border-bottom: 3px solid var(--primary-color);
    transform: none;
}

.sidebar.collapsed .menu-link::after {
    display: none;
}

.sidebar.collapsed .menu-icon {
    margin: 0;
    width: auto;
    font-size: 1.3rem;
}

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

.sidebar.collapsed .logout-btn i {
    font-size: 1.3rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--gradient-primary);
    color: var(--white);
    overflow: hidden;
    position: relative;
    border-radius: 0 0 var(--border-radius-lg) 0;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: movePattern 20s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.brand-icon {
    font-size: 1.6rem;
    color: var(--white);
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: brandPulse 4s ease-in-out infinite;
    transition: var(--transition);
}

@keyframes brandPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 6px 12px rgba(255, 255, 255, 0.4));
    }
}

.brand-icon:hover {
    transform: scale(1.1) rotate(5deg);
    animation-play-state: paused;
}

.brand-text {
    transition: var(--transition);
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: none; /* Hidden by default (desktop) */
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--secondary-color));
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem;
    margin: 0 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.user-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.user-profile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--border-radius-lg);
}

.user-profile:hover::after {
    opacity: 1;
}

.user-profile:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.15);
}

.user-avatar {
    font-size: 2.8rem;
    color: var(--primary-color);
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.user-info {
    flex: 1;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-name {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.4rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--dark-gray), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.user-role {
    font-size: 0.8rem;
    color: var(--primary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 16px;
    display: inline-block;
    line-height: 1.4;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-x: hidden;
}

.menu-section {
    padding: 1.25rem 1.5rem 0.75rem;
    overflow: hidden;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-bottom: 0.6rem;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.section-title:hover::after {
    width: 48px;
}

.menu-item {
    margin: 0.5rem 0;
    overflow: hidden;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin: 0 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    background: transparent;
    font-size: 0.9rem;
}

.menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.menu-link::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 0;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
}

.menu-link:hover::before {
    left: 0;
}

.menu-link:hover::after {
    width: 6px;
    height: 6px;
}

.menu-link:hover {
    color: var(--primary-color);
    transform: translateX(-8px) scale(1.02);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.menu-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    color: var(--primary-color);
    border-right: 4px solid var(--primary-color);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2);
    font-weight: 700;
    transform: translateX(-8px);
    backdrop-filter: blur(10px);
}

.menu-link.active::before {
    left: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
}

.menu-link.active::after {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 12px var(--primary-color);
}

.menu-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.menu-link:hover .menu-icon {
    transform: scale(1.1) rotate(3deg);
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.4));
}

.menu-link.active .menu-icon {
    color: var(--primary-color);
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
    transform: scale(1.05);
}

.menu-text {
    font-weight: inherit;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    letter-spacing: 0.2px;
    font-size: 0.9rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: auto;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    backdrop-filter: blur(10px);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--gradient-danger);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: none;
    box-shadow: 0 8px 24px rgba(244, 63, 94, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.8rem;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.logout-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:hover::after {
    opacity: 1;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(244, 63, 94, 0.4);
    color: var(--white);
}

.logout-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.logout-btn i {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    transition: var(--transition);
}

.logout-btn:hover i {
    transform: rotate(10deg) scale(1.1);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

/* Main Wrapper */
.main-wrapper {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-x: hidden;
    max-width: calc(100vw - var(--sidebar-width));
}

.sidebar.collapsed + .main-wrapper {
    margin-right: var(--sidebar-collapsed-width);
    max-width: calc(100vw - var(--sidebar-collapsed-width));
}

/* Mobile Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--gradient-primary);
    color: var(--white);
    z-index: 1001;
    display: none; /* Hidden by default on desktop */
    align-items: center;
    padding: 0 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.mobile-menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    padding: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 8px;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.header-brand {
    flex: 1;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    font-size: 1.1rem;
}

.header-user {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Breadcrumb and Content Styles */
.breadcrumb-wrapper,
.main-content,
.content-wrapper,
.footer {
    overflow-x: hidden;
}

.breadcrumb-wrapper {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.breadcrumb-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    opacity: 0.3;
    pointer-events: none;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    position: relative;
    z-index: 1;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    position: relative;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

.breadcrumb-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.breadcrumb-item a:hover::before {
    left: 100%;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.breadcrumb-item a i {
    font-size: 0.9rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.breadcrumb-item.active {
    color: var(--dark-gray);
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.breadcrumb-item.active::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 10px 10px;
    animation: sparkle 3s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes sparkle {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(10px, 10px) rotate(360deg); }
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .breadcrumb-wrapper {
        padding: 1rem 0;
    }

    .breadcrumb-item a {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-height: 38px;
    }

    .breadcrumb-item.active {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-height: 38px;
    }

    .breadcrumb-item + .breadcrumb-item::after {
        margin: 0 0.5rem;
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .breadcrumb-item + .breadcrumb-item::after {
        display: none;
    }

    .breadcrumb-item a,
    .breadcrumb-item.active {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Additional Enhancement Animations */
@keyframes floatUp {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

.menu-link:hover {
    animation: floatUp 0.6s ease-in-out;
}

/* Hover effects for better interactivity */
.menu-section:hover .section-title {
    color: var(--secondary-color);
    transform: translateX(3px);
    opacity: 1;
}

/* Enhanced gradient text for menu items */
.menu-link.active .menu-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtle pulse animation for active menu items */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 16px 40px rgba(99, 102, 241, 0.3); }
}

.menu-link.active {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    /* Show mobile header */
    .top-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(100%);
        z-index: 1002;
        border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);
    }

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

    .main-wrapper {
        margin-right: 0;
        max-width: 100vw;
        padding-top: 60px; /* Add space for mobile header */
    }

    .sidebar.collapsed + .main-wrapper {
        margin-right: 0;
        max-width: 100vw;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
        overflow-x: hidden;
        border-radius: var(--border-radius);
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-links {
        margin-top: 0.5rem;
    }

    .sidebar-header {
        padding: 2rem 1.5rem;
    }

    .user-profile {
        margin: 0 1rem 1.5rem;
        padding: 1rem;
    }

    .sidebar-brand {
        font-size: 1.1rem;
    }

    .brand-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 1rem;
        border-radius: var(--border-radius);
        overflow-x: hidden;
    }

    .user-profile {
        margin: 0 0.75rem 1rem;
        padding: 0.75rem;
    }

    .user-name {
        font-size: 0.9rem;
    }

    .user-role {
        font-size: 0.7rem;
        padding: 0.15rem 0.45rem;
    }

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

    .brand-icon {
        font-size: 1.4rem;
    }

    .menu-link {
        padding: 0.9rem 1rem;
        margin: 0 0.75rem;
        font-size: 0.85rem;
    }

    .menu-icon {
        font-size: 1rem;
        width: 18px;
    }

    .menu-text {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }
}

.main-content {
    flex: 1;
    padding: 2rem;
    position: relative;
    min-height: calc(100vh - 140px);
}

.main-content .container-fluid {
    padding: 0 2rem;
    max-width: 100%;
}

.content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin: 0 auto;
    max-width: 100%;
}

/* Responsive spacing adjustments */
@media (max-width: 991.98px) {
    .main-content {
        padding: 1.5rem;
    }

    .main-content .container-fluid {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .main-content .container-fluid {
        padding: 0 0.5rem;
    }

    .content-wrapper {
        padding: 1.5rem 1rem;
        margin: 0;
        border-radius: var(--border-radius);
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.75rem;
    }

    .main-content .container-fluid {
        padding: 0 0.25rem;
    }

    .content-wrapper {
        padding: 1rem;
        border-radius: var(--border-radius);
    }
}

/* ==========================================================================
   Messages / Alerts Section
   ========================================================================== */
.messages-container {
    margin: 1.5rem 0;
    position: relative;
    z-index: 100;
}

.messages-container .alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: none;
    animation: slideInDown 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

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

/* Success Alert */
.messages-container .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-right: 5px solid #28a745;
}

.messages-container .alert-success i {
    color: #28a745;
    font-size: 1.25rem;
}

/* Error/Danger Alert */
.messages-container .alert-error,
.messages-container .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-right: 5px solid #dc3545;
}

.messages-container .alert-error i,
.messages-container .alert-danger i {
    color: #dc3545;
    font-size: 1.25rem;
}

/* Warning Alert */
.messages-container .alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    border-right: 5px solid #ffc107;
}

.messages-container .alert-warning i {
    color: #ffc107;
    font-size: 1.25rem;
}

/* Info Alert */
.messages-container .alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-right: 5px solid #17a2b8;
}

.messages-container .alert-info i {
    color: #17a2b8;
    font-size: 1.25rem;
}

/* Close Button */
.messages-container .btn-close {
    margin-right: auto;
    padding: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.messages-container .btn-close:hover {
    opacity: 1;
}

/* Auto-dismiss animation */
.messages-container .alert.auto-dismiss {
    animation: slideInDown 0.4s ease-out, fadeOut 0.5s ease-out 4.5s forwards;
}

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

/* Responsive Messages */
@media (max-width: 768px) {
    .messages-container {
        margin: 1rem 0;
    }

    .messages-container .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .messages-container .alert i {
        font-size: 1.1rem;
    }
}
