.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 70px;
    height: 100vh;
    background: rgba(30, 30, 46, 0.95) !important;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    padding: 1rem 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar:hover {
    width: 260px;
}
body.dark-theme .sidebar {
    background: rgba(30, 30, 46, 0.95) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.sidebar-nav {
    padding: 1rem 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sidebar:hover .sidebar-nav {
    align-items: stretch;
    padding: 1rem 0.5rem 0 0.5rem;
}
.sidebar-section {
    margin-bottom: 1rem;
    width: 100%;
}
.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    margin-top: 1rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.dark-theme .sidebar-section-title {
    color: #6b7280;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    margin: 0 0 0.2rem 0;
    border-radius: 0.5rem;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    overflow: visible;
}
.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar .sidebar-link {
    justify-content: flex-start;
    padding: 0.65rem;
    padding-left: calc(50% - 10px);
    gap: 0;
}
.sidebar .sidebar-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar .sidebar-link i {
    flex-shrink: 0;
}
.sidebar:hover .sidebar-link {
    padding-left: 0.75rem;
    gap: 0.75rem;
}
.sidebar:hover .sidebar-link span {
    opacity: 1;
    width: auto;
}
body.dark-theme .sidebar-link {
    color: #9ca3af;
}
.sidebar-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}
.sidebar:hover .sidebar-link:hover {
    transform: none;
}
.sidebar .sidebar-link:hover {
    transform: none;
}
body.dark-theme .sidebar-link:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}
.sidebar-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: none !important;
    border-radius: 0.75rem;
}
.sidebar .sidebar-link.active {
    justify-content: center;
    padding: 0.75rem;
    margin: 0.25rem;
    gap: 0;
    width: calc(100% - 0.5rem);
}
.sidebar .sidebar-link.active i {
    font-size: 1rem;
}
.sidebar .sidebar-link.active span {
    opacity: 0;
    width: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar:hover .sidebar-link.active {
    justify-content: flex-start;
    padding-left: 0.75rem;
    gap: 0.75rem;
}
.sidebar:hover .sidebar-link.active span {
    opacity: 1;
    width: auto;
}
.sidebar-link.active:hover {
    transform: none !important;
}
.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: inline-block;
}
.sidebar .sidebar-link i {
    margin: 0;
}
.sidebar-link-badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
}
body.dark-theme .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-balance {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 0.5rem;
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
}
.sidebar-balance:hover {
    background: rgba(245, 158, 11, 0.2);
}
body.dark-theme .sidebar-balance {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}
body.dark-theme .sidebar-balance:hover {
    background: rgba(251, 191, 36, 0.3);
}
.sidebar-balance i {
    font-size: 1rem;
    width: 20px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar .sidebar-balance {
    padding: 0.65rem 0.75rem;
    padding-left: 25px;
}
.sidebar:hover .sidebar-balance {
    padding: 0.65rem 0.75rem;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 0.75rem;
    overflow: visible;
    transition: padding 0.3s ease;
}
.sidebar .sidebar-user {
    padding: 0.5rem;
}
.sidebar:hover .sidebar-user {
    padding: 0.75rem;
}
body.dark-theme .sidebar-user {
    background: rgba(102, 126, 234, 0.2);
}
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.sidebar:hover .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 0.9rem;
}
.sidebar-user-info {
    flex: 1;
}
.sidebar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
}
body.dark-theme .sidebar-user-name {
    color: #e0e0e0;
}
.sidebar-user-role {
    font-size: 0.75rem;
    color: #6b7280;
}
body.dark-theme .sidebar-user-role {
    color: #9ca3af;
}
.sidebar-user-solariki {
    font-size: 0.7rem;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 0.25rem;
}
body.dark-theme .sidebar-user-solariki {
    color: #fbbf24;
}
.main-content {
    margin-left: 70px;
    transition: margin-left 0.3s ease;
}
.sidebar-toggle {
    display: none;
}
.sidebar.collapsed {
    width: 80px;
}
.sidebar .sidebar-section-title,
.sidebar .sidebar-link span,
.sidebar .sidebar-balance span {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.3s ease;
    pointer-events: none;
}
.sidebar:hover .sidebar-section-title,
.sidebar:hover .sidebar-link span,
.sidebar:hover .sidebar-balance span {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    pointer-events: auto;
}
.sidebar .sidebar-link-badge:not(:empty) {
    position: absolute;
    right: 4px;
    top: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0;
    font-size: 0.6rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
}
.sidebar:hover .sidebar-link-badge:not(:empty) {
    position: static;
    min-width: 20px;
    height: 20px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
}
.sidebar .sidebar-footer {
    padding: 0.75rem 0.5rem;
    justify-content: center;
}
.sidebar:hover .sidebar-footer {
    padding: 0.75rem 0.5rem;
    justify-content: flex-start;
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        left: 1rem;
    }
}
.sidebar:hover .sidebar-link span {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}
.sidebar:hover .sidebar-link:hover span {
    animation: scrollText 10s ease-in-out infinite;
}
@keyframes scrollText {
    0%, 15% {
        transform: translateX(0);
    }
    85%, 100% {
        transform: translateX(calc(-100% + 140px));
    }
}
