
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; position: relative; scroll-behavior: smooth; background: #FFFFFF; }

body, button, input, select, textarea, label, h1, h2, h3, h4, p, span, a {
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
}

body { color: #1a1a2e; min-height: 100vh; padding-bottom: 90px; transition: filter 0.3s ease; }
body.settings-open { overflow: hidden; }

/* 🎨 الهيدر */
.header-fixed {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(135deg, #E67E22 0%, #D35400 50%, #A04000 100%);
  color: #fff; padding: 1rem 1rem 1.3rem; text-align: center;
  border-radius: 0 0 35px 35px;
  box-shadow: 0 8px 32px rgba(160,64,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  min-height: 130px;
}
.header-content {
  position: relative; z-index: 1; display: flex !important; flex-direction: row !important;
  align-items: center !important; justify-content: space-between !important; gap: 0.8rem; flex-wrap: wrap;
}

/* 🎨 شعار "رشدة بيتي" بخط كوفي مزخرف */
.header-logo {
  width: auto !important; height: 42px !important; padding: 0 12px !important;
  background: rgba(255,255,255,0.95); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Aref Ruqaa', serif !important;
  font-size: 14px !important; font-weight: 700 !important;
  border: 2px solid rgba(255,255,255,0.4); backdrop-filter: blur(10px);
  animation: logoFloat 3s ease-in-out infinite; flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(160,40,0,0.2);
  color: #A04000 !important;
  letter-spacing: 0.5px;
}
@keyframes logoFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(3deg); } }

.header-title-container { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; min-width: 0; }
.header-title { font-size: 1.15rem !important; font-weight: 800; margin: 0; text-shadow: 0 2px 6px rgba(0,0,0,0.15); line-height: 1.25; color: #fff; white-space: nowrap; }
.header-subtitle { font-size: 0.72rem; opacity: 0.92; margin: 0.2rem 0 0; font-weight: 500; color: rgba(255,255,255,0.95); white-space: nowrap; }
.header-datetime { font-size: 0.68rem; opacity: 0.95; margin-top: 4px; background: rgba(255,255,255,0.25); padding: 3px 10px; border-radius: 15px; backdrop-filter: blur(5px); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.header-about-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.header-about-btn:hover { background: rgba(255,255,255,0.35); transform: scale(1.08); }

/* 📦 حاوية الكروت */
.container { max-width: 720px; margin: 160px auto 20px; padding: 15px; width: 100%; display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
.service-card {
  background: #FFFFFF;
  border-radius: 18px; padding: 16px 12px; text-align: center; border: 1px solid rgba(230,126,34,0.3);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08); transition: all 0.3s ease; width: 100%; cursor: pointer; 
  border-right: 5px solid #E67E22; position: relative; overflow: hidden;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 8px !important; min-height: 110px !important;
}
.service-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 36px rgba(230,126,34,0.28); border-right-color: #A04000; }
.service-card:active { transform: scale(0.98); }
.service-card i { font-size: 24px !important; width: 48px !important; height: 48px !important; margin: 0 !important; border-radius: 14px !important; background: rgba(230,126,34,0.1) !important; color: #A04000 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; flex-shrink: 0 !important; border: 1px solid rgba(160,40,0,0.15); }
.service-card h3 { font-size: 12px !important; font-weight: 700 !important; color: #1a1a2e !important; margin: 0 !important; line-height: 1.35 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; }
.service-card p { font-size: 10px !important; color: #667085 !important; margin: 0 !important; line-height: 1.25 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; }

.card-admins { border-right-color: #E67E22 !important; }
.card-marketers { border-right-color: #F39C12 !important; }
.card-products { border-right-color: #D35400 !important; animation: pulseProducts 2.5s infinite; }
.card-settings { border-right-color: #6E2C00 !important; }
.card-settings i { color: #6E2C00 !important; background: rgba(110,44,0,0.08) !important; }
@keyframes pulseProducts { 0%,100%{box-shadow:0 6px 24px rgba(0,0,0,0.08)} 50%{box-shadow:0 8px 32px rgba(243,156,18,0.35)} }

/* 🪟 المودالات */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); z-index: 10001; display: none; align-items: center; justify-content: center; padding: 15px; }
.modal.show { display: flex; }
.modal-content { background: #fff; border-radius: 22px; padding: 22px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-height: 85vh; overflow-y: auto; position: relative; border: 3px solid #E67E22; animation: modalSlideIn 0.3s ease; }
@keyframes modalSlideIn { from { transform: translateY(-25px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid rgba(230,126,34,0.25); }
.modal-header h3 { margin: 0; color: #A04000; font-size: 17px; font-weight: 700; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #E67E22, #D35400); color: #fff; border: none; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.modal-close:hover { transform: scale(1.1); }

/* 📋 قوائم البيانات */
.data-list { margin-top: 10px; max-height: 45vh; overflow-y: auto; }
.data-item { background: #FFFFFF; border-radius: 16px; padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; align-items: stretch; border: 1px solid rgba(230,126,34,0.25); transition: all 0.2s; border-right: 4px solid #E67E22; }
.data-item:hover { background: #FFF9F0; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(230,126,34,0.15); }
.data-item-name { font-weight: 700; color: #1a1a2e; font-size: 14px; margin-bottom: 4px; }
.data-item-detail { font-size: 11px; color: #556070; margin-top: 2px; }
.data-item-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* 🔘 الأزرار الرئيسية */
.action-btn { 
  padding: 14px 20px !important; border-radius: 14px !important; border: none !important;
  font-weight: 700 !important; font-size: 14px !important; cursor: pointer !important; transition: all 0.2s !important; 
  display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important;
  width: 100% !important;
}
.action-btn.primary { background: linear-gradient(135deg, #E67E22, #D35400) !important; color: #fff !important; }
.action-btn.secondary { background: #6c757d !important; color: #fff !important; }
.action-btn.success { background: #28a745 !important; color: #fff !important; }
.action-btn.warning { background: #ffc107 !important; color: #111 !important; }
.action-btn.danger { background: #dc3545 !important; color: #fff !important; }
.action-btn:hover { transform: translateY(-2px) !important; opacity: 0.95 !important; box-shadow: 0 6px 20px rgba(0,0,0,0.2) !important; }

.action-btn-call, .action-btn-whatsapp { 
  background: linear-gradient(135deg, #E67E22, #D35400) !important; color: #fff !important; 
  padding: 10px 14px !important; border-radius: 12px !important; border: none !important; 
  font-size: 12px !important; font-weight: 600 !important; cursor: pointer !important; 
  display: inline-flex !important; align-items: center !important; justify-content: center !important; 
  gap: 6px !important; transition: all 0.2s !important;
  width: calc(50% - 3px) !important; box-sizing: border-box !important; flex: 1 !important;
}
.action-btn-whatsapp { background: linear-gradient(135deg, #25D366, #128C7E) !important; }
.action-btn-call:hover, .action-btn-whatsapp:hover { transform: translateY(-2px) !important; opacity: 0.95 !important; box-shadow: 0 4px 14px rgba(0,0,0,0.15) !important; }

/* 📝 حقول الإدخال */
.input-group { margin-bottom: 14px; text-align: right; }
.input-group label { display: block; margin-bottom: 6px; font-weight: 700; color: #333; font-size: 13px; }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #ddd; font-size: 14px; background: #f9f9f9; direction: rtl; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { outline: none; border-color: #E67E22; box-shadow: 0 0 0 3px rgba(230,126,34,0.2); background: #fff; }

/* 🔍 مربع البحث */
.search-box { position: sticky; top: 0; background: #fff; padding: 10px 0; z-index: 5; border-bottom: 1px solid rgba(230,126,34,0.2); margin-bottom: 10px; border-radius: 12px; display: flex; gap: 8px; align-items: center; }
.search-box input { flex: 1; padding: 12px 15px; border-radius: 12px; border: 1px solid #ddd; font-size: 14px; background: #f9f9f9; }

/* 📊 التبويبات */
.tabs-wrapper { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.tab-btn { flex: 1; min-width: 75px; padding: 10px 5px; background: #FFF5E6; color: #A04000; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; font-size: 11px; transition: all 0.2s; }
.tab-btn.active { background: linear-gradient(135deg, #E67E22, #D35400); color: #fff; box-shadow: 0 4px 12px rgba(230,126,34,0.35); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 🍞 التنبيهات */
.toast { 
  position: fixed; 
  top: 20px; 
  left: 50%; 
  transform: translateX(-50%); 
  background: #FFFFFF;
  color: #1a1a2e;
  padding: 14px 24px 14px 18px;
  border-radius: 16px; 
  z-index: 10002; 
  display: none; 
  font-size: 13px; 
  font-weight: 600; 
  animation: toastSlide 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 2px solid #E67E22;
  min-width: 280px;
  max-width: 90%;
  align-items: center;
  gap: 12px;
}
.toast.show { display: flex; }
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.toast-content {
  flex: 1;
  text-align: right;
  line-height: 1.4;
}
.toast.success { border-color: #28a745; }
.toast.success .toast-icon { background: rgba(40,167,69,0.15); color: #28a745; }
.toast.warning { border-color: #ffc107; }
.toast.warning .toast-icon { background: rgba(255,193,7,0.15); color: #f39c12; }
.toast.error { border-color: #dc3545; }
.toast.error .toast-icon { background: rgba(220,53,69,0.15); color: #dc3545; }

@keyframes toastSlide { 
  from { transform: translateX(-50%) translateY(-50px); opacity: 0; } 
  to { transform: translateX(-50%) translateY(0); opacity: 1; } 
}

/* 📱 شريط التنقل السفلي */
.ios-nav { position: fixed; bottom: 12px; left: 12px; right: 12px; background: #FFFFFF; backdrop-filter: blur(20px); display: flex; justify-content: space-around; padding: 10px 0; border-radius: 26px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 10000; border: 1px solid rgba(230,126,34,0.3); }
body.settings-open .ios-nav { display: none; }
.ios-nav a { flex: 1; text-align: center; text-decoration: none; color: #667085; font-size: 10px; font-weight: 600; transition: color 0.2s; }
.ios-nav a i { display: block; font-size: 20px; margin-bottom: 3px; }
.ios-nav a.active { color: #A04000; }
.ios-nav a.active i { color: #E67E22; }

/* 🎯 شارات الحالة */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; margin-right: 5px; }
.status-badge-urgent { background: rgba(255,107,107,0.15); color: #dc3545; animation: blink 1.5s infinite; }
@keyframes blink { 50% { opacity: 0.7; } }

/* 📱 التجاوب */
@media (max-width: 480px) {
  .header-fixed { padding: 0.9rem 0.8rem 1.1rem; min-height: 115px; border-radius: 0 0 28px 28px; }
  .header-title { font-size: 1.05rem !important; }
  .header-logo { font-size: 12px !important; padding: 0 10px !important; }
  .container { gap: 10px !important; padding: 12px !important; margin-top: 145px !important; }
  .service-card { min-height: 100px !important; padding: 12px 10px !important; border-radius: 16px !important; }
  .service-card i { width: 42px !important; height: 42px !important; font-size: 20px !important; }
  .tab-btn { font-size: 10px; min-width: 70px; padding: 8px 3px; }
  .action-btn-call, .action-btn-whatsapp { width: 100% !important; margin-bottom: 6px; }
  .toast { min-width: 260px; padding: 12px 18px 12px 14px; font-size: 12px; }
  .toast-icon { width: 28px; height: 28px; font-size: 14px; }
}

.data-item-actions .action-btn {
  width: auto !important;
  min-width: 32px !important;
  padding: 6px 10px !important;
  font-size: 10px !important;
  justify-content: center !important;
  gap: 4px !important;
  display: inline-flex !important;
}

.data-item-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  justify-content: flex-end !important;
  margin-top: 6px !important;
}

/* 🗑️ مودال تأكيد الحذف */
.delete-modal-content {
  text-align: center;
  padding: 30px 20px;
}
.delete-modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(220,53,69,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #dc3545;
  animation: shakeIcon 0.5s ease;
}
@keyframes shakeIcon {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}
.delete-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 10px;
}
.delete-modal-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 25px;
  line-height: 1.6;
}
.delete-modal-item-name {
  font-weight: 700;
  color: #dc3545;
  background: rgba(220,53,69,0.08);
  padding: 8px 16px;
  border-radius: 12px;
  display: inline-block;
  margin: 10px 0;
}
.delete-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.delete-modal-actions .action-btn {
  width: auto !important;
  min-width: 120px !important;
  padding: 12px 24px !important;
}
