.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 65px;
  background: #ffffff;
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  overflow: hidden;
}

.sidebar:hover {
  width: 260px;
}

.sidebar.active > *{
  opacity: 1;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  margin-bottom: 2rem;
}


.logo > img {
  width: 50px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1F2937;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar:hover .logo-text {
  opacity: 1;
}
.sidebar.active .logo-text {
  opacity: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #6B7280;
  margin-bottom: 0.5rem;
}

.menu-item:hover {
  background: #F3F4F6;
  color: #6366F1;
  transform: translateX(4px);
}

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

.icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon > svg {
  min-width: 24px;
  min-height: 24px;
}


.item-text {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar:hover .item-text {
  opacity: 1;
}
.sidebar.active .item-text {
  opacity: 1;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E5E7EB;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #1F2937;
}

/* Адаптивность */
@media (max-width: 650px) {
  .sidebar {
    width: 260px;
/*    left: -260px;*/
  }

  .sidebar.active {
    left: 0;
  }
}

/* Обновленные стили для баланса */
.balance-wrapper {
  position: relative;
  margin: 1rem 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%); backdrop-filter: blur(10px); overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.balance-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.balance-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.balance-icon svg {
  width: 20px;
  height: 20px;
  stroke: #6366F1;
  transition: stroke 0.3s ease;
}

.balance-info {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s ease;
  white-space: nowrap;
}

.balance-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #6366F1;
  margin-bottom: 2px;
  background: linear-gradient(45deg, #6366F1, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.balance-label {
  font-size: 0.75rem;
  color: #64748B;
  letter-spacing: 0.5px;
}

.balance-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Анимации при наведении */
.sidebar:hover .balance-wrapper {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}

.sidebar:hover .balance-info {
  opacity: 1;
  transform: translateX(0);
}
.sidebar.active .balance-info {
  opacity: 1;
  transform: translateX(0);
}

.balance-wrapper:hover .balance-hover {
  opacity: 1;
}

.balance-wrapper:hover .balance-icon {
  transform: rotate(-15deg) scale(1.1);
}

.balance-wrapper:hover .balance-icon svg {
  stroke: #EC4899;
}

/* Эффект частиц */
@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

.balance-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  animation: float 6s infinite linear;
}

.balance-particle:nth-child(1) {
  top: 15%;
  left: 20%;
  animation-delay: 0s;
}

.balance-particle:nth-child(2) {
  top: 60%;
  left: 70%;
  animation-delay: -2s;
}

.balance-particle:nth-child(3) {
  top: 30%;
  left: 50%;
  animation-delay: -4s;
}


/* Стили для кнопки выхода */
.logout-btn {
  margin-top: auto;
  border-top: 1px solid #F1F5F9;
  padding-top: 1rem;
}

.logout-btn .item-text {
  color: #EF4444;
}

.logout-btn:hover {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
}

/* Стили для кнопки меню */
.menu-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: #6366F1;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  cursor: pointer;
  z-index: 1001;
  display: none;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.menu-toggle.active {
  transform: rotate(90deg);
  background: #EC4899;
}

.menu-toggle span {
  position: absolute;
  width: 24px;
  height: 2px;
  background: white;
  left: 16px;
  transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  top: 20px;
}

.menu-toggle span:nth-child(2) {
  top: 27px;
}

.menu-toggle span:nth-child(3) {
  top: 34px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Анимация пульсации */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.menu-toggle:hover {
  animation: pulse 1.5s infinite;
}

/* Адаптация для мобильных устройств */
@media (max-width: 650px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }

  .sidebar.active {
    transform: translateX(0);
  }
}