/* ==========================================================================
   نظام تشغيل حياتي (Hayati OS) - نظام التصميم الجديد الفاخر (Minimal Luxury)
   ========================================================================== */

/* استيراد خط Cairo */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
  /* لوحة الألوان الرئيسية (Dark Premium Theme) */
  --bg-primary: #07070a;        /* خلفية رئيسية عميقة */
  --bg-secondary: #0e0e14;      /* خلفية البطاقات والحاويات */
  --bg-tertiary: #14141e;       /* خلفية العناصر الداخلية المرتفعة */
  --border-color: rgba(255, 255, 255, 0.05); /* حواف شفافة ناعمة */
  --border-color-hover: rgba(139, 92, 246, 0.25); /* حواف نشطة باللون البنفسجي */
  
  /* ألوان التمييز والتفاعلات */
  --accent: #8b5cf6;            /* بنفسجي فاخر أساسي */
  --accent-hover: #a78bfa;      /* بنفسجي فاتح للتمرير */
  --accent-glow: rgba(139, 92, 246, 0.15); /* هالة ضوئية بنفسجية */
  --accent-solid: #6d28d9;
  
  /* ألوان النصوص */
  --text-primary: #f4f4f5;      /* نصوص رئيسية ساطعة مريحة للعين */
  --text-secondary: #a1a1aa;    /* نصوص فرعية رمادية */
  --text-muted: #71717a;        /* نصوص غير نشطة */
  
  /* ألوان الحالات */
  --accent-green: #10b981;      /* نجاح / اكتمال */
  --accent-green-bg: rgba(16, 185, 129, 0.08);
  --accent-red: #f87171;        /* خطر / حذف */
  --accent-red-bg: rgba(248, 113, 113, 0.08);
  --accent-orange: #fb923c;     /* تحذير / مراجعة */
  --accent-orange-bg: rgba(251, 146, 60, 0.08);
  --accent-blue: #60a5fa;
  --accent-blue-bg: rgba(96, 165, 250, 0.08);

  /* أبعاد وحواف */
  --border-radius-xl: 16px;
  --border-radius-lg: 12px;
  --border-radius-md: 8px;
  --border-radius-sm: 6px;
  
  /* الخطوط */
  --font-family: 'Cairo', sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 800;

  /* انتقالات سلسة */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Glassmorphism */
  --glass-bg: rgba(14, 14, 20, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   إعادة الضبط والتهيئة العامة (General Reset & Setup)
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

body.dark-mode {
  background-color: var(--bg-primary);
}

/* تخصيص أشرطة التمرير */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-glow);
}

/* ==========================================================================
   عناصر واجهة المستخدم الأساسية (Core UI Elements)
   ========================================================================== */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

button, .btn {
  font-family: var(--font-family);
  font-weight: var(--font-weight-semibold);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-bounce);
  font-size: 0.9rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

button::after, .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

button:active, .btn:active {
  transform: scale(0.96);
}

/* درجات الأزرار */
.btn-primary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(109, 40, 217, 0.8));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.9), rgba(139, 92, 246, 0.9));
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
  border-color: rgba(167, 139, 250, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--border-color-hover);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--border-radius-md);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--border-radius-xl);
}

/* حقول الإدخال */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

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

.input-group {
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* شارات الحالات (Badges) */
.badge, .task-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  border-radius: 20px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.task-badge {
  margin-left: 5px;
}

/* ==========================================================================
   شاشات الحماية والتهيئة والتحميل (Auth, Setup, Loading)
   ========================================================================== */
.fullscreen-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-primary);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.spinner {
  width: 45px;
  height: 45px;
  border: 3px solid rgba(139, 92, 246, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fullscreen-loading p {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
}

.auth-container, .setup-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--bg-primary);
}

.auth-card, .setup-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header, .setup-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1, .setup-header h1 {
  font-size: 1.8rem;
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-header p, .setup-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   الهيكل العام للموقع وقائمة التنقل (Layout & Sidebar)
   ========================================================================== */
#main-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* خلفية التعتيم للقائمة الجانبية في الهواتف */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1990;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  touch-action: none;
}

.sidebar-overlay.active,
body.sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* قفل التمرير على خلفية الصفحة عند فتح القائمة الجانبية */
body.sidebar-open {
  overflow: hidden !important;
  touch-action: none;
  height: 100vh !important;
  height: 100dvh !important;
  position: fixed;
  width: 100%;
}

/* القائمة الجانبية العائمة (Floating Sidebar) لسطح المكتب */
.sidebar {
  position: fixed;
  top: 20px;
  bottom: 20px;
  right: 20px;
  width: 260px;
  background-color: rgba(14, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand i {
  color: var(--accent);
}

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

.sidebar-header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  -webkit-tap-highlight-color: transparent;
}

.sidebar-header-btn:hover,
.sidebar-header-btn:active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-close-btn {
  display: none;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-lg);
  font-size: 0.92rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  transition: var(--transition-bounce);
}

.menu-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}

.menu-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding-right: 20px;
}

.menu-item.active {
  background-color: var(--accent-glow);
  color: var(--accent-hover);
  border: 1px solid rgba(139, 92, 246, 0.2);
  font-weight: var(--font-weight-bold);
}

/* ==========================================================================
   الترويسة العلوية وشريط البحث (Header & Search)
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(7, 7, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 900;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  margin-right: 300px; /* مسافة لعدم التداخل مع الـ Sidebar العائم */
  transition: var(--transition-smooth);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.search-bar {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.search-bar i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-bar input {
  padding-right: 42px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.search-bar input:focus {
  border-color: var(--accent);
}

#search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1010;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent-hover);
}

.search-result-type {
  font-size: 0.75rem;
  background-color: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-secondary);
}

/* التنبيهات */
.notifications-dropdown {
  position: relative;
}

.notif-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  position: relative;
  cursor: pointer;
}

.notif-btn:hover {
  color: var(--text-primary);
}

#notif-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-orange);
  border-radius: 50%;
}

#notif-list {
  position: absolute;
  top: calc(100% + 15px);
  left: 0;
  width: 320px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.notif-header {
  padding: 16px;
  font-weight: var(--font-weight-bold);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
}

.notif-item {
  padding: 14px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

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

/* ==========================================================================
   مساحة المحتوى الرئيسي (Content Wrapper)
   ========================================================================== */
.content-wrapper {
  margin-right: 300px;
  padding: 30px 40px;
  width: 100%;
  min-height: 100vh;
  transition: var(--transition-smooth);
}

.app-view {
  animation: fadeIn 0.4s ease-out;
}

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

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.view-header h1 {
  font-size: 1.8rem;
  font-weight: var(--font-weight-black);
}

/* ==========================================================================
   1. الرئيسية (Dashboard Layout & Cards)
   ========================================================================== */
.dashboard-welcome {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 30px;
  margin-bottom: 30px;
}

.dashboard-welcome h1 {
  font-size: 1.8rem;
  font-weight: var(--font-weight-black);
  margin-bottom: 5px;
}

.dashboard-welcome p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

#daily-quote {
  font-size: 0.9rem;
  color: var(--accent-hover);
  border-right: 3px solid var(--accent);
  padding-right: 15px;
  font-style: italic;
}

/* إحصائيات لوحة التحكم */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.5s ease both;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.03), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

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

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent);
  border: 1px solid rgba(139,92,246,0.2);
  transition: var(--transition-bounce);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 0 20px rgba(139,92,246,0.3);
}

.stat-info h3 {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 1.45rem;
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
}

/* تقسيم الألواح بالرئيسية */
.dashboard-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 30px;
}

.dashboard-big-three, .dashboard-timeline-preview, .dashboard-business-preview {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  padding: 25px;
  animation: cardFadeIn 0.5s ease both;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: var(--accent);
}

/* قائمة المهام (Tasks) */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 20, 30, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition-bounce);
}

.task-item:hover {
  border-color: var(--border-color-hover);
  transform: translateX(-4px);
  box-shadow: 4px 0 15px rgba(139,92,246,0.1);
}

.task-item.completed {
  opacity: 0.65;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.task-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
}

.task-checkbox:hover {
  border-color: var(--accent);
  background-color: var(--accent-glow);
}

.task-checkbox.checked {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.task-checkbox i {
  font-size: 0.75rem;
  display: none;
}

.task-checkbox.checked i {
  display: block;
}

.task-content {
  display: flex;
  flex-direction: column;
}

.task-title {
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
}

.task-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.task-actions {
  display: flex;
  gap: 6px;
}

.task-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 6px;
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
}

.task-actions button:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.task-actions button.delete-btn:hover {
  color: var(--accent-red);
  background-color: var(--accent-red-bg);
}

/* ==========================================================================
   2. يومي (Timeline / My Day)
   ========================================================================== */
.timeline-container {
  position: relative;
  padding-right: 25px;
  margin-top: 20px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 8px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-row {
  position: relative;
  margin-bottom: 25px;
}

.timeline-dot {
  position: absolute;
  right: -21px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted);
  border: 2px solid var(--bg-primary);
  transition: var(--transition-smooth);
}

.timeline-row.active .timeline-dot {
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scale(1.3);
}

.timeline-row.completed .timeline-dot {
  background-color: var(--accent-green);
}

.timeline-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.timeline-row:hover .timeline-box {
  border-color: var(--border-color-hover);
}

.timeline-row.active .timeline-box {
  border-color: var(--accent);
  background-color: rgba(139, 92, 246, 0.02);
}

.timeline-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.timeline-time {
  font-weight: var(--font-weight-black);
  color: var(--accent-hover);
  font-size: 1rem;
  width: 90px;
  font-variant-numeric: tabular-nums;
}

.timeline-label {
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
}

/* ==========================================================================
   3. مركز الدراسة (Study Center)
   ========================================================================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.subject-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 24px;
  transition: var(--transition-bounce);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}

.subject-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.subject-card h2 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-black);
  margin-bottom: 15px;
}

.subject-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  flex: 1;
}

.sub-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sub-stat-row span:last-child {
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
}

/* ==========================================================================
   4. بنك الأخطاء والرسومات البيانية (Errors Bank & Charts)
   ========================================================================== */
.analysis-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 25px;
  margin-bottom: 30px;
}

.analysis-chart-placeholder {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 25px 0;
}

.ratio-bar-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ratio-bar-label {
  width: 140px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
}

.ratio-bar-wrapper {
  flex: 1;
  background-color: var(--bg-tertiary);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.ratio-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
  transition: width 1s ease-out;
}

.ratio-bar-value {
  width: 45px;
  font-size: 0.85rem;
  font-weight: var(--font-weight-bold);
  text-align: left;
}

.conclusion-badge {
  font-size: 0.9rem;
  color: var(--accent-orange);
  font-weight: var(--font-weight-semibold);
  background-color: var(--accent-orange-bg);
  border: 1px solid rgba(251, 146, 60, 0.2);
  padding: 12px 18px;
  border-radius: var(--border-radius-lg);
  display: block;
  line-height: 1.6;
}

/* ==========================================================================
   الجداول (Data Tables)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  background-color: var(--bg-secondary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: var(--font-weight-bold);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

/* ==========================================================================
   5. جدول الدروس الأسبوعي (Weekly Schedule)
   ========================================================================== */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 25px;
  overflow-x: auto;
}

.schedule-day-column {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 12px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-day-column h3 {
  font-size: 0.95rem;
  font-weight: var(--font-weight-bold);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.schedule-lesson-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 10px;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.schedule-lesson-card:hover {
  border-color: var(--border-color-hover);
}

.schedule-time-badge {
  color: var(--accent-hover);
  font-weight: var(--font-weight-bold);
  margin-bottom: 4px;
  display: block;
}

/* ==========================================================================
   6. مركز البزنس (Business Center)
   ========================================================================== */
.business-info-dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 30px;
  margin-bottom: 30px;
}

.roadmap-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.roadmap-stage-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 24px;
}

.roadmap-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.roadmap-stage-title h3 {
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold);
}

.roadmap-stage-title p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.roadmap-stage-tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.stage-task-row {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   7. خزنة الأفكار (Ideas Board)
   ========================================================================== */
.ideas-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 25px;
}

.idea-column {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 450px;
}

.idea-column h3 {
  font-size: 0.95rem;
  font-weight: var(--font-weight-bold);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 5px;
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.idea-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.idea-card:hover {
  transform: scale(1.03);
  border-color: var(--accent);
}

.idea-card h4 {
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 6px;
}

.idea-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   8. تفريغ الذهن (Brain Dump)
   ========================================================================== */
.brain-dump-input-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 25px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.braindump-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.braindump-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 15px;
}

.braindump-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   9. مركز الأموال (Money Management)
   ========================================================================== */
.money-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.money-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 25px;
  text-align: center;
  transition: var(--transition-smooth);
}

.money-card:hover {
  border-color: var(--border-color-hover);
}

.money-card h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.money-card p {
  font-size: 1.7rem;
  font-weight: var(--font-weight-black);
}

.money-card.income p { color: var(--accent-green); }
.money-card.expense p { color: var(--accent-red); }

.wallets-list-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.wallet-balance-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   10. تتبع العادات (Habit Tracker)
   ========================================================================== */
.habits-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

.habit-row-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.habit-row-item:hover {
  border-color: var(--border-color-hover);
}

.habit-info-col h3 {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
}

.habit-info-col p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.habit-checkbox-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-bounce);
}

.habit-checkbox-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.habit-checkbox-btn.checked {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
  transform: scale(1.05);
}

/* ==========================================================================
   11. المراجعة والتحليلات (Reviews & Analytics)
   ========================================================================== */
.analytics-dashboard {
  margin-top: 25px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.analytic-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 24px;
  text-align: center;
}

.analytic-card h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.analytic-card p {
  font-size: 1.6rem;
  font-weight: var(--font-weight-black);
}

.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.analytics-col {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 25px;
}

.analytics-col h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: var(--font-weight-bold);
}

.analytic-insight {
  font-size: 0.95rem;
  color: var(--accent-orange);
  background-color: var(--accent-orange-bg);
  border: 1px solid rgba(251, 146, 60, 0.15);
  padding: 16px 20px;
  border-radius: var(--border-radius-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.7;
}

.stat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-list-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

/* ==========================================================================
   12. الإعدادات (Settings Page)
   ========================================================================== */
.settings-form {
  max-width: 720px;
  margin-top: 25px;
}

.settings-section {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 30px;
  margin-bottom: 30px;
}

.settings-section h3 {
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

/* ==========================================================================
   النوافذ المنبثقة الشفافة الفاخرة (Premium Modals)
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 5, 8, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: modalFadeIn 0.25s ease;
}

.modal-content {
  background: rgba(14, 14, 20, 0.85);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: var(--font-weight-black);
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.close-modal-btn:hover {
  color: var(--text-primary);
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}

/* ==========================================================================
   اللوحات السفلية للهواتف (Mobile Bottom Sheets)
   ========================================================================== */
.bottom-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: var(--transition-smooth);
}

.bottom-sheet.hidden {
  opacity: 0;
  pointer-events: none;
}

.bottom-sheet.hidden .bottom-sheet-content {
  transform: translateY(100%);
}

.bottom-sheet-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 5, 8, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: var(--transition-smooth);
}

.bottom-sheet-content {
  position: relative;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 2;
  transition: var(--transition-bounce);
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom)) 20px;
}

.bottom-sheet-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.bottom-sheet-drag-handle {
  width: 36px;
  height: 4px;
  background-color: var(--text-muted);
  border-radius: 2px;
  margin-bottom: 12px;
}

.bottom-sheet-header h2 {
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold);
  text-align: center;
}

.bottom-sheet-close-btn {
  position: absolute;
  left: 0;
  top: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.bottom-sheet-body {
  overflow-y: auto;
  flex: 1;
}

/* شبكة الإجراءات السريعة (FAB Grid) */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 10px 0;
}

.quick-action-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: var(--transition-bounce);
}

.quick-action-btn:hover {
  border-color: var(--accent);
}

.quick-action-btn i {
  font-size: 1.35rem;
  color: var(--accent);
}

/* شبكة قائمة المزيد */
.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 10px 0;
}

.more-menu-item {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: var(--transition-bounce);
}

.more-menu-item:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.more-menu-item i {
  font-size: 1.3rem;
  color: var(--accent);
}

/* ==========================================================================
   شاشات الهواتف وأجهزة التابلت (Responsive Design & PWA)
   ========================================================================== */

/* شريط التنقل السفلي للهواتف - مخفي افتراضياً على سطح المكتب */
.mobile-bottom-nav {
  display: none;
}

/* شاشات الأجهزة اللوحية (Tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  .content-wrapper, .main-header {
    margin-right: 280px;
  }
  .dashboard-stats-grid, .ideas-board, .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* الشاشات المتوسطة والصغيرة (تضمين تصميم الدرج الجانبي للهواتف Mobile Drawer) */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: min(290px, 82vw);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    background-color: rgba(14, 14, 20, 0.96);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px 0 0 20px;
    padding: 0;
    gap: 0;
    z-index: 2000;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.55), -1px 0 0 rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    touch-action: pan-y;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    display: flex;
    flex-direction: column;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  /* الهيدر المدمج الثابت للقائمة الجانبية */
  .sidebar-brand {
    flex-shrink: 0;
    padding-top: max(14px, env(safe-area-inset-top, 14px));
    padding-right: 16px;
    padding-left: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(14, 14, 20, 0.98);
  }

  .sidebar-brand-title {
    font-size: 1.05rem;
    gap: 10px;
    font-weight: var(--font-weight-bold);
  }

  .sidebar-brand-title i {
    font-size: 1.15rem;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  /* قائمة التنقل الداخلية القابلة للتمرير - تحسين المساحات الرأسية */
  .sidebar-menu {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    padding: 10px 12px calc(64px + env(safe-area-inset-bottom, 0px) + 36px) 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  /* عناصر القائمة الجانبية - محاذاة دقيقة ومسافات لمس مريحة ومدمجة */
  .menu-item {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 0.9rem;
    gap: 12px;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    width: 100%;
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  }

  .menu-item i {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
  }

  .menu-item:hover,
  .menu-item:active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
  }

  .menu-item.active {
    background: var(--accent-glow);
    color: var(--accent-hover);
    border: 1px solid rgba(139, 92, 246, 0.25);
    font-weight: var(--font-weight-bold);
  }

  .menu-item.active i {
    color: var(--accent);
    transform: scale(1.1);
  }

  .menu-item:active {
    transform: scale(0.98);
  }
  
  .content-wrapper, .main-header {
    margin-right: 0;
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  .dashboard-row {
    grid-template-columns: 1fr;
  }
  
  .ideas-board {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-row {
    grid-template-columns: 1fr;
  }
}

/* شاشات الهواتف الذكية (Mobile Native Layout) */
@media (max-width: 768px) {
  /* شريط التنقل السفلي الشبيه بالتطبيقات الأصلية */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(7, 7, 10, 0.75);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-top: 1px solid rgba(255,255,255,0.06);
    justify-content: space-around;
    align-items: center;
    z-index: 1500;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: var(--font-weight-semibold);
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: var(--transition-bounce);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item i {
    font-size: 1.2rem;
    transition: var(--transition-bounce);
  }

  .mobile-nav-item.active {
    color: var(--accent);
  }
  .mobile-nav-item.active i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(139,92,246,0.5));
  }

  /* الزر العائم */
  .mobile-fab {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--accent), var(--accent-solid));
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    bottom: 14px;
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5), 0 0 40px rgba(139,92,246,0.15);
    z-index: 1600;
    transition: var(--transition-bounce);
    cursor: pointer;
    animation: fabPulse 3s ease-in-out infinite;
  }

  @keyframes fabPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(139,92,246,0.5); }
    50% { box-shadow: 0 6px 32px rgba(139,92,246,0.7), 0 0 50px rgba(139,92,246,0.2); }
  }

  .mobile-fab:active {
    transform: scale(0.88) translateY(4px);
    animation: none;
  }

  .mobile-nav-item-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: var(--font-weight-semibold);
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: var(--transition-bounce);
    cursor: pointer;
  }
  .mobile-nav-item-more i { font-size: 1.2rem; }
  .mobile-nav-item-more.active { color: var(--accent); }

  .content-wrapper {
    padding: 12px 12px calc(80px + env(safe-area-inset-bottom)) 12px;
  }

  .main-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-right: 0;
    background: rgba(7, 7, 10, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .header-left {
    display: none !important;
  }

  .search-bar {
    max-width: 180px;
  }
  .search-bar input {
    font-size: 0.85rem;
    padding: 10px 38px 10px 12px;
  }

  /* المودالات - لوحة سفلية glassmorphic */
  .modal-content {
    align-self: flex-end;
    border-radius: 24px 24px 0 0;
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(14, 14, 20, 0.92);
    backdrop-filter: blur(30px) saturate(1.3);
    -webkit-backdrop-filter: blur(30px) saturate(1.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: none;
    padding: 24px 20px;
  }

  @keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  /* تحسين الأزرار للمس */
  button, .btn {
    min-height: 44px;
    font-size: 0.88rem;
  }
  .btn-sm {
    min-height: 36px;
  }

  /* تخطيطات الأعمدة */
  .ideas-board,
  .money-summary-cards,
  .dashboard-stats-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
    gap: 12px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .stat-info p {
    font-size: 1.15rem;
  }
  .stat-info h3 {
    font-size: 0.75rem;
  }

  .schedule-grid { gap: 8px; }
  .quick-actions-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .more-menu-grid { grid-template-columns: repeat(2, 1fr); }

  .dashboard-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dashboard-welcome {
    padding: 20px;
    margin-bottom: 16px;
  }
  .dashboard-welcome h1 {
    font-size: 1.3rem;
  }

  .view-header {
    margin-bottom: 16px;
  }
  .view-header h1 {
    font-size: 1.3rem;
  }

  .section-header h2 {
    font-size: 1rem;
  }

  /* تقويم الموبايل */
  .calendar-days-grid {
    grid-auto-rows: minmax(60px, auto);
  }
  .calendar-day-cell {
    padding: 4px;
  }
  .calendar-day-number {
    font-size: 0.75rem;
  }
  .calendar-item-badge {
    font-size: 0.55rem;
    padding: 1px 4px;
  }

  /* بطاقات القرارات والأمنيات */
  .decision-card, .wish-card, .memory-card {
    padding: 16px;
  }

  /* Auth card mobile */
  .auth-card, .setup-card {
    padding: 28px 20px;
    margin: 0 8px;
  }
  .auth-header h1, .setup-header h1 {
    font-size: 1.4rem;
  }

  /* Focus overlay mobile */
  #focus-overlay .focus-box,
  #modal-focus-timer-overlay .modal-content {
    padding: 2rem 1.5rem;
  }
  #focus-overlay #focus-timer,
  #focus-overlay-timer-display {
    font-size: 3rem !important;
  }
  .focus-actions, .button-row {
    flex-direction: column;
    gap: 8px;
  }
  .focus-actions button, .button-row button {
    width: 100%;
  }

  /* Row inputs */
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* input groups */
  .input-group {
    margin-bottom: 14px;
  }
  input[type="text"], input[type="password"], input[type="number"],
  input[type="time"], input[type="date"], select, textarea {
    font-size: 16px; /* prevent iOS zoom */
    padding: 12px 14px;
  }
}

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

/* ==========================================================================
   التقويم الموحد ومركز الحياة (Calendar & Life Center)
   ========================================================================== */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: var(--font-weight-bold);
  padding: 0.75rem 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, auto);
}

.calendar-day-cell {
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--bg-card);
  transition: var(--transition-smooth);
}

.calendar-day-cell:nth-child(7n) {
  border-left: none;
}

.calendar-day-cell:hover {
  background: var(--bg-secondary);
}

.calendar-day-cell.other-month {
  opacity: 0.35;
}

.calendar-day-cell.today {
  background: rgba(139, 92, 246, 0.08);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.calendar-day-number {
  font-weight: var(--font-weight-black);
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.calendar-item-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  transition: opacity 0.15s;
}

.calendar-item-badge:hover {
  opacity: 0.85;
}

/* ==========================================================================
   خزنة القرارات والأمنيات والذكريات
   ========================================================================== */
.decision-card, .wish-card, .memory-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-bounce);
}

.decision-card:hover, .wish-card:hover, .memory-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 25px var(--accent-glow);
}

.decision-badge, .wish-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: var(--font-weight-bold);
  margin-bottom: 12px;
}

.decision-badge.financial { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.decision-badge.life { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.decision-badge.business { background: rgba(139, 92, 246, 0.1); color: var(--accent); }
.decision-badge.other { background: rgba(107, 114, 128, 0.1); color: var(--text-muted); }

.wish-badge.high { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.wish-badge.medium { background: rgba(245, 158, 11, 0.1); color: var(--accent-yellow); }
.wish-badge.low { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }

.memory-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  margin-bottom: 15px;
  background-color: var(--bg-primary);
}

.memory-reactions {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.reaction-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.reaction-btn:hover {
  color: var(--accent-red);
}

.memory-comments-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.memory-comment-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.memory-comment-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.memory-comments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.memory-comment-item {
  font-size: 0.75rem;
  background: var(--bg-primary);
  padding: 6px 10px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}
