/* نظام التصميم المتقدم لتطبيق مصروفي (Masroufy) - Mobile First */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* ألوان الوضع الداكن الافتراضي (Dark Theme) */
  --bg-primary: #0a0f1d;
  --bg-surface: #141c2e;
  --bg-surface-elevated: #1e2942;
  --bg-card: rgba(26, 36, 58, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --income: #10b981;
  --income-bg: rgba(16, 185, 129, 0.12);
  --income-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --expense: #f43f5e;
  --expense-bg: rgba(244, 63, 94, 0.12);
  --expense-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);

  --transfer: #0ea5e9;
  --transfer-bg: rgba(14, 165, 233, 0.12);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);

  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --glass-backdrop: blur(16px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  user-select: none;
}

/* محاكي شاشة الهاتف للمكتب وتصميم متناسق للشاشات العريضة */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-primary);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.35);
  padding-bottom: 84px; /* مساحة لشريط التنقل السفلي */
}

@media (min-width: 768px) {
  body {
    background: radial-gradient(circle at top right, #1e1b4b 0%, #0a0f1d 60%);
    padding: 20px 0;
  }
  .app-container {
    min-height: calc(100vh - 40px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
  }
}

/* شريط الرأس العلوي (Top Header) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-primary);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.user-greeting {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-surface-elevated);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* محتوى الصفحات والتبويبات */
.view-content {
  flex: 1;
  padding: 18px 20px;
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.view-content.active {
  display: block;
}

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

/* بطاقة الرصيد الإجمالي الفاخرة (Master Balance Card) */
.balance-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 30px -10px rgba(67, 56, 202, 0.45);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.balance-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-amount {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.balance-currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.balance-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-icon.income {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.summary-icon.expense {
  background: rgba(244, 63, 94, 0.25);
  color: #fb7185;
}

.summary-icon svg {
  width: 18px;
  height: 18px;
}

.summary-info .label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  display: block;
}

.summary-info .val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

/* شريط المحافظ المالية (Wallets Horizontal Carousel) */
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.wallets-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 22px;
}

.wallets-scroll::-webkit-scrollbar {
  display: none;
}

.wallet-card {
  min-width: 150px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.wallet-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.wallet-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.wallet-icon-badge svg {
  width: 18px;
  height: 18px;
}

.wallet-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-balance {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.add-wallet-btn {
  min-width: 110px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
  padding: 12px;
}

.add-wallet-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* بطاقات التنبيهات الذكية (Budget & Alert Banners) */
.alert-banner {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.alert-banner.danger {
  background: var(--expense-bg);
  border-color: rgba(244, 63, 94, 0.3);
}

.alert-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.alert-banner.warning .alert-icon { background: var(--warning); }
.alert-banner.danger .alert-icon { background: var(--expense); }

.alert-icon svg { width: 16px; height: 16px; }

.alert-text {
  font-size: 0.85rem;
  color: var(--text-main);
  flex: 1;
}

/* قائمة العمليات الأخيرة (Transactions List) */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transaction-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.transaction-card:hover {
  background: var(--bg-surface-elevated);
  transform: translateX(-2px);
}

.tx-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.tx-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.tx-icon-box svg {
  width: 22px;
  height: 22px;
}

.tx-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tx-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--text-dim);
}

.tx-wallet-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
}

.tx-amount-col {
  text-align: left;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: block;
}

.tx-amount.expense { color: var(--expense); }
.tx-amount.income { color: var(--income); }
.tx-amount.transfer { color: var(--transfer); }

.tx-date-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
}

/* شريط التنقل السفلي الفاخر (Bottom Navigation Bar) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: 74px;
  background: rgba(20, 28, 46, 0.88);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding: 0 10px;
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.88);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 6px var(--primary-glow));
}

/* الزر العائم السريع للإضافة (Floating Action Button - FAB) */
.fab-btn {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  margin-top: -30px;
  position: relative;
}

.fab-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-btn svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.5;
}

/* النوافذ المنبثقة المنزلقة من الأسفل (Modal Bottom Sheet) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 20px 22px 30px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  align-self: center;
  margin-bottom: 16px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sheet-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* محولات الأزرار المقسمة (Segmented Type Switcher) */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
}

.segment-btn {
  padding: 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.segment-btn.active.expense {
  background: var(--expense-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.segment-btn.active.income {
  background: var(--income-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.segment-btn.active.transfer {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* حقول الإدخال الاحترافية */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.amount-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-input-box .form-input {
  font-size: 1.6rem;
  font-weight: 800;
  padding-left: 50px;
  letter-spacing: -0.5px;
}

.amount-currency-badge {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  pointer-events: none;
}

/* أزرار المبالغ السريعة */
.quick-amounts {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.quick-amount-chip {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.quick-amount-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* شبكة اختيار التصنيفات والأيقونات */
.category-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 16px;
}

.cat-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.cat-picker-item:hover, .cat-picker-item.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.cat-picker-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.cat-picker-icon svg {
  width: 18px;
  height: 18px;
}

.cat-picker-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* الأزرار الرئيسية */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--text-muted);
}

.btn-danger {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--expense-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--expense);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* أشرطة تقدم الميزانية (Budget Progress Bars) */
.budget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.budget-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.budget-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.budget-progress-bar.safe { background: var(--income); }
.budget-progress-bar.warning { background: var(--warning); }
.budget-progress-bar.danger { background: var(--expense); }

.budget-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* بطاقات الديون (Debts Cards) */
.debt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.debt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debt-badge {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.debt-badge.due_to_me {
  background: var(--income-bg);
  color: var(--income);
}

.debt-badge.due_by_me {
  background: var(--expense-bg);
  color: var(--expense);
}

.debt-badge.paid {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.debt-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* رسائل الإشعار التنبيهية (Toast Notifications) */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast.success { border-right: 4px solid var(--income); }
.toast.error { border-right: 4px solid var(--expense); }
.toast.warning { border-right: 4px solid var(--warning); }

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

/* الحالات الفارغة (Empty State) */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* حاوية الرسوم البيانية */
.chart-container {
  position: relative;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
