/* ============================================================
   ميزانيتي — FinTech Professional UI
   Design System: Revolut × Stripe × Bloomberg
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ════════════════════════════════════════
   Design System — CSS Variables
   ════════════════════════════════════════ */
:root {
  /* ── Palette: Dark (Luxury Fintech) ── */
  --color-bg-base:       #0a0b0e;
  --color-bg-surface:    rgba(20, 24, 32, 0.7);
  --color-bg-elevated:   rgba(28, 33, 43, 0.8);
  --color-bg-overlay:    rgba(10, 11, 14, 0.85);
  --color-bg-input:      rgba(255, 255, 255, 0.04);

  /* ── Brand (Gold/Amber) ── */
  --color-brand:         #eab308;
  --color-brand-dim:     rgba(234, 179, 8, 0.12);
  --color-brand-hover:   #f59e0b;

  /* ── Semantic (Emerald & Rose) ── */
  --color-positive:      #10b981;
  --color-positive-dim:  rgba(16, 185, 129, 0.12);
  --color-negative:      #f43f5e;
  --color-negative-dim:  rgba(244, 63, 94, 0.12);
  --color-warning:       #f59e0b;
  --color-warning-dim:   rgba(245, 158, 11, 0.12);
  --color-info:          #06b6d4;
  --color-info-dim:      rgba(6, 182, 212, 0.12);
  --color-purple:        #8b5cf6;
  --color-purple-dim:    rgba(139, 92, 246, 0.12);

  /* ── Text ── */
  --color-text-primary:   #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted:     #64748b;
  --color-text-disabled:  #334155;

  /* ── Border ── */
  --color-border:         rgba(255, 255, 255, 0.08);
  --color-border-strong:  rgba(255, 255, 255, 0.15);
  --color-border-brand:   rgba(234, 179, 8, 0.3);

  /* ── Shadows ── */
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.4);

  /* ── Radius ── */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* ── Typography ── */
  --font-display: 'Cairo', sans-serif;
  --font-body:    'Cairo', sans-serif;
  --font-mono:    'Inter', monospace;

  /* ── Spacing ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ── Layout ── */
  --nav-height:        64px;
  --bottom-nav-height: 70px;

  /* ── Motion ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition: all 0.4s var(--ease-out);
  --transition-fast: all 0.2s var(--ease-out);
}

/* ── Light Theme (Pearl & Gold) ── */
[data-theme="light"] {
  --color-bg-base:       #f8fafc;
  --color-bg-surface:    rgba(255, 255, 255, 0.85);
  --color-bg-elevated:   rgba(255, 255, 255, 0.95);
  --color-bg-overlay:    rgba(255, 255, 255, 0.9);
  --color-bg-input:      rgba(0, 0, 0, 0.03);

  --color-brand:         #d97706; /* Darker amber for contrast in light mode */
  --color-brand-dim:     rgba(217, 119, 6, 0.1);
  --color-brand-hover:   #b45309;

  --color-positive:      #059669;
  --color-positive-dim:  rgba(5, 150, 105, 0.1);
  --color-negative:      #e11d48;
  --color-negative-dim:  rgba(225, 29, 72, 0.1);
  --color-warning:       #d97706;
  --color-warning-dim:   rgba(217, 119, 6, 0.1);
  --color-info:          #0284c7;
  --color-info-dim:      rgba(2, 132, 199, 0.1);
  --color-purple:        #7c3aed;
  --color-purple-dim:    rgba(124, 58, 237, 0.1);

  --color-text-primary:   #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted:     #94a3b8;
  --color-text-disabled:  #cbd5e1;

  --color-border:         rgba(0, 0, 0, 0.08);
  --color-border-strong:  rgba(0, 0, 0, 0.15);
  --color-border-brand:   rgba(217, 119, 6, 0.25);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 12px 32px rgba(0,0,0,0.12);
  --shadow-card: 0 4px 16px rgba(0,0,0,0.05);
}
/* ════════════════════════════════════════
   Reset & Base
   ════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  transition: background 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture — داكن فقط */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
[data-theme="light"] body::before { display: none; }

/* ════════════════════════════════════════
   Lucide Icons — SVG Sprites Utility
   ════════════════════════════════════════ */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.icon-sm  { width: 14px; height: 14px; }
.icon-md  { width: 18px; height: 18px; }
.icon-lg  { width: 22px; height: 22px; }
.icon-xl  { width: 28px; height: 28px; }

/* ════════════════════════════════════════
   Top Navigation
   ════════════════════════════════════════ */
.top-nav {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: var(--nav-height);
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  z-index: 100;
  transition: var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-logo {
  width: 32px;
  height: 32px;
  background: var(--color-brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.nav-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}
.nav-title span { color: var(--color-brand); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--color-border);
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
}
.nav-btn:hover {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

/* ════════════════════════════════════════
   Bottom Navigation
   ════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  height: var(--bottom-nav-height);
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  min-width: 48px;
  position: relative;
}

.bottom-nav-item .nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  transition: var(--transition-fast);
}

.bottom-nav-item .nav-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.bottom-nav-item.active {
  color: var(--color-brand);
}
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 20px;
  height: 2px;
  background: var(--color-brand);
  border-radius: 0 0 2px 2px;
  animation: tabSlide 0.2s var(--ease-out);
}
@keyframes tabSlide {
  from { width: 0; opacity: 0; }
  to   { width: 20px; opacity: 1; }
}

/* ════════════════════════════════════════
   Main Content
   ════════════════════════════════════════ */
.main-content {
  padding-top: calc(var(--nav-height) + var(--space-4));
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
  padding-right: var(--space-4);
  padding-left: var(--space-4);
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

/* ════════════════════════════════════════
   Pages
   ════════════════════════════════════════ */
.page { display: none; }
.page.active {
  display: block;
  animation: pageIn 0.22s var(--ease-out);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   Cards
   ════════════════════════════════════════ */
.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}
.card:hover {
  border-color: var(--color-border-brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.stats-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.stat-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* حذف .stat-glow بالكامل — استخدام خط علوي دقيق بدله */
.stat-glow { display: none; }

.stat-card.cyan   { border-top: 2px solid var(--color-brand); }
.stat-card.green  { border-top: 2px solid var(--color-positive); }
.stat-card.red    { border-top: 2px solid var(--color-negative); }
.stat-card.orange { border-top: 2px solid var(--color-warning); }
.stat-card.purple { border-top: 2px solid var(--color-purple); }
.stat-card.gold   { border-top: 2px solid var(--color-warning); }

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}
.stat-card.cyan   .stat-icon { background: var(--color-brand-dim);    color: var(--color-brand); }
.stat-card.green  .stat-icon { background: var(--color-positive-dim); color: var(--color-positive); }
.stat-card.red    .stat-icon { background: var(--color-negative-dim); color: var(--color-negative); }
.stat-card.orange .stat-icon { background: var(--color-warning-dim);  color: var(--color-warning); }
.stat-card.purple .stat-icon { background: var(--color-purple-dim);   color: var(--color-purple); }
.stat-card.gold   .stat-icon { background: var(--color-warning-dim);  color: var(--color-warning); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-1);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.4px;
}
.stat-value.cyan   { color: var(--color-brand); }
.stat-value.green  { color: var(--color-positive); }
.stat-value.red    { color: var(--color-negative); }
.stat-value.orange { color: var(--color-warning); }
.stat-value.purple { color: var(--color-purple); }
.stat-value.gold   { color: var(--color-warning); }

.stat-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ════════════════════════════════════════
   Section Header
   ════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section-title .icon { color: var(--color-brand); }

/* ════════════════════════════════════════
   Buttons
   ════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.1px;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-brand);
  color: #fff;
}
.btn-primary:hover { background: var(--color-brand-hover); box-shadow: var(--shadow-sm); }

.btn-success {
  background: var(--color-positive);
  color: #fff;
}
.btn-success:hover { opacity: 0.9; box-shadow: var(--shadow-sm); }

.btn-danger {
  background: var(--color-negative-dim);
  color: var(--color-negative);
  border: 1px solid hsla(0, 84%, 60%, 0.2);
}
.btn-danger:hover { background: var(--color-negative); color: #fff; }

.btn-secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-border-strong); color: var(--color-text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { background: var(--color-bg-elevated); color: var(--color-text-primary); }

.btn-icon { padding: 7px; width: 32px; height: 32px; }
.btn-sm   { padding: 6px 12px; font-size: 12px; }
.btn-lg   { padding: 12px 22px; font-size: 15px; }
.btn-full { width: 100%; }

/* ════════════════════════════════════════
   Form Controls
   ════════════════════════════════════════ */
.form-group { margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition-fast);
  direction: rtl;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-dim);
  background: var(--color-bg-elevated);
}
.form-control::placeholder { color: var(--color-text-muted); font-size: 13px; }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  padding-left: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* ════════════════════════════════════════
   Tables
   ════════════════════════════════════════ */
.table-wrap {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { background: var(--color-bg-elevated); }
.data-table th {
  padding: 9px 12px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--color-bg-elevated); color: var(--color-text-primary); }
.data-table tr:last-child td { border-bottom: none; }

/* ════════════════════════════════════════
   Badges
   ════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-cyan   { background: var(--color-brand-dim);    color: var(--color-brand);    border: 1px solid hsla(224, 100%, 65%, 0.15); }
.badge-green  { background: var(--color-positive-dim); color: var(--color-positive); border: 1px solid hsla(142, 71%, 45%, 0.15); }
.badge-red    { background: var(--color-negative-dim); color: var(--color-negative); border: 1px solid hsla(0, 84%, 60%, 0.15); }
.badge-orange { background: var(--color-warning-dim);  color: var(--color-warning);  border: 1px solid hsla(38, 92%, 50%, 0.15); }
.badge-purple { background: var(--color-purple-dim);   color: var(--color-purple);   border: 1px solid hsla(258, 90%, 66%, 0.15); }
.badge-gold   { background: var(--color-warning-dim);  color: var(--color-warning);  border: 1px solid hsla(38, 92%, 50%, 0.15); }

/* ════════════════════════════════════════
   Progress Bars
   ════════════════════════════════════════ */
.progress-wrap {
  background: var(--color-bg-elevated);
  border-radius: 20px;
  height: 5px;
  overflow: hidden;
  margin: 5px 0;
}
.progress-bar {
  height: 100%;
  border-radius: 20px;
  transition: width 0.7s var(--ease-in-out);
}
.progress-cyan   { background: var(--color-brand); }
.progress-green  { background: var(--color-positive); }
.progress-red    { background: var(--color-negative); }
.progress-orange { background: var(--color-warning); }
.progress-purple { background: var(--color-purple); }
.progress-gold   { background: var(--color-warning); }

/* ════════════════════════════════════════
   Modal
   ════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: hsla(215, 30%, 5%, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--color-bg-overlay);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  border-top: 1px solid var(--color-border-strong);
  border-right: 1px solid var(--color-border);
  border-left:  1px solid var(--color-border);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6) var(--space-5);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  animation: slideUp 0.26s var(--ease-out);
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-handle {
  width: 36px; height: 3px;
  background: var(--color-border-strong);
  border-radius: 2px;
  margin: 0 auto var(--space-5);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ════════════════════════════════════════
   Charts
   ════════════════════════════════════════ */
.chart-container {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.chart-container::after { display: none; }

.chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.chart-title .icon { color: var(--color-brand); }

.chart-wrap { position: relative; }

/* ════════════════════════════════════════
   Filters & Search
   ════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  transition: var(--transition-fast);
}
.filter-chip.active {
  background: var(--color-brand-dim);
  border-color: var(--color-border-brand);
  color: var(--color-brand);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  margin-bottom: var(--space-4);
  transition: var(--transition-fast);
}
.search-bar:focus-within {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-dim);
}
.search-bar input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  direction: rtl;
}
.search-bar input::placeholder { color: var(--color-text-muted); }
.search-icon { color: var(--color-text-muted); display: flex; }

/* ════════════════════════════════════════
   Transaction Items
   ════════════════════════════════════════ */
.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition-fast);
}
.transaction-item:last-child { border-bottom: none; }

.transaction-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.transaction-info { flex: 1; min-width: 0; }
.transaction-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.transaction-amount {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.transaction-amount.income  { color: var(--color-positive); }
.transaction-amount.expense { color: var(--color-negative); }

.transaction-actions { display: flex; gap: var(--space-1); }

/* ════════════════════════════════════════
   Debt Cards
   ════════════════════════════════════════ */
.debt-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: var(--transition);
}
.debt-card.overdue { border-color: hsla(0, 84%, 60%, 0.3); background: var(--color-negative-dim); }
.debt-card.warning { border-color: hsla(38, 92%, 50%, 0.3); background: var(--color-warning-dim); }

.debt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}
.debt-name { font-size: 14px; font-weight: 700; color: var(--color-text-primary); }
.debt-due  { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }

.debt-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.debt-amount-item {
  text-align: center;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
}
.debt-amount-label { font-size: 10px; color: var(--color-text-muted); margin-bottom: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.debt-amount-value { font-family: var(--font-display); font-size: 13px; font-weight: 700; }

/* ════════════════════════════════════════
   Investment Cards
   ════════════════════════════════════════ */
.investment-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: var(--transition);
}
.investment-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }

.investment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}
.investment-name { font-size: 14px; font-weight: 700; color: var(--color-text-primary); }
.investment-roi  { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.investment-roi.positive { color: var(--color-positive); }
.investment-roi.negative { color: var(--color-negative); }

.investment-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.investment-detail { text-align: center; }
.investment-detail-label { font-size: 10px; color: var(--color-text-muted); margin-bottom: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.investment-detail-value { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }

/* ════════════════════════════════════════
   Analytics
   ════════════════════════════════════════ */
.analytics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
}
.analytics-row:last-child { border-bottom: none; }
.analytics-label { font-size: 13px; color: var(--color-text-secondary); font-weight: 500; flex: 1; }
.analytics-value { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--color-text-primary); min-width: 90px; text-align: left; }
.analytics-progress { flex: 1; margin: 0 var(--space-3); }

/* ════════════════════════════════════════
   Budget
   ════════════════════════════════════════ */
.budget-category {
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
}
.budget-category:last-child { border-bottom: none; }
.budget-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.budget-category-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.budget-category-icon { display: flex; align-items: center; color: var(--color-text-muted); }
.budget-category-amounts { font-size: 12px; color: var(--color-text-muted); text-align: left; }
.budget-category-amounts strong { font-weight: 700; color: var(--color-text-primary); }
.budget-status {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.budget-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.budget-input-row:last-child { border-bottom: none; }
.budget-input-icon { display: flex; align-items: center; color: var(--color-text-muted); width: 26px; justify-content: center; flex-shrink: 0; }
.budget-input-label { flex: 1; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); }
.budget-input-field {
  width: 110px;
  padding: 7px 10px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  direction: ltr;
}
.budget-input-field:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px var(--color-brand-dim);
}

/* ════════════════════════════════════════
   Empty State
   ════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 40px var(--space-5);
  color: var(--color-text-muted);
}
.empty-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-3);
  color: var(--color-text-muted);
}
.empty-title { font-size: 14px; font-weight: 700; color: var(--color-text-secondary); margin-bottom: 4px; }
.empty-text  { font-size: 12px; }

/* ════════════════════════════════════════
   Toast Notifications
   ════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--color-bg-overlay);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 200px;
  max-width: 320px;
  text-align: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s var(--ease-out);
  pointer-events: all;
}
.toast.success { border-color: hsla(142, 71%, 45%, 0.3); color: var(--color-positive); }
.toast.error   { border-color: hsla(0, 84%, 60%, 0.3);   color: var(--color-negative); }
.toast.info    { border-color: var(--color-border-brand); color: var(--color-brand); }
.toast.warning { border-color: hsla(38, 92%, 50%, 0.3);  color: var(--color-warning); }

@keyframes toastIn  { from { opacity: 0; transform: translateY(-12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px) scale(0.95); } }

/* ════════════════════════════════════════
   FAB Button
   ════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 18px);
  left: 18px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  z-index: 90;
}
.fab:hover { transform: scale(1.08); background: var(--color-brand-hover); box-shadow: var(--shadow-lg); }
.fab:active { transform: scale(0.95); }

.fab-income     { background: var(--color-positive) !important; }
.fab-expense    { background: var(--color-negative) !important; }
.fab-debt       { background: var(--color-warning)  !important; }
.fab-investment { background: var(--color-purple)   !important; }

/* ════════════════════════════════════════
   Hero Greeting
   ════════════════════════════════════════ */
.hero-greeting {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}
.hero-greeting::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 100%;
  background: linear-gradient(135deg, var(--color-brand-dim) 0%, transparent 60%);
  pointer-events: none;
}

.hero-date { font-size: 11px; color: var(--color-text-muted); margin-bottom: 3px; font-weight: 500; }
.hero-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--color-text-primary); margin-bottom: var(--space-3); }
.hero-balance {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--color-brand);
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero-balance.amount-negative { color: var(--color-negative); }
.hero-balance-label { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; font-weight: 500; }

/* ════════════════════════════════════════
   Welcome Screen
   ════════════════════════════════════════ */
.welcome-screen {
  display: none;
  position: fixed; inset: 0;
  background: var(--color-bg-base);
  z-index: 500;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}
.welcome-screen.show { display: flex; }
.welcome-logo {
  width: 72px; height: 72px;
  background: var(--color-brand);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: welcomePulse 1.8s ease-in-out infinite;
}
@keyframes welcomePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.04); opacity: 0.9; }
}
.welcome-title    { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--color-text-primary); letter-spacing: -0.5px; }
.welcome-subtitle { font-size: 13px; color: var(--color-text-muted); }

/* ════════════════════════════════════════
   Confirm Dialog
   ════════════════════════════════════════ */
.confirm-dialog {
  display: none;
  position: fixed; inset: 0;
  background: hsla(215, 30%, 5%, 0.72);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.confirm-dialog.active { display: flex; }
.confirm-box {
  background: var(--color-bg-overlay);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-5);
  max-width: 310px;
  width: 100%;
  text-align: center;
}
.confirm-box-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--color-negative-dim);
  border-radius: var(--radius-lg);
  margin: 0 auto var(--space-3);
  color: var(--color-negative);
}
.confirm-box-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--color-text-primary); margin-bottom: var(--space-2); }
.confirm-box-text  { font-size: 13px; color: var(--color-text-muted); margin-bottom: var(--space-5); }
.confirm-actions   { display: flex; gap: var(--space-2); }

/* ════════════════════════════════════════
   Misc Utilities
   ════════════════════════════════════════ */
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.divider { height: 1px; background: var(--color-border); margin: var(--space-4) 0; }

.time-filter { display: flex; gap: var(--space-2); align-items: center; }
.time-filter label { font-size: 12px; color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }
.time-filter select {
  flex: 1; padding: 6px 10px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  appearance: none;
}

.fade-in { animation: fadeInUp 0.3s var(--ease-out) both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }
.stagger-5 { animation-delay: 0.20s; }
.stagger-6 { animation-delay: 0.24s; }

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.text-center  { text-align: center; }
.text-muted   { color: var(--color-text-muted); font-size: 12px; }
.text-success { color: var(--color-positive); }
.text-danger  { color: var(--color-negative); }
.text-warning { color: var(--color-warning); }
.text-info    { color: var(--color-brand); }

.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-16 { margin-top: 16px; }

.amount-positive { color: var(--color-positive); }
.amount-negative { color: var(--color-negative); }
.amount-neutral  { color: var(--color-brand); }

.tx-date-header {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.green  { background: var(--color-positive); }
.status-dot.red    { background: var(--color-negative); }
.status-dot.orange { background: var(--color-warning);  }

/* Offline banner */
.offline-banner {
  position: fixed;
  top: var(--nav-height);
  right: 0; left: 0;
  background: var(--color-warning);
  color: #000;
  text-align: center;
  padding: 5px;
  font-size: 12px;
  font-weight: 700;
  z-index: 99;
  animation: slideDown 0.25s var(--ease-out);
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* Progress animation */
.progress-bar.animated { animation: progressFill 0.9s var(--ease-in-out) both; }
@keyframes progressFill { from { width: 0 !important; } }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-elevated) 25%, var(--color-bg-overlay) 50%, var(--color-bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 2px; }

/* ── Responsive ── */
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .main-content { padding-right: var(--space-5); padding-left: var(--space-5); }
}
@media (min-width: 768px) {
  .modal { border-radius: var(--radius-2xl); align-self: center; }
  .modal-overlay { align-items: center; }
}
@media (max-width: 400px) {
  .form-row { grid-template-columns: 1fr; }
  .stat-value { font-size: 15px; }
  .investment-details { grid-template-columns: 1fr 1fr; }
  .debt-amounts { grid-template-columns: 1fr 1fr; }
  .modal { padding: var(--space-5) var(--space-4); }
  .form-control { font-size: 16px; }
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  }
}
@media (hover: none) {
  .card:hover, .stat-card:hover, .btn:hover { transform: none; }
}

/* ════════════════════════════════════════
   Phase 2 UX Additions
   ════════════════════════════════════════ */

/* ── Bottom Nav — 5 items + Center Button ── */
.bottom-nav {
  padding: 0 var(--space-2);
}

/* أيقونة المركز النشطة */
.fab-nav-center {
  position: relative;
  padding: 0;
  min-width: 52px;
}

.fab-nav-center .nav-icon-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-brand);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 2px 12px hsla(224, 100%, 65%, 0.35);
  transition: var(--transition-fast);
  margin-bottom: 2px;
  transform: translateY(-6px);
}

.fab-nav-center:hover .nav-icon-center,
.fab-nav-center:focus .nav-icon-center {
  background: var(--color-brand-hover);
  transform: translateY(-8px) scale(1.06);
  box-shadow: 0 4px 18px hsla(224, 100%, 65%, 0.45);
}

.fab-nav-center:active .nav-icon-center {
  transform: translateY(-5px) scale(0.96);
}

.fab-nav-center .nav-label {
  color: var(--color-brand);
  transform: translateY(-4px);
}

/* لا مؤشر علوي على زر المركز */
.fab-nav-center.active::before { display: none; }
.fab-nav-center::before { display: none !important; }

/* ══════════════════════════════════════
   Dashboard — Net Worth Row
   ══════════════════════════════════════ */
.net-worth-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.net-worth-item {
  flex: 1;
  text-align: center;
}

.net-worth-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  flex-shrink: 0;
}

.nw-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.nw-value {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.nw-value.positive { color: var(--color-positive); }
.nw-value.negative { color: var(--color-negative); }
.nw-value.brand    { color: var(--color-brand); }

/* ══════════════════════════════════════
   Dashboard — Cash Flow Card
   ══════════════════════════════════════ */
.cash-flow-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.cf-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-3);
}

.cf-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.cf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: var(--space-3);
  border-radius: var(--radius-md);
}

.cf-item.cf-income  { background: var(--color-positive-dim); }
.cf-item.cf-expense { background: var(--color-negative-dim); }

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

.cf-item.cf-income  .cf-icon { background: var(--color-positive); color: #fff; }
.cf-item.cf-expense .cf-icon { background: var(--color-negative); color: #fff; }

.cf-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.cf-amount {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}

.cf-arrow {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Progress bar الإنفاق */
.cf-progress-wrap {
  height: 4px;
  background: var(--color-bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.cf-progress-bar {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.8s var(--ease-in-out), background 0.3s;
}

.cf-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ══════════════════════════════════════
   Dashboard — Quick Actions
   ══════════════════════════════════════ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-2);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
}

.qa-btn:hover {
  border-color: var(--color-border-brand);
  color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.qa-btn:active { transform: translateY(0) scale(0.97); }

.qa-btn .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.qa-income:hover  { border-color: hsla(142, 71%, 45%, 0.3); color: var(--color-positive); }
.qa-expense:hover { border-color: hsla(0, 84%, 60%, 0.3);   color: var(--color-negative); }
.qa-debt:hover    { border-color: hsla(38, 92%, 50%, 0.3);  color: var(--color-warning); }
.qa-invest:hover  { border-color: hsla(258, 90%, 66%, 0.3); color: var(--color-purple); }

/* ══════════════════════════════════════
   More Page — Navigation List
   ══════════════════════════════════════ */
.more-nav-list { padding: 0; }
.more-nav-list.card { padding: 0; overflow: hidden; }

.more-section-header {
  padding: 10px var(--space-5) 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}

.more-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px var(--space-5);
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-body);
  text-align: right;
}

.more-nav-item:last-child { border-bottom: none; }

.more-nav-item:hover {
  background: var(--color-bg-elevated);
}

.more-nav-item:active {
  background: var(--color-brand-dim);
}

.more-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.more-nav-icon.orange { background: var(--color-warning-dim);  color: var(--color-warning); }
.more-nav-icon.purple { background: var(--color-purple-dim);   color: var(--color-purple); }
.more-nav-icon.green  { background: var(--color-positive-dim); color: var(--color-positive); }
.more-nav-icon.brand  { background: var(--color-brand-dim);    color: var(--color-brand); }

.more-nav-info {
  flex: 1;
  min-width: 0;
}

.more-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.more-nav-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-nav-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
  opacity: 0.5;
}

/* ── Theme Toggle Switch ── */
.more-toggle {
  width: 36px;
  height: 20px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: 20px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
  cursor: pointer;
}

.more-toggle.active {
  background: var(--color-brand);
  border-color: var(--color-brand);
}

.more-toggle-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transition: transform 0.2s var(--ease-out), background 0.2s;
}

.more-toggle.active .more-toggle-thumb {
  transform: translateX(-16px);
  background: #fff;
}

/* ══════════════════════════════════════
   Spacing & Alignment Improvements
   ══════════════════════════════════════ */

/* تحسين المسافات في بطاقات stat */
.stat-card { padding: var(--space-4) var(--space-4) var(--space-3); }

/* تحسين section-header */
.section-header { margin-bottom: var(--space-3); }

/* تحسين المسافة بين transaction items */
.transaction-item { padding: 12px 0; }

/* تحسين المسافة الداخلية للبطاقات */
.card { padding: var(--space-4); }

/* المسافة بين stats-grid والبطاقات */
.stats-grid { margin-bottom: var(--space-3); }

/* hero-greeting أكثر احترافية */
.hero-greeting {
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
}

.hero-balance { font-size: 28px; }
.hero-title { font-size: 14px; margin-bottom: var(--space-2); }

/* تحسين chart-container */
.chart-container { padding: var(--space-4); margin-bottom: var(--space-3); }

/* تحسين أزرار الإضافة في headers */
.section-header .btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* تحسين investment-card */
.investment-card { margin-bottom: var(--space-2); }

/* تحسين debt-card */
.debt-card { margin-bottom: var(--space-2); }

/* Responsive */
@media (max-width: 360px) {
  .quick-actions { grid-template-columns: repeat(4, 1fr); gap: var(--space-1); }
  .qa-btn { padding: var(--space-2) 4px; font-size: 10px; }
  .cf-item { padding: var(--space-2); }
  .cf-amount { font-size: 12px; }
}

/* ════════════════════════════════════════
   Stability & UX Polish
   ════════════════════════════════════════ */

/* منع scroll من تغيير قيمة input[type=number] على موبايل */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* منع تحديد النص عند الضغط المطوّل على الأزرار */
.btn, .bottom-nav-item, .qa-btn, .more-nav-item, .filter-chip {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* منع overscroll bounce يؤثر على modal على iOS */
.modal {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* منع تكبير الصفحة عند focus على input في iOS */
@media (max-width: 768px) {
  .form-control {
    font-size: max(16px, 1em);
  }
}

/* تحسين touch target لأزرار الأيقونات الصغيرة */
.btn-icon {
  min-width: 36px;
  min-height: 36px;
}

/* إشارة بصرية عند disabled (saving guard) */
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* منع modal overlay من التأثر بـ iOS rubber-band scroll */
.modal-overlay {
  overscroll-behavior: none;
}

/* ════════════════════════════════════════
   Premium Animations (Micro-interactions)
   ════════════════════════════════════════ */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger-enter {
  opacity: 0;
  animation: slideUpFade 0.5s var(--ease-out) forwards;
}
.stagger-enter:nth-child(1) { animation-delay: 0.05s; }
.stagger-enter:nth-child(2) { animation-delay: 0.1s; }
.stagger-enter:nth-child(3) { animation-delay: 0.15s; }
.stagger-enter:nth-child(4) { animation-delay: 0.2s; }
.stagger-enter:nth-child(5) { animation-delay: 0.25s; }

/* Interactive button scale */
button:active {
  transform: scale(0.97);
}
