/* ========================================================= */
/* === قسم المحفظة V6.8 - MaliMor Identity === */
/* ========================================================= */
/**
 * نظام ألوان MaliMor (الهوية الزمردية):
 * - الأخضر الزمردي: #10b981 (اللون الأساسي للعلامة التجارية)
 * - الأزرق الداكن (Navy): #0f172a (خلفية التطبيق)
 * - الرمادي الداكن (Slate): #1e293b (خلفية البطاقات)
 * - الأحمر: #ef4444 (للأخطاء والحذف)
 * - الأبيض: #ffffff (النص الأساسي)
 * - الرمادي: #94a3b8 (النص الثانوي)
 * 
 * فلسفة التصميم (Flat Design):
 * - NO GLOW EFFECTS (ممنوع التوهج)
 * - NO GRADIENTS (ممنوع التدرجات اللونية)
 * - ظلال خفيفة للعمق فقط (ليست Glow)
 */

:root {
  /* MaliMor Identity: Navy & Emerald (per .cursorrules) */
  --navy: #0f172a;
  --emerald: #10b981;
  --bg-deep: #020617;
  --card-glass: #1e293b;
  --accent: var(--emerald);
  --danger: #ef4444;
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --border-light: 1px solid rgba(255,255,255,0.08);
  --success: var(--emerald);
  --warning: #f59e0b;
  --refund-color: #009688;
}

/* ========================================================= */
/* === 1. رأس المحفظة (Wallet Header) === */
/* ========================================================= */
/**
 * الرأس يحتوي على:
 * - شعار MaliMor على اليمين
 * - زر الإعدادات على اليسار
 * 
 * التخطيط:
 * - Flexbox مع space-between لتوزيع العناصر
 * - padding متوازن للتوافق مع الأجهزة المحمولة
 */
/* رأس قسم المحفظة (بدون شعار مكرر - الشعار الرئيسي في app-header) */
#wallet-section .wallet-section-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#wallet-section .wallet-section-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-white);
  margin: 0;
  letter-spacing: -0.5px;
}

.settings-btn {
  width: 40px;
  height: 40px;
  border: var(--border-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: 0.2s;
}

.settings-btn:active {
  background: rgba(255,255,255,0.1);
  color: var(--accent);
  transform: scale(0.95);
}

/* ========================================================= */
/* === 2. قسم البطاقة الرئيسية (Hero Section) === */
/* ========================================================= */
/**
 * Hero Section يحتوي على:
 * - بطاقة الرصيد (قابلة للتوسيع)
 * - زر الإيداع
 * - إحصائيات عائمة (تظهر عند التوسيع)
 * 
 * التخطيط:
 * - Grid بعمودين (balance-card + deposit-btn)
 * - الإحصائيات في position: absolute (floating)
 */
.hero-section {
  padding: 0 20px;
  margin-bottom: 15px;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.top-deck {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
  position: relative;
  z-index: 20;
}

/* ========================================================= */
/* === بطاقة الرصيد (Balance Card) === */
/* ========================================================= */
/**
 * بطاقة عرض الرصيد الحالي
 * 
 * الحالات (States):
 * 1. عادية: عرض الرصيد فقط
 * 2. مفتوحة (.open): عرض الإحصائيات العائمة
 * 3. مقفلة (.wallet-locked): حد أحمر + opacity منخفض
 * 
 * التصميم المسطح:
 * - خلفية صلبة (NO gradient)
 * - حد رفيع بالأخضر الزمردي
 * - ظل خفيف للعمق (ليس Glow)
 */
.balance-card {
  background: var(--card-glass);
  border: var(--border-light);
  border-radius: 20px;
  height: 100px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: 0.3s;
  position: relative;
}

.balance-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  pointer-events: none;
}

/* حالة القفل (Wallet Locked) */
.balance-card.wallet-locked {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
  opacity: 0.7;
  filter: grayscale(20%);
}

/* جسم البطاقة */
.card-body {
  flex: 1;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* التسمية العلوية */
.label {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  padding-right: 15px;
}

/* مؤشر القفل (Lock Indicator) - مخفي افتراضياً ويظهر فقط عند تفعيل القفل من الإعدادات */
#wallet-section .lock-indicator,
#wallet-section #lockIcon {
  display: none;
  margin-right: auto;
  padding-left: 15px;
  font-size: 0.9rem;
  animation: pulse 2s infinite;
  color: var(--danger);
}

#wallet-section #lockIcon.lock-visible {
  display: inline-block;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* صف عرض الرصيد */
.balance-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  direction: ltr;
  width: 100%;
  padding: 0 20px;
}

/* مبلغ الرصيد */
.amount {
  font-family: 'Roboto';
  font-weight: 700;
  color: white;
  line-height: 1;
  font-size: 1.6rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.currency {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* أيقونة إظهار/إخفاء الرصيد */
#wallet-section .balance-toggle {
  font-size: 0.875rem;
  color: var(--text-gray);
  cursor: pointer;
  margin-right: 0.25rem;
  transition: color 0.2s;
}
#wallet-section .balance-toggle:hover {
  color: var(--brand-color);
}

/* شريط الإجراء السفلي (السهم لتوسيع الإحصائيات) */
#wallet-section .action-bar {
  height: 32px;
  min-height: 32px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
}

#wallet-section .action-bar:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-white);
}

#wallet-section .action-bar i {
  font-size: 0.95rem;
  transition: transform 0.3s ease, color 0.2s ease;
  opacity: 1;
}

#wallet-section .balance-card.open .action-bar i {
  transform: rotate(180deg);
  color: var(--accent);
}

/* ========================================================= */
/* === زر الإيداع (Deposit Button) === */
/* ========================================================= */
/**
 * زر سريع للانتقال لصفحة الإيداع
 * 
 * التصميم:
 * - مربع عمودي بنفس ارتفاع بطاقة الرصيد
 * - أيقونة + نص
 * - تأثير Scale عند النقر
 */
.deposit-btn {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.deposit-btn:active {
  transform: scale(0.96);
  border-color: var(--accent);
}

.icon-box {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: 0.3s;
}

.deposit-text {
  color: var(--text-white);
  font-weight: 700;
  font-size: 0.75rem;
}

/* ========================================================= */
/* === صندوق الإحصائيات العائم (Floating Stats) === */
/* ========================================================= */
/**
 * يظهر أسفل بطاقة الرصيد عند النقر على السهم
 * 
 * المحتوى:
 * - إجمالي الوارد (Incoming)
 * - إجمالي المشتريات (Outgoing)
 * 
 * الحركة:
 * - opacity: 0 → 1
 * - transform: translateY(-20px) → translateY(20px)
 */
.floating-stats-container {
  position: absolute;
  top: 90px;
  left: 20px;
  right: 20px;
  z-index: 10;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  transition: 0.3s ease;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.floating-stats-container.show {
  opacity: 1;
  transform: translateY(20px);
  pointer-events: auto;
}

.stat-box {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  transition: 0.3s;
  backdrop-filter: blur(10px);
}

.stat-val-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  direction: ltr;
}

.stat-val {
  font-family: 'Roboto';
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: 0.3s;
}

.stat-curr {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 5px;
}

/* ألوان الإحصائيات */
.c-green-plain { color: #10b981; }
.c-red-plain { color: #ef4444; }

/* ========================================================= */
/* === 3. أدوات التحكم (Controls Wrapper) === */
/* ========================================================= */
/**
 * يحتوي على:
 * - شريط البحث
 * - أزرار التحكم (بحث + فلتر)
 * - فلاتر سريعة (Chips)
 */
.controls-wrapper {
  padding: 0 20px 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}

/* صف البحث */
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input-wrap {
  flex: 1;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  height: 45px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: 0.3s;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.search-input-wrap input {
  background: transparent;
  border: none;
  flex: 1;
  height: 100%;
  color: white;
  font-family: 'Cairo';
  outline: none;
  font-size: 0.9rem;
}

/* أزرار التحكم */
.control-btn {
  width: 45px;
  height: 45px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
}

.control-btn:active {
  transform: scale(0.95);
  color: var(--accent);
  border-color: var(--accent);
}

/* فلاتر سريعة (Chips) */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.chip {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  transition: 0.2s;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

/* ========================================================= */
/* === 4. قائمة العمليات (Transactions List) === */
/* ========================================================= */
/**
 * منطقة قابلة للتمرير (Scrollable Area)
 * 
 * محتوى:
 * - بطاقات العمليات (tx-card)
 * - حالة فارغة (empty-state) إذا لم تكن هناك عمليات
 */
.scrollable-list-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 80px;
  position: relative;
  transition: 0.3s;
}

/* رسوم متحركة للظهور */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* بطاقة عملية واحدة */
.tx-card {
  background: #131b29;
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  animation: fadeInUp 0.4s ease backwards;
}

/* الحالة الفارغة (No Transactions) */
.empty-state {
  text-align: center;
  padding-top: 60px;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.empty-icon {
  font-size: 3.5rem;
  color: #1e293b;
  margin-bottom: 15px;
  display: inline-block;
}

.empty-title {
  color: white;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 5px;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* وضع العرض المضغوط */
body.compact-mode .tx-card {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
}

body.compact-mode .tx-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* وضع الخصوصية (Privacy Mode) */
body.privacy-active .amount,
body.privacy-active .stat-val,
body.privacy-active .tx-amount,
body.privacy-active .tx-remaining {
  filter: blur(6px);
  opacity: 0.7;
  user-select: none;
}

/* أيقونة العملية */
.tx-icon {
  width: 42px;
  height: 42px;
  background: #1e293b;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* محتوى العملية */
.tx-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tx-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tx-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.tx-date {
  font-family: 'Roboto';
  font-size: 0.7rem;
  color: #64748b;
  direction: ltr;
  text-align: right;
}

/* رقم المعاملة (Transaction ID) */
.tx-id {
  font-family: 'Roboto';
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 6px;
  align-self: flex-start;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tx-id:hover {
  background: rgba(255,255,255,0.08);
}

.tx-id.copied {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.3);
  pointer-events: none;
}

/* ========================================================= */
/* === المعلومات المالية للعملية (Financial Info) === */
/* ========================================================= */
/**
 * يعرض:
 * - المبلغ (tx-amount): موجب أو سالب بألوان مختلفة
 * - الرصيد المتبقي (tx-remaining): رمادي
 * 
 * التنسيق:
 * - direction: ltr (الأرقام من اليسار لليمين)
 * - align-items: flex-end (محاذاة لليسار في RTL)
 */
.tx-financial {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  min-width: 80px;
  gap: 3px;
}

.tx-amount {
  font-family: 'Roboto';
  font-weight: 700;
  font-size: 0.95rem;
  direction: ltr;
  margin-bottom: 2px;
}

.tx-remaining {
  font-family: 'Roboto';
  font-size: 0.7rem;
  color: #64748b;
  direction: ltr;
  margin-left: 11px;
}

/* ألوان أنواع العمليات */
.c-dep { color: #10b981; } /* إيداع */
.c-pur { color: #ef4444; } /* شراء */
.c-pen { color: #f59e0b; } /* معلق */
.c-ref { color: #009688; } /* مسترجع */

/* ========================================================= */
/* === 5. شريط التنقل السفلي (Bottom Navigation) === */
/* ========================================================= */
/* يُعرّف بالكامل في main.css (تصميم عائم موحّد) */

/* ========================================================= */
/* === 6. النوافذ المنبثقة (Modals) === */
/* ========================================================= */

/* طبقة التعتيم (Modal Overlay) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

/* النافذة المخصصة */
.custom-modal {
  background: #111827;
  width: 90%;
  max-width: 350px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* رأس النافذة */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.reset-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-family: 'Cairo';
  font-size: 0.85rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: 0.2s;
}

.reset-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ========================================================= */
/* === قائمة الإعدادات (Settings List) === */
/* ========================================================= */
.settings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: 0.2s;
  border-radius: 8px;
}

.settings-item:last-child {
  border-bottom: none;
}

.set-icon-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
}

.set-icon-title i {
  width: 25px;
  color: var(--text-muted);
  text-align: center;
}

/* ========================================================= */
/* === مفتاح التبديل (Toggle Switch) === */
/* ========================================================= */
/**
 * Switch مخصص بديل عن checkbox
 * 
 * الحالات:
 * - OFF: رمادي
 * - ON: أخضر زمردي
 * - Danger: أحمر (لخيار القفل)
 */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  right: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(-20px);
}

.switch.danger input:checked + .slider {
  background-color: var(--danger);
}

/* ========================================================= */
/* === نافذة الفلتر المتقدم (Filter Modal) === */
/* ========================================================= */

.filter-section {
  margin-bottom: 24px;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}

/* شبكة أنواع العمليات */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.2s;
  color: var(--text-muted);
}

.type-btn:hover {
  background: rgba(255,255,255,0.05);
}

.type-btn.active.t-in {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
}

.type-btn.active.t-out {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.type-btn.active.t-pen {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #f59e0b;
}

.type-btn.active.t-ref {
  background: rgba(0, 150, 136, 0.15);
  border-color: #009688;
  color: #009688;
}

/* شرائح التواريخ السريعة */
.date-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.d-chip {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
}

.d-chip:hover {
  background: rgba(255,255,255,0.05);
}

.d-chip.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-color: var(--accent);
}

/* صف الحقول */
.input-row {
  display: flex;
  gap: 10px;
}

.f-input-wrap {
  flex: 1;
  background: #1f2937;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.f-input-wrap:hover {
  border-color: rgba(255,255,255,0.1);
}

.f-input-wrap i {
  color: #64748b;
  font-size: 0.9rem;
}

.f-input {
  background: transparent;
  border: none;
  color: white;
  width: 100%;
  font-family: 'Cairo';
  outline: none;
  font-size: 0.9rem;
  pointer-events: none;
}

.f-input::placeholder {
  color: #4b5563;
}

/* أزرار الإجراءات */
.fm-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.fm-btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: 'Cairo';
  font-size: 0.95rem;
  transition: 0.2s;
}

.fm-btn:active {
  transform: scale(0.98);
}

.fm-btn.apply {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.fm-btn.cancel {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

/* ========================================================= */
/* === التقويم المخصص (Custom Calendar) === */
/* ========================================================= */
/**
 * تقويم كامل بثلاثة أوضاع:
 * 1. أيام (Days)
 * 2. أشهر (Months)
 * 3. سنوات (Years)
 */
.calendar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111827;
  z-index: 300;
  display: none;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* رأس التقويم */
.cal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.cal-nav-btn:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.08);
}

.cal-title-btn {
  font-weight: 800;
  color: white;
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cairo';
  padding: 8px 16px;
  border-radius: 8px;
}

.cal-title-btn:active {
  background: rgba(255,255,255,0.05);
}

.cal-title-btn i {
  font-size: 0.8rem;
  color: var(--accent);
}

/* شبكة التقويم */
.cal-grid {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

/* وضع الأيام */
.view-days .weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 15px;
}

.view-days .weekdays span {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
}

.view-days .days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Roboto';
  font-weight: 500;
}

.day:hover {
  background: rgba(255,255,255,0.05);
}

.day.empty {
  pointer-events: none;
}

.day.today {
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.day.selected {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* شبكة الاختيار (للأشهر والسنوات) */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.sel-item {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 20px 0;
  text-align: center;
  color: white;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: 'Cairo';
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
}

.sel-item:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}

.sel-item.active {
  background: var(--accent);
  color: #000;
  font-weight: 800;
  border-color: var(--accent);
}

/* ذيل التقويم */
.cal-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: flex-end;
}

/* ========================================================= */
/* === فئات مساعدة للمحفظة (Wallet Utility Classes) === */
/* ========================================================= */
/**
 * نقل الأنماط من النص المضمن (Inline) إلى هنا
 * للحفاظ على عزل كامل (Absolute Isolation)
 */

/* مودال الفلتر: يحتوي على تقويم داخلي فيحتاج overflow و position */
#wallet-section .custom-modal.modal-with-calendar {
  position: relative;
  overflow: hidden;
}

/* حقول نطاق المبلغ: السماح بالكتابة والنقر */
#wallet-section .f-input-wrap.allow-type {
  cursor: text;
}

#wallet-section .f-input.allow-input {
  pointer-events: auto;
}

/* زر إغلاق التقويم داخل المودال */
#wallet-section .fm-btn.cal-close {
  flex: 0;
  padding: 8px 24px;
}

/* رأس مودال الإعدادات بدون حد سفلي */
#wallet-section .modal-header.no-border {
  border: none;
  margin-bottom: 10px;
}

/* أيقونة إغلاق المودال */
#wallet-section .modal-close-icon {
  cursor: pointer;
  color: #fff;
}

/* أيقونة القفل في الإعدادات (لون خطر) */
#wallet-section .set-icon-title .icon-danger {
  color: var(--danger);
}
