:root {
  --primary-color: #d66ba0;
  --secondary-color: #4b2c57;
  --accent-color: #7e3f83;
  --text-color: #3a1f35;
  --heading-color: #6f2f5a;
  --sidebar-bg: #ffe6f0;
  --card-bg: #fff0f6;
  --hover-bg: #f9c1d9;
  --sidebar-width: 280px;
  --transition-speed: 0.35s;
  --border-radius: 16px;
}

body.dark-mode {
  --text-color: #f8e7f2;
  --heading-color: #f8e7f2;
  --sidebar-bg: #3c1f4a;
  --card-bg: #5a3570;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  box-shadow: -8px 0 30px rgba(214, 107, 160, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 4px solid var(--primary-color);
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
  backdrop-filter: saturate(180%) blur(10px);
}

.sidebar.active {
  right: 0;
  box-shadow:
    -8px 0 50px rgba(214, 107, 160, 0.7),
    inset 0 0 20px rgba(255, 182, 211, 0.5);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  border-top-left-radius: 28px;
  box-shadow: 0 8px 15px rgba(214, 107, 160, 0.15);
}

.sidebar-header h3 {
  color: var(--primary-color);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(126, 63, 131, 0.7);
}

.close-sidebar {
  font-size: 28px;
  color: var(--accent-color);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: color var(--transition-speed);
  filter: drop-shadow(0 0 2px var(--primary-color));
}

.close-sidebar:hover {
  color: var(--primary-color);
  filter: drop-shadow(0 0 6px var(--primary-color));
}

.user-info {
  text-align: center;
  padding: 28px 24px;
  margin: 24px 24px 32px;
  border-radius: var(--border-radius);
  background: rgba(214, 107, 160, 0.12);
  box-shadow: 0 8px 30px rgba(214, 107, 160, 0.18);
  backdrop-filter: saturate(200%) blur(15px);
  transition: background-color var(--transition-speed);
}

.user-info:hover {
  background: rgba(214, 107, 160, 0.2);
  box-shadow: 0 12px 35px rgba(214, 107, 160, 0.25);
}

.user-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--primary-color);
  overflow: hidden;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 12px var(--primary-color),
    inset 0 0 8px rgba(255, 182, 211, 0.8);
  transition: box-shadow var(--transition-speed);
}

.user-avatar:hover {
  box-shadow:
    0 0 24px var(--primary-color),
    inset 0 0 12px rgba(255, 182, 211, 1);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 0 3px var(--primary-color));
}

.avatar-initial {
  font-size: 40px;
  font-weight: 900;
  color: var(--primary-color);
  text-shadow: 1px 1px 3px var(--accent-color);
}

.user-info h4 {
  margin: 8px 0 4px;
  font-size: 22px;
  color: var(--heading-color);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 1px rgba(126, 63, 131, 0.5);
}

.user-email {
  color: var(--text-color);
  font-size: 15px;
  opacity: 0.9;
  font-weight: 500;
}

.user-balance {
  color: #4caf50;
  font-weight: 900;
  font-size: 18px;
  margin-top: 14px;
  text-shadow: 0 1px 3px #2e7d32;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 0;
  flex-grow: 1;
}

.sidebar-menu li {
  margin: 10px 12px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow:
    0 0 10px rgba(214, 107, 160, 0.08),
    inset 0 0 8px rgba(255, 182, 211, 0.15);
  transition: box-shadow var(--transition-speed);
}

.sidebar-menu li:hover {
  box-shadow:
    0 6px 25px rgba(214, 107, 160, 0.4),
    inset 0 0 12px rgba(255, 182, 211, 0.3);
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
  border-left: 5px solid transparent;
  border-radius: var(--border-radius);
  background: transparent;
  filter: drop-shadow(0 0 1px rgba(126, 63, 131, 0.15));
  user-select: none;
}

.sidebar-menu a:hover {
  background: var(--hover-bg);
  border-left: 5px solid var(--primary-color);
  color: #fff;
  transform: translateX(-8px);
  box-shadow: 0 6px 18px rgba(214, 107, 160, 0.25);
  filter: drop-shadow(0 0 6px var(--primary-color));
}

.sidebar-menu i {
  margin-left: 16px;
  font-size: 22px;
  width: 28px;
  color: var(--primary-color);
  text-shadow: 0 0 3px var(--accent-color);
  transition: color var(--transition-speed);
}

.sidebar-menu a:hover i {
  color: #fff;
  text-shadow: 0 0 8px #fff;
}

.company-info {
  padding: 20px 18px;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  background: var(--card-bg);
  border-bottom-left-radius: 28px;
  box-shadow: inset 0 4px 10px rgba(255, 182, 211, 0.2);
}

.company-logo {
  height: 70px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 6px var(--primary-color));
}

.company-name {
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px var(--accent-color);
}

.unread-badge {
  background-color: var(--primary-color);
  color: #000;
  padding: 5px 10px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
  display: inline-block;
  min-width: 22px;
  text-align: center;
  box-shadow: 0 0 8px var(--primary-color);
}

.sidebar-menu li.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.sidebar-menu li.social-icons a i {
  font-size: 1.8rem;
  color: #ffffff;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: linear-gradient(45deg, #d66ba0, #7e3f83);
}

.sidebar-menu li.social-icons a:hover i {
  box-shadow: 0 0 22px 3px var(--primary-color);
  transform: scale(1.15);
}

.theme-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 3px 10px rgba(214, 107, 160, 0.3);
  transition: background 0.3s;
}

.theme-toggle:hover {
  background: var(--accent-color);
}

@media (max-width: 768px) {
  .sidebar {
    width: 60vw;
    right: -90vw;
  }

  .sidebar.active {
    right: 0;
  }
  .sidebar-header h3 {
    font-size: 20px;
  }
  .user-avatar {
    width: 80px;
    height: 80px;
  }
  .user-info h4 {
    font-size: 18px;
  }
  .sidebar-menu a {
    font-size: 15px;
    padding: 12px 20px;
  }
}





/* زر العملات في السايدبار */
.currency-dropdown-trigger {
    padding: 0 24px;
    margin: 12px 0;
}

.currency-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: black;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
    transition: all 0.2s ease;
}

.currency-btn:hover {
    transform: translateY(-1px);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

/* البوابة (Portal) - تظهر خارج السايدبار */
.dropdown-portal {
    position: fixed;
    display: none;
    z-index: 2000;
}

.dropdown-portal.open {
    display: block;
}

.dropdown-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    width: 200px; /* عرض ثابت */
    min-width: unset; /* إلغاء الحد الأدنى */
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    font-size: 0.85rem;
    color: #fff;
}

.dropdown-item:hover {
    background: #2c2c2c;
}

.dropdown-item.active {
    background: #252525;
    border-left: 3px solid #FFD700;
}

.dropdown-item i {
    font-size: 1rem;
    color: #FFD700;
}

.dropdown-item small {
    color: #aaa;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exchange-rate {
    background: #0d1b0d;
    color: #77b300;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}