:root {
  --primary-color: #0f172a;
  --secondary-color: #3b82f6;
  --solar-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --solar-card-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: #cbd5e1; color: var(--text-main); display: flex; justify-content: center; }
#app-container { width: 100%; max-width: 440px; min-height: 100vh; background-color: var(--bg-color); position: relative; box-shadow: 0 0 30px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; }
[dir="rtl"] { text-align: right; }
[dir="ltr"] { text-align: left; }
.screen { display: none; flex: 1; padding: 16px 16px 85px 16px; animation: fadeIn 0.25s ease-in-out; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.bottom-nav { position: fixed; bottom: 0; width: 100%; max-width: 440px; height: 68px; background-color: #ffffff; display: flex; justify-content: space-around; align-items: center; border-top: 1px solid var(--border-color); box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03); z-index: 1000; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: #94a3b8; cursor: pointer; background: none; border: none; flex: 1; transition: all 0.2s ease; }
.nav-item i { font-size: 20px; margin-bottom: 4px; }
.nav-item.active { color: var(--secondary-color); font-weight: 600; }
.nav-item.active i { transform: translateY(-2px); }

/* ========================================================
   تثبيت شريط التنقل السفلي بشكل دائم في جميع الصفحات (FIXED NAV)
   ======================================================== */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 auto !important;
  max-width: 440px !important;
  width: 100% !important;
  height: 64px !important;
  z-index: 999999 !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.06) !important;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  /* دعم شريط الآيفون السفلي ومنع تداخله */
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  box-sizing: border-box !important;
  transform: none !important; /* إلغاء أي transform يسبب تحرك الشريط أثناء السكرول */
}

.bottom-nav .nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  color: #64748b !important;
  text-decoration: none !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  flex: 1 !important;
  height: 100% !important;
}

.bottom-nav .nav-item i {
  font-size: 18px !important;
}

.bottom-nav .nav-item.active {
  color: #2563eb !important;
}

/* إضافة فراغ سفلي إجباري لجميع الحاويات حتى لا يغطي الشريط آخر عنصر */
body, 
.home-app-container, 
.app-container, 
.page-container, 
.device-container,
.tasks-container,
.mine-container {
  padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
}