/* هيدر موحد */
.ip-header {
  position: fixed;
  top: 0;
  left: 0; 
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  padding: 0 15px;
  z-index: 9999;
  font-family: 'Alexandria', sans-serif;
}

/* شعار + عنوان */
.ip-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ip-header-right img {
  max-height: 40px;
}

.ip-header-right h2 {
  font-size: 16px;
  margin: 0;
  color: #222;
  white-space: nowrap;
}

/* قسم اليسار - الإشعارات والمستخدم */
.ip-header-left {
  display: flex;
  align-items: center;
 /* gap: 16px;*/
}

/* زر البرغر */
.burger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  justify-content: center;
  align-items: center;
}

.burger span,
.burger::before,
.burger::after {
  content: '';
  width: 22px;
  height: 3px;
  background: #1E746E;
  border-radius: 2px;
  transition: 0.3s ease;
}

.burger.active::before {
  transform: rotate(45deg) translateY(6px);
}

.burger.active span {
  opacity: 0;
}

.burger.active::after {
  transform: rotate(-45deg) translateY(-6px);
}

/* سايدبار يبدأ بعد الهيدر */
.sidebar {
  position: fixed;
  top: 60px;
  right: 0;
  width: 260px;
  height: calc(100% - 60px);
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -2px 0 6px rgba(0,0,0,.1);
  padding: 20px;
  z-index: 9998;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-nav a {
  display: block;
  margin-bottom: 12px;
  color: #1E746E;
  text-decoration: none;
  font-weight: bold;
  font-family: 'Alexandria';
}

.sidebar-nav a.active {
  background-color: #1E746E;
  color: #fff !important;
  border-radius: 6px;
  padding: 8px 12px;
}

/* الأفاتار */
.ip-avatar {
  border-radius: 50%;
  border: 2px solid #0073aa;
  width: 35px;
  height: 35px;
}

/* أيقونة الإشعارات */
.ip-bell {
  position: relative;
  text-decoration: none;
  font-size: 18px;
  color: #444;
  transition: color 0.2s ease;
}

.ip-bell:hover {
  color: #0073aa;
}

.ip-bell::after {
  content: '2';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.data-entry .ip-bell::after {
  content: '3';
}

/* قائمة المستخدم المنسدلة */
.user-dropdown {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 25px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.user-trigger:hover,
.user-trigger.active {
  background: #f8f9fa;
  color: #1E746E;
}

.user-name {
  font-weight: 600;
  color: #333;
}

.dropdown-arrow {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s ease;
}

.user-trigger.active .dropdown-arrow {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: 100%;
  right: -25px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1001;
}

.user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
}

.user-menu-header .user-name {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.user-role {
  font-size: 13px;
  color: #666;
  background: #f8f9fa;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  text-decoration: none;
  color: #666;
  transition: all 0.2s ease;
  border-radius: 0 0 8px 8px;
}

.logout-link:hover {
  background: #f8f9fa;
  color: #dc3545;
}

.logout-icon {
  font-size: 16px;
}

/* الفوتر */
#site-footer,
.ip-custom-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  text-align: center;
  z-index: 9999;
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
}

/* إخفاء العناصر في صفحات تسجيل الدخول */
.page-id-investor_login .burger,
.page-id-investor_login .ip-header,
.page-id-investor_login .sidebar,
.page-id-data_entry_login .burger,
.page-id-data_entry_login .ip-header,
.page-id-data_entry_login .sidebar {
  display: none !important;
}

/* إخفاء عنوان الصفحة */
.entry-title {
  display: none;
}

/* الخط العام */
body, button, input, table {
  font-family: 'Alexandria', sans-serif !important;
}

/* padding للمحتوى لعدم التداخل مع الهيدر الثابت */
body {
  /*padding-top: 60px;*/
}

main#content {
    padding-top: 60px !important;
}
/* تعديل الموبايل */
@media (max-width: 768px) {
  .ip-header-right h2 {
    font-size: 14px;
  }
  
  .ip-header-right img {
    max-height: 32px;
  }
  
  .user-name,
  .dropdown-arrow {
    display: none;
  }
  
  .user-menu {
    right: auto;
    left: 0;
    top: 45px;
  }
}

@media (max-width: 480px) {
  .burger {
    width: 32px;
    height: 32px;
  }
  
  .burger span,
  .burger::before,
  .burger::after {
    width: 20px;
    height: 2.5px;
  }
}

.burger:hover , .button:focus {
  background-color: #EDF4F4  ;
  color: #1E746E;
  text-decoration: none;
}
button:focus {
  background-color: #EDF4F4 !important;
  color: #1E746E;
  text-decoration: none;
}

/*/////////الاشعارات ////////*/
/* أيقونة الإشعارات */
.ip-bell {
  position: relative;
  text-decoration: none;
  font-size: 18px;
  color: #444;
  transition: color 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.ip-bell:hover {
  color: #1E746E;
  background: #f0f9f8;
}

.ip-bell::after {
  content: attr(data-count);
  position: absolute;
  top: 2px;
  right: 2px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  padding: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* إخفاء الدائرة عند عدم وجود إشعارات */
.ip-bell.no-notifications::after {
  display: none;
}

/* Dropdown الإشعارات */
.notifications-dropdown {
  position: relative;
  margin-right: 10px;
}

.notifications-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  width: 380px;
  max-height: 500px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s ease;
  z-index: 10000;
  overflow: hidden;
  direction: rtl;
}

.notifications-popup::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: white;
  border-top: 1px solid #e0e0e0;
  border-left: 1px solid #e0e0e0;
  transform: translateX(-50%) rotate(45deg);
}

.notifications-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* رأس الـ Dropdown */
.notifications-popup-header {
  padding: 16px 18px;
  border-bottom: 2px solid #1E746E;
  background: linear-gradient(135deg, #f8fcfb 0%, #ffffff 100%);
}

.notifications-popup-header h3 {
  margin: 0;
  font-size: 17px;
  color: #1E746E;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-count-badge {
  background: #dc3545;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* قائمة الإشعارات في الـ Dropdown */
.notifications-popup-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

/* إشعار واحد في الـ Dropdown */
.notification-item {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 6px;
  position: relative;
}

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

.notification-item:hover {
  background: #f8f9fa;
  transform: translateX(-2px);
}

/* إشعار غير مقروء */
.notification-item.unread {
  background: #ffffff;
  border-right: 3px solid #1E746E;
  box-shadow: 0 2px 4px rgba(30, 116, 110, 0.08);
}

/* إشعار مقروء */
.notification-item.read {
  background: #fafafa;
  opacity: 0.85;
}

.notification-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.notification-item-sender {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.notification-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.notification-item-icon.admin {
  background: linear-gradient(135deg, #1E746E, #2a9d8f);
  color: white;
}

.notification-item-icon.automatic {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.notification-item-time {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

.notification-item-message {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item.unread .notification-item-message {
  color: #222;
  font-weight: 500;
}

.notification-item-project {
  font-size: 11px;
  color: #1E746E;
  font-weight: 600;
}

/* مؤشر غير مقروء */
.notification-unread-dot {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #dc3545;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1.2);
  }
}

/* أزرار التحكم في الـ Footer */
.notifications-popup-footer {
  padding: 12px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  background: #fafafa;
}

.notification-action-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-family: 'Alexandria', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-mark-all-read {
  background: #1E746E;
  color: white;
}

.btn-mark-all-read:hover {
  background: #155a56;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(30, 116, 110, 0.3);
}

.btn-view-all {
  background: white;
  color: #1E746E;
  border: 2px solid #1E746E;
}

.btn-view-all:hover {
  background: #1E746E;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(30, 116, 110, 0.2);
}

/* حالة فارغة */
.notifications-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.notifications-empty-state svg {
  width: 50px;
  height: 50px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.notifications-empty-state p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Loading */
.notifications-loading {
  padding: 30px;
  text-align: center;
}

.notifications-loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1E746E;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Scrollbar styling */
.notifications-popup-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-popup-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.notifications-popup-list::-webkit-scrollbar-thumb {
  background: #1E746E;
  border-radius: 10px;
}

.notifications-popup-list::-webkit-scrollbar-thumb:hover {
  background: #155a56;
}

/* Responsive */
@media (max-width: 768px) {
  .notifications-popup {
    width: 320px;
    left: auto;
    right: -18rem;
    transform: none;
  }
  
  .notifications-popup.show {
    transform: none;
  }
  
  .notifications-popup::before {
    left: auto;
    right: 20px;
    transform: rotate(45deg);
  }
  
  .notification-action-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .notifications-popup {
    width: 90vw;
    max-width: 320px;
     right: -13rem;
  }
}
 /* ✅ زر واتساب */
.whatsapp-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-family: 'Alexandria', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
  background: linear-gradient(135deg, #128C7E, #075E54);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  color: white;
}

.whatsapp-btn svg {
  flex-shrink: 0;
}

/* للموبايل - إخفاء النص وعرض الأيقونة فقط */
@media (max-width: 768px) {
  .whatsapp-text {
    display: none;
  }
  
  .whatsapp-btn {
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .whatsapp-btn {
    width: 36px;
    height: 36px;
  }
}