/*
 * ╔═══════════════════════════════════════════════════════════════╗
 * ║              STAFF CARDS - CLEANED & COMPLIANT                ║
 * ║                  بطاقات الكادر - منظف 100%                  ║
 * ╚═══════════════════════════════════════════════════════════════╝
 * 
 * ✅ متوافق مع دستور التصميم
 * ✅ يعتمد على متغيرات tokens.css
 * ✅ يعمل مع جميع الثيمات الأربعة
 * ✅ تطابق بصري 1:1 مع النسخة السابقة
 * 
 * آخر تحديث: 2026-01-16
 */

#staff-section .unified-filter-btn.active {
  color: var(--text-white);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

#staff-section .unified-filter-btn.active i {
  color: var(--text-white);
}

@media (hover: hover) {
  #staff-section .unified-filter-btn:not(.active):hover {
    background-color: rgba(var(--black-rgb), 0.03);
  }
}

/* بطاقة المعلم الجديدة - مع جميع التأثيرات من بطاقات الطلاب */
.staff-card-modal {
  position: relative;
  margin: 10px 0 30px 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
  border-radius: 20px;
  box-shadow: 0 8px 25px var(--shadow-1);
  overflow: hidden;
  width: 100%;
  max-width: 350px;
  min-height: 420px;
  transition:
    transform 0.38s cubic-bezier(0.33, 1, 0.32, 1),
    box-shadow 0.38s cubic-bezier(0.33, 1, 0.32, 1),
    background 0.38s ease,
    border-color 0.38s ease;
}

/* تأثير hover خفيف — معاينة بطاقة الكادر */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .staff-card-modal:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 34px rgba(var(--black-rgb), 0.12);
  }

  .staff-card-modal:hover::before {
    inset-inline-start: 100%;
  }

  .staff-card-modal:hover .profile-avatar {
    transform: translateX(-50%) scale(1.02);
    border-color: rgba(var(--primary-color-rgb), 0.45);
  }

  .staff-card-modal:hover .profile-name {
    color: var(--primary-color);
  }
}

/* تأثير اللمعة المتحركة — inset-inline للـ RTL */
.staff-card-modal::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(var(--white-rgb), 0.3),
      transparent);
  transition: inset-inline-start 0.6s ease;
  z-index: 1;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .staff-card-modal::before {
    display: none;
  }
}

/* ضمان ظهور المحتوى فوق تأثير اللمعة */
.staff-card-modal .profile-header,
.staff-card-modal .profile-name,
.staff-card-modal .profile-desc,
.staff-card-modal .card-footer-btn {
  position: relative;
  z-index: 2;
}

/* تأثير تكبير الصورة عند الهوفر */
.profile-avatar {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

/* مساحة ثابتة لشارة الإجادة */
.ejada-space {
  min-height: 35px;
  /* ارتفاع ثابت */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.ejada-placeholder {
  height: 25px;
  /* نفس ارتفاع شارة الإجادة */
  display: block;
}

/* الشريط السفلي - متجاوب مع الثيمات الأربعة */
.card-footer-btn {
  background: var(--primary-color);
  color: var(--text-white);
  border-top: 1px solid rgba(var(--primary-color-rgb), 0.1);
  padding: 15px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: 'Tajawal', sans-serif;
  margin-top: auto;
  border-radius: 0 0 20px 20px;
  transition: background 0.3s ease, transform 0.3s ease;
  will-change: transform;
}

@media (hover: hover) {
  .card-footer-btn:hover {
    background: var(--secondary-color);
    color: var(--text-white);
    filter: brightness(1.1);
  }
}

.card-footer-btn i {
  font-size: 0.9rem;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card-footer-btn:hover i {
    transform: translateX(-5px);
  }
}

/* ========== قسم الهيرو - تصميم نظيف ========== */
.page-hero {
  padding: var(--hero-padding-desktop);
  position: relative;
  overflow: visible;
  min-height: var(--hero-min-height-desktop);
  display: flex;
  align-items: center;
  background: transparent;
}

.page-hero .hero-content {
  position: relative;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}

.page-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-color);
  color: var(--text-white);
  padding: var(--hero-badge-padding);
  border-radius: var(--hero-badge-radius);
  font-size: var(--hero-badge-font-size);
  font-weight: var(--hero-badge-font-weight);
  margin-bottom: var(--hero-badge-margin-bottom);
  box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
  backdrop-filter: blur(10px);
}

.page-hero .hero-badge i {
  font-size: 1.1rem;
}

.page-hero .hero-title {
  font-size: var(--hero-title-font-size);
  font-weight: var(--hero-title-font-weight);
  color: var(--text-primary);
  margin-bottom: var(--hero-title-margin-bottom);
  line-height: var(--hero-title-line-height);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(var(--black-rgb), 0.1);
}

.page-hero .hero-subtitle {
  font-size: var(--hero-subtitle-font-size);
  color: var(--text-secondary);
  line-height: var(--hero-subtitle-line-height);
  max-width: var(--hero-subtitle-max-width);
  margin: 0 auto;
  font-weight: var(--hero-subtitle-font-weight);
  opacity: 0.9;
}

/* ========== استجابة الهيرو للموبايل ========== */
@media (max-width: 768px) {
  .page-hero {
    padding: var(--hero-padding-tablet);
    min-height: var(--hero-min-height-tablet);
  }

  .page-hero .hero-content {
    padding: 0 15px;
  }

  .page-hero .hero-badge {
    font-size: var(--hero-badge-font-size-tablet);
    padding: var(--hero-badge-padding-tablet);
    margin-bottom: var(--hero-badge-margin-bottom-tablet);
  }

  .page-hero .hero-title {
    font-size: var(--hero-title-font-size-tablet);
    margin-bottom: var(--hero-title-margin-bottom-tablet);
  }

  .page-hero .hero-subtitle {
    font-size: var(--hero-subtitle-font-size-tablet);
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .page-hero {
    padding: var(--hero-padding-mobile);
    min-height: var(--hero-min-height-mobile);
  }

  .page-hero .hero-content {
    padding: 0 10px;
  }

  .page-hero .hero-badge {
    font-size: var(--hero-badge-font-size-mobile);
    padding: var(--hero-badge-padding-mobile);
    margin-bottom: var(--hero-badge-margin-bottom-mobile);
  }

  .page-hero .hero-title {
    font-size: var(--hero-title-font-size-mobile);
    margin-bottom: var(--hero-title-margin-bottom-mobile);
    line-height: 1.2;
  }

  .page-hero .hero-subtitle {
    font-size: var(--hero-subtitle-font-size-mobile);
    max-width: 95%;
    line-height: 1.6;
  }
}



/* خلفية الصفحة */
body {
  background-color: var(--bg-color);
  font-family: 'Tajawal', sans-serif;
}

/* الحاوي الرئيسي */
.layout__wrapper {
  margin: auto;
  max-width: 1200px;
  width: 100%;
  padding: 0 20px;
}

/* القسم الرئيسي */
.section {
  padding: 60px 0;
}

.section__title {
  color: var(--text-primary);
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 3rem 0;
  text-align: center;
}

/* عنوان القسم المحسن */
.layout__wrapper .section-header {
  text-align: center;
  margin: 10px 0 30px 0;
}

.layout__wrapper .section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 15px;
  position: relative;
}

.layout__wrapper .section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.layout__wrapper .section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: min(500px, 100%);
  margin-inline: auto;
  line-height: 1.5;
}

/* عناوين قسم الكادر — نصوص مرنة + حد أقصى آمن للشاشات الضيقة */
#staff-section .layout__wrapper .section-title {
  font-size: clamp(1.35rem, 2.8vw + 0.85rem, 2.2rem);
}

#staff-section .layout__wrapper .section-subtitle {
  font-size: clamp(0.9rem, 1vw + 0.8rem, 1.1rem);
}

/* شبكة البطاقات - مطابقة للنموذج الأصلي */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* تم حذف أنماط .gallery--grid القديمة غير المستخدمة */

/* شبكة البطاقات الجديدة - مطابقة لشبكة الطلاب */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
  z-index: 2;
  padding: 2rem 1rem;
  justify-items: center;
}

/* تحسينات إضافية للاستجابة - مطابقة للطلاب */
@media (max-width: 1400px) {
  .staff-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
  }
}

@media (max-width: 1200px) {
  .staff-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.6rem;
  }
}

/* Tablet 992px: شبكة عمودين + شريط فلاتر عمودي (قبل الانتقال المفاجئ عند الموبايل) */
@media (max-width: 992px) {
  .staff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 12px;
  }

  #staff-section .unified-filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 15px 18px;
    margin: 22px 12px;
  }

  #staff-section .unified-filters-bar .oval-select-wrapper {
    width: 100%;
    min-width: auto !important;
    max-width: none !important;
  }

  #staff-section .unified-filter-btn {
    justify-content: center;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .staff-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 10px;
  }
}

/* الاستجابة للبطاقات الجديدة */
@media (max-width: 768px) {
  /* عمود واحد حتى 768px — يتماشى مع شبكة الطلاب */
  .staff-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem 12px;
    justify-items: stretch;
  }

  .staff-card-modal {
    min-height: 350px;
  }

  .card-footer-btn {
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  .ejada-space {
    min-height: 30px;
  }
}

@media (max-width: 480px) {
  .staff-card-modal {
    min-height: 320px;
  }

  .card-footer-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .ejada-space {
    min-height: 25px;
  }

  .ejada-placeholder {
    height: 20px;
  }
}

/* تم حذف جميع أنماط card__ القديمة غير المستخدمة */

.button {
  background-color: var(--ink-900);
  border: 1px solid var(--ink-900);
  box-shadow: 0 4px 0 var(--ink-900);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-white);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: .1rem;
  padding: .8rem 1.8rem;
  text-decoration: none;
  display: inline-block;
  position: relative;
  z-index: 6;
}

.button--primary {
  background: linear-gradient(135deg, var(--neutral-500) 0%, var(--neutral-600) 100%);
  border-color: var(--neutral-700);
  box-shadow: 0 6px 0 var(--neutral-800);
}


.button--secondary {
  position: absolute;
  inset-inline-end: 40px;
  top: 0;
  background: linear-gradient(135deg, rgba(var(--staff-pink-500-rgb), 0.1) 0%, rgba(var(--staff-pink-500-rgb), 0.2) 100%);
  border: 2px solid rgba(var(--staff-pink-500-rgb), 0.3);
  box-shadow: none;
  padding: .8rem;
  color: var(--staff-pink-500);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}


/* أيقونات المواد - سيتم استخدامها في JavaScript */

/* ========== نظام الفلترة المتقدم ========== */
.advanced-filters {
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 20px 0 40px 0;
}

/* شريط البحث البيضاوي - تم نقله إلى search-box-oval.css */

/* الفلاتر الموحدة - سطر واحد */
.unified-filters-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(var(--primary-color-rgb), 0.02);
  border-radius: 25px;
  padding: 15px 20px;
  margin: 25px 0;
  box-shadow: 0 4px 20px rgba(var(--black-rgb), 0.06);
  border: 1px solid rgba(var(--primary-color-rgb), 0.08);
}

.clear-search {
  position: absolute;
  inset-inline-start: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-soft-bg);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.3s ease, transform 0.3s ease;
}

.clear-search:hover {
  background: var(--accent-color);
  color: var(--text-white);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px var(--accent-shadow-soft);
}

.search-box.has-text .clear-search {
  display: flex;
}

/* تم حذف أنماط card__heart-btn القديمة */

/* تم حذف أنماط card__details-btn القديمة */

/* تم حذف card__details-btn i */

/* ========== وسام إجادة ========== */
.ejada-badge {
  position: absolute;
  bottom: 60px;
  inset-inline-end: 20px;
  z-index: 4;
}

.ejada-medal {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--ejada-gold-1), var(--ejada-gold-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 1.2rem;
  box-shadow: 0 4px 15px var(--ejada-gold-shadow);
  border: 3px solid rgba(var(--white-rgb), 0.9);
  cursor: pointer;
  position: relative;
}

.ejada-medal::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, var(--ejada-gold-3), var(--ejada-gold-1));
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
}


/* شارة إجادة في المودال */
.ejada-modal-badge {
  background: linear-gradient(135deg, var(--ejada-gold-1), var(--ejada-gold-2));
  box-shadow: 0 4px 12px var(--ejada-gold-shadow);
}

/* الاستجابة للموبايل */
@media (max-width: 768px) {
  .ejada-medal {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    bottom: 55px;
    inset-inline-end: 15px;
  }
}

@media (max-width: 480px) {
  .ejada-medal {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
    bottom: 50px;
    inset-inline-end: 12px;
  }
}

/* ========== مودال تفاصيل المعلمة المحدث ========== */
.modal {
  display: flex;
  position: fixed;
  z-index: 99999;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background-color: rgba(var(--black-rgb), 0.6);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
}

/* حماية الفوتر من التأثر بالمودال */
.main-footer {
  position: relative;
  z-index: 1;
}

/* سيتم التحكم في منع التمرير عبر JavaScript */

/* ========== زر عرض المزيد ========== */
.load-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 1rem 0;
  padding: 1rem;
}

.load-more-btn {
  position: relative;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 50px;
  padding: 1rem 2.5rem;
  color: var(--text-white);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
  overflow: hidden;
  min-width: 200px;
}



.load-more-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.load-more-content i {
  font-size: 1.2rem;
}


.load-more-progress {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-inline-end: 0.5rem;
}

.load-more-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.load-more-btn.loading .load-more-content {
  opacity: 0;
}

.load-more-btn.loading .load-more-animation {
  opacity: 1;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-0);
}




/* تأثير الضوء المتحرك */
.load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--white-rgb), 0.2), transparent);
}

@media (prefers-reduced-motion: reduce) {
  .load-more-btn::before {
    display: none;
  }
}


/* الاستجابة للموبايل */
@media (max-width: 768px) {
  .load-more-container {
    margin: 1.5rem 0 0.5rem 0;
    padding: 0.5rem;
  }

  .load-more-btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    min-width: 180px;
  }
}

/* بطاقة البروفايل الجديدة */
.profile-card {
  position: relative;
  background: var(--surface-0);
  margin: 2vh auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  height: auto;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(var(--black-rgb), 0.2);
  transform: scale(0.8);
  opacity: 0;
}

.modal.modal-show {
  opacity: 1;
  visibility: visible;
}

.modal.modal-show .profile-card {
  transform: scale(1);
  opacity: 1;
}

/* فرض ظهور البطاقات داخل الشبكة (بدون المودال) */
#staffGrid .profile-card {
  transform: scale(1);
  opacity: 1;
}

/* رأس البطاقة مع الصورة - متجاوب مع الثيمات */
.profile-header {
  position: relative;
  width: 100%;
  height: 100px;
  background: var(--primary-color);
  /* يتغير مع الثيم */
  /* انتقال سلس عند تغيير الثيم */
}

.profile-header::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: inherit;
  transform: skewY(4deg);
  transform-origin: 0 100%;
  /* انتقال سلس للشكل المائل أيضاً */
}

/* تم إزالة تأثير hover للرأس */

.profile-avatar {
  position: absolute;
  left: 50%;
  top: 50px;
  transform: translateX(-50%);
  transform-origin: center center;
  z-index: 5;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--placeholder-bg);
  border: 4px solid var(--surface-0);
}

.profile-avatar img,
.profile-avatar .modal-avatar-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

/* اسم المعلمة — مساحة تحت النص لخط ::after (متسق مع صفحة الطلاب) */
.profile-name {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 90px 0 18px;
  padding-bottom: 0.85rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-strong);
  transition: color 0.4s ease;
}

.profile-name::after {
  content: '';
  position: absolute;
  bottom: 0.35rem;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: 30px;
  max-width: 100%;
  height: 2px;
  background: var(--border-color-dark, var(--slate-500));
}

@media (max-width: 768px) {
  .profile-name {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .profile-name::after {
    bottom: 0.45rem;
  }
}

@media (max-width: 480px) {
  .profile-name {
    padding-bottom: 1.1rem;
    margin-bottom: 1.05rem;
  }

  .profile-name::after {
    bottom: 0.5rem;
  }
}

/* وصف المعلمة */
.profile-desc {
  padding: 0 1rem 1rem;
  text-align: center;
  line-height: 1.5;
  color: var(--text-secondary);
}

.profile-position {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 5px;
}

.profile-department {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-light);
}

.profile-ejada {
  display: inline-block;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 5px;
  text-shadow: 0 0 4px rgba(var(--gold-rgb), 0.0);
  filter: drop-shadow(0 0 2px rgba(var(--gold-rgb), 0.2));
}

.profile-ejada i {
  color: var(--gold);
  margin-inline-start: 6px;
  font-size: 1.1rem;
  text-shadow: 0 0 4px rgba(var(--gold-rgb), 0.0);
  filter: drop-shadow(0 0 2px rgba(var(--gold-rgb), 0.2));
}

/* شارات المواد */
.profile-subjects {
  padding: 0 1rem 1rem;
  text-align: center;
}

.subject-badge {
  display: inline-block;
  background: var(--slate-500);
  color: var(--text-white);
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 4px;
}

/* تفاصيل المعلمة */
.profile-details {
  padding: 1rem 1.5rem 1.5rem;
  background: var(--surface-muted);
  margin: 0 1rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

.detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--surface-0);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(var(--black-rgb), 0.05);
}


.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item strong {
  color: var(--text-strong);
  font-weight: 600;
  margin-inline-end: 8px;
}

.detail-icon {
  color: var(--text-muted);
  font-size: 1rem;
  margin-inline-start: 12px;
  width: 20px;
  text-align: center;
}

/* أيقونة الإنجازات ذهبية */
.achievements-item .detail-icon {
  color: var(--ejada-gold-2);
}

/* أيقونات الأوسمة */
.achievement-icon {
  font-size: 1.1rem;
  margin: 0 4px;
}


/* ألوان الأوسمة */
.ejada-icon {
  color: var(--creative-gold);
  /* ذهبي مشع للإجادة */
  text-shadow: 0 0 4px rgba(var(--gold-rgb), 0.0);
  filter: drop-shadow(0 0 2px rgba(var(--gold-rgb), 0.0));
}

.trophy-icon {
  color: var(--ejada-gold-2);
  /* ذهبي هادئ للكؤوس */
}


/* فوتر البطاقة - متجاوب مع الثيمات */
.profile-footer {
  position: relative;
  padding: 1rem;
  background: var(--primary-color);
  /* يتغير مع الثيم - أولوية عالية */
  text-align: center;
  min-height: 20px;
  /* انتقال سلس عند تغيير الثيم */
}

/* تم حذف المثلث غير المبرر */

.profile-footer a {
  padding: 0 0.8rem;
  color: rgba(var(--white-rgb), 0.9);
  font-size: 1.2rem;
  text-decoration: none;
}



/* تعريف خاص للعنصر الذي يحمل كلا الكلاسين */
.profile-footer.card-footer-btn {
  background: var(--primary-color);
  /* أولوية عالية للثيم */
  padding: 15px 20px;
  /* نفس padding الـ card-footer-btn */
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: 'Tajawal', sans-serif;
  border-radius: 0 0 20px 20px;
  color: var(--text-white);
}


/* تأثيرات الأيقونة داخل الفوتر */
.profile-footer.card-footer-btn i {
  font-size: 0.9rem;
}


.close-modal {
  position: absolute;
  top: 15px;
  inset-inline-start: 20px;
  width: 35px;
  height: 35px;
  background: rgba(var(--white-rgb), 0.2);
  border: none;
  border-radius: 50%;
  color: var(--text-white);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}


/* رأس المودال */
.modal-staff-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  padding: 1.5rem;
  color: var(--text-white);
  flex-shrink: 0;
  text-align: center;
  position: relative;
}

/* منطقة المحتوى القابلة للتمرير */
.modal-staff-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.modal-staff-content::-webkit-scrollbar {
  width: 6px;
}

.modal-staff-content::-webkit-scrollbar-track {
  background: var(--surface-muted);
  border-radius: 10px;
}

.modal-staff-content::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}


.modal-staff-avatar {
  margin-bottom: 1rem;
}

.modal-staff-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(var(--white-rgb), 0.3);
}

.modal-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(var(--white-rgb), 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-white);
  margin: 0 auto;
  border: 4px solid rgba(var(--white-rgb), 0.3);
}

.modal-staff-basic-info h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-staff-position {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0.3rem;
}

.modal-staff-department {
  font-size: 1rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.modal-staff-experience {
  display: inline-block;
  background: rgba(var(--white-rgb), 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.ejada-count {
  color: var(--staff-ejada-count);
  font-weight: 600;
}

.experience-years {
  color: var(--text-white);
  font-weight: 500;
}

/* محتوى المودال */

.modal-staff-qualifications,
.modal-staff-contact {
  padding: 1rem 1.5rem;
  border-block-end: 1px solid var(--staff-border-light);
}

.modal-staff-qualifications h3,
.modal-staff-contact h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  color: var(--staff-gray-700);
  margin-bottom: 1rem;
}

.qualifications-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.qualification-badge {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.contact-item i {
  width: 20px;
  color: var(--primary-color);
  font-size: 1rem;
}

.contact-item span {
  color: var(--staff-gray-600);
  font-size: 0.95rem;
}

/* الاستجابة للموبايل */
@media (max-width: 768px) {
  .profile-card {
    width: 95%;
    max-width: 380px;
    /* عرض أكبر للهواتف */
    margin: 5vh auto;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
    transform: translateX(-50%);
  }

  .profile-avatar img,
  .profile-avatar .modal-avatar-placeholder {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }

  .profile-name {
    margin: 70px 0 16px;
    padding-bottom: 0.95rem;
    font-size: 1.3rem;
  }

  .profile-details {
    margin: 0 0.5rem 1rem;
    padding: 0.8rem 1rem 1rem;
  }

  .detail-item {
    font-size: 0.85rem;
    padding: 8px 10px;
    margin-bottom: 10px;
  }

  .detail-icon {
    margin-inline-start: 8px;
    font-size: 0.9rem;
  }

  .modal-staff-photo {
    width: 80px;
    height: 80px;
  }

  .modal-avatar-placeholder {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }

  .modal-staff-basic-info h2 {
    font-size: 1.5rem;
  }

  .modal-staff-qualifications,
  .modal-staff-contact {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  .profile-card {
    width: 98%;
    max-width: 340px;
    /* عرض أكبر للهواتف الصغيرة */
    margin: 3vh auto;
  }

  .profile-avatar {
    width: 90px;
    height: 90px;
    transform: translateX(-50%);
    top: 45px;
  }

  .profile-avatar img,
  .profile-avatar .modal-avatar-placeholder {
    width: 90px;
    height: 90px;
    font-size: 2.2rem;
  }

  .profile-name {
    margin: 65px 0 16px;
    padding-bottom: 1.05rem;
    font-size: 1.2rem;
  }

  .profile-details {
    margin: 0 0.3rem 0.8rem;
    padding: 0.6rem 0.8rem 0.8rem;
  }

  .detail-item {
    font-size: 0.8rem;
    padding: 6px 8px;
    margin-bottom: 8px;
  }

  .detail-icon {
    margin-inline-start: 6px;
    font-size: 0.85rem;
    width: 16px;
  }

  .modal-staff-photo {
    width: 70px;
    height: 70px;
  }

  .modal-avatar-placeholder {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .modal-staff-basic-info h2 {
    font-size: 1.3rem;
  }

  .modal-staff-qualifications,
  .modal-staff-contact {
    padding: 0.75rem 1rem;
  }
}

/* أقسام الفلترة */
.filter-section {
  margin-bottom: 30px;
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 15px;
}

.filter-title i {
  color: var(--primary-color);
}

/* ========== شريط الفلاتر الموحد ========== */
.unified-filters-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(var(--primary-color-rgb), 0.02);
  border-radius: 25px;
  padding: 15px 20px;
  margin: 25px 0;
  box-shadow: 0 4px 20px rgba(var(--black-rgb), 0.06);
  border: 1px solid rgba(var(--primary-color-rgb), 0.08);
}

/* ضمان ثبات القائمة المنسدلة */
.unified-filters-bar .oval-select-wrapper {
  flex: none;
  /* منع التمدد مع flex */
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

/* فلتر التخصصات — بدل الأنماط المضمّنة في index (RTL + touch) */
#staff-section #subjectFilterSection {
  position: relative;
  height: 42px;
  display: flex;
  align-items: center;
  min-width: min(200px, 100%);
  width: auto;
  padding: 0;
  box-sizing: border-box;
}

#staff-section #subjectSelectIcon {
  position: absolute;
  inset-inline-start: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  color: var(--primary-color);
  font-size: 0.9rem;
  opacity: 0.85;
}

#staff-section #subjectSelect {
  direction: rtl;
  height: 100%;
  width: 100%;
  padding-inline-start: 40px;
  padding-inline-end: 30px;
  padding-block: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-strong, #333) !important;
  font-weight: 700 !important;
  box-sizing: border-box;
}

/* أزرار الفلاتر الموحدة */
.unified-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-0);
  border: 1.5px solid rgba(var(--primary-color-rgb), 0.15);
  border-radius: 25px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  backdrop-filter: none;
  box-shadow: none;
  white-space: nowrap;
  min-height: 42px;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
  will-change: transform;
}

.unified-filter-btn i {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Hover for non-active buttons */
@media (hover: hover) {
  .unified-filter-btn:not(.active):hover {
    border-color: var(--cat-color, var(--primary-color));
    background: rgba(var(--primary-color-rgb), 0.05);
    box-shadow: none;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .unified-filter-btn:not(.active):hover {
    transform: translateY(-2px);
  }
}

/* الزر النشط - تنسيق قوي مع دعم الثيمات */
.unified-filters-bar .unified-filter-btn.active,
.unified-filter-btn.active {
  background: var(--primary-color);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
}

.unified-filters-bar .unified-filter-btn.active i,
.unified-filter-btn.active i {
  opacity: 1;
  color: var(--text-white);
}

.unified-filters-bar .unified-filter-btn.active span,
.unified-filter-btn.active span {
  color: var(--text-white);
}

/* القائمة المنسدلة البيضاوية */
.oval-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-0);
  border: 1.5px solid rgba(var(--primary-color-rgb), 0.15);
  border-radius: 25px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: none;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  flex-shrink: 0;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) {
  .oval-select-wrapper:hover {
    border-color: var(--primary-color);
    box-shadow: none;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .oval-select-wrapper:hover {
    transform: translateY(-2px);
  }
}

.oval-select-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: none;
}


.oval-select {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-strong);
  cursor: pointer;
  text-align: center;
  padding-block: 2px;
  padding-inline-start: 10px;
  padding-inline-end: 40px;
  /* مساحة لسهم القائمة (inline-end في RTL) */
  /* إزالة السهم الافتراضي */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* إخفاء السهم في IE */
  background-image: none;
  /* منع تمدد النص */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  /* منع التوسع */
  box-sizing: border-box;
  flex-shrink: 0;
}

/* في RTL: السهم على يسار الصندوق البصري = inline-end */
.oval-select-arrow {
  position: absolute;
  inset-inline-end: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

/* تحسين خيارات القائمة المنسدلة */
.oval-select option {
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-strong);
  background: var(--surface-0);
  border-bottom: 1px solid var(--staff-border-light);
  transition: background 0.2s ease, color 0.2s ease;
}

.oval-select option:hover {
  /* خلفية صلبة + نص داكن: القوائم الأصلية للمتصفح تتجاهل التدرجات أحياناً فيظهر نص أبيض على خلفية بيضاء */
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-dark);
}

.oval-select option:checked {
  background: rgba(var(--primary-color-rgb), 0.18);
  color: var(--primary-dark);
  font-weight: 700;
}

.oval-select option[value="all"] {
  color: var(--text-disabled);
  font-weight: 700;
  background: var(--surface-muted);
  font-size: 0.9rem;
}



/* زر إعادة التعيين الموحد */
#staff-section .unified-reset-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-color);
  border: none;
  color: var(--text-white);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
  will-change: transform;
  flex-shrink: 0;
  margin: 0;
  overflow: visible;
}

#staff-section .unified-reset-btn i {
  font-size: 1.1rem;
  transition: transform 0.4s ease;
  display: block;
  line-height: 1;
  color: var(--text-white);
  opacity: 1;
  -webkit-text-fill-color: var(--surface-0);
}

#staff-section .unified-reset-btn:hover {
  background: var(--accent-color-hover);
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.3);
}

#staff-section .unified-reset-btn.spinning {
  animation: resetSpin 0.5s ease-in-out;
}

@keyframes resetSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #staff-section .unified-reset-btn.spinning {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   وضع الهاتف ≤768px — الكادر المدمج (مطابق لنظام المجلة)
   ═══════════════════════════════════════════════════════════════ */

/* الديسكتوب: القائمة المدمجة مخفية */
@media (min-width: 769px) {
  #staff-section .staff-compact-category-filter {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* ── الحاوية: عمودية ومتمركزة مثل المجلة ── */
  #staff-section .unified-filters-bar {
    --staff-compact-width: min(100%, 420px);
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 15px 20px !important;
  }

  /* ── إخفاء الأزرار الثلاثة ── */
  #staff-section #btn-filter-teaching,
  #staff-section #btn-filter-admin,
  #staff-section #btn-filter-support {
    display: none !important;
  }

  /* ── عرض موحّد لجميع العناصر الأربعة ── */
  #staff-section .unified-filters-bar .unified-filter-btn[data-category="all"],
  #staff-section .staff-compact-category-filter,
  #staff-section #subjectFilterSection,
  #staff-section #staffResetFilters {
    width: var(--staff-compact-width) !important;
    max-width: var(--staff-compact-width) !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    min-height: 46px !important;
    height: 46px !important;
    box-sizing: border-box !important;
  }

  /* ── زر "الجميع": كبسولة، الأيقونة مثبّتة على البداية ── */
  #staff-section .unified-filters-bar .unified-filter-btn[data-category="all"] {
    position: relative !important;
    justify-content: center !important;
    border-radius: 999px !important;
    padding: 0 16px !important;
    margin: 0 !important;
  }

  #staff-section .unified-filters-bar .unified-filter-btn[data-category="all"] i {
    position: absolute !important;
    inset-inline-start: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    line-height: 1 !important;
  }

  #staff-section .unified-filters-bar .unified-filter-btn[data-category="all"] span {
    flex: 1 !important;
    text-align: center !important;
  }

  /* ── القائمة المدمجة: إظهار وتنسيق ── */
  #staff-section .staff-compact-category-filter {
    display: flex !important;
    padding: 0 !important;
    border-radius: 999px !important;
    overflow: visible !important;
  }

  /* تمركز أيقونة "جميع الأقسام" بشكل ثابت مثل المجلة */
  #staff-section .staff-compact-category-filter .oval-select-icon {
    position: absolute;
    inset-inline-start: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
    color: var(--primary-color);
    font-size: 0.9rem;
    opacity: 0.85;
  }

  /* ── قائمة التخصصات: تصحيح ارتفاع وشكل ── */
  #staff-section #subjectFilterSection {
    border-radius: 999px !important;
    padding: 0 !important;
  }

  /* ── إخفاء السهم في كلا القائمتين ── */
  #staff-section .staff-compact-category-filter .oval-select-arrow,
  #staff-section #subjectFilterSection .oval-select-arrow {
    display: none !important;
  }

  /* ── توسيط النص ومنع تكبير iOS ── */
  #staff-section .staff-compact-category-filter .oval-select,
  #staff-section #subjectFilterSection .oval-select {
    -webkit-appearance: none;
    appearance: none;
    font-size: max(0.9rem, 16px) !important;
    /* 42px يمين للأيقونة (RTL inline-start) ، 16px يسار */
    padding: 0 42px 0 16px !important;
    text-align-last: center !important;
    text-align: center !important;
    -webkit-text-align-last: center !important;
    direction: rtl !important;
    min-height: 46px !important;
    height: 100% !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* ── زر إعادة التعيين: مستطيل مدوّر مع نص ── */
  #staff-section #staffResetFilters {
    border-radius: 14px !important;
    aspect-ratio: auto !important;
    padding-inline: 16px !important;
    padding-block: 0 !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  #staff-section #staffResetFilters::after {
    content: "إعادة التعيين";
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
  }

  /* ── الدوران: الأيقونة فقط لا الزر كله ── */
  #staff-section #staffResetFilters.spinning {
    animation: none !important;
  }

  #staff-section #staffResetFilters.spinning i {
    animation: staffResetIconSpin 0.5s ease-in-out;
    transform-origin: center center;
  }
}

@keyframes staffResetIconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (max-width: 400px) {
  #staff-section .unified-filters-bar {
    --staff-compact-width: min(100%, 100%);
    padding: 12px 15px !important;
  }

  #staff-section #staffResetFilters {
    border-radius: 12px !important;
  }

  #staff-section #staffResetFilters::after {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #staff-section #staffResetFilters.spinning i {
    animation: none !important;
  }
}

/* عداد النتائج في شريط الفلاتر */
.unified-results-count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin: 0 auto;
  /* توسيط الكبسولة */
  /* مساحة ثابتة لمنع تأثير النص على العناصر الأخرى */
  min-width: 180px;
  width: 180px;
  max-width: 180px;
  justify-content: center;
  /* توسيط المحتوى داخل الكبسولة */
  flex-shrink: 0;
  /* منع الانكماش */
  text-align: center;
  /* توسيط النص */
}

.unified-results-count::before {
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  content: '\f0c0';
  /* أيقونة المجموعة/الأشخاص */
  color: var(--primary-color);
  font-size: 0.85rem;
  margin-inline-start: 4px;
}

.advanced-search-container::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(var(--primary-color-rgb), 0.3),
      transparent);
}

.advanced-search-container::after {
  content: '';
  position: absolute;
  top: 10px;
  inset-inline-end: 20px;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.3;
}

/* ========== قسم البحث الرئيسي ========== */
.search-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.elegant-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-0);
  border: 2px solid rgba(var(--primary-color-rgb), 0.12);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 2px 12px rgba(var(--black-rgb), 0.04);
  min-width: 300px;
}


.elegant-search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
}

.search-icon {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin: 0 15px;
  opacity: 0.7;
}

.elegant-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 10px 16px 0;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-strong);
  background: transparent;
  text-align: right;
}

.elegant-search-input::placeholder {
  color: var(--text-disabled);
  font-weight: 400;
}

.clear-search {
  background: rgba(var(--primary-color-rgb), 0.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  cursor: pointer;
  margin-inline-end: 10px;
}


.search-results-info {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.08);
  padding: 12px 18px;
  border-radius: 12px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-results-info::before {
  content: '📊';
  font-size: 1rem;
}

/* ========== شريط الفلاتر المتقدمة ========== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 0 0 0;
  border-top: 1px solid rgba(var(--primary-color-rgb), 0.08);
}

.filters-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  opacity: 0.8;
  min-width: fit-content;
}

.filters-label i {
  font-size: 0.9rem;
}

/* أزرار الأقسام */
.category-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--staff-gray-600);
  background: var(--surface-0);
  border: 1.5px solid rgba(var(--primary-color-rgb), 0.15);
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.category-btn i {
  font-size: 0.85rem;
  opacity: 0.8;
}


.category-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-white);
  box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.25);
}

.category-btn.active i {
  opacity: 1;
}

/* القائمة المنسدلة للمواد */
.subject-filter-wrapper {
  flex: 1;
  min-width: 180px;
  max-width: 250px;
}

.elegant-select-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-0);
  border: 1.5px solid rgba(var(--primary-color-rgb), 0.15);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}


.elegant-select-box i:first-child {
  color: var(--primary-color);
  font-size: 0.85rem;
  margin-left: 8px;
  opacity: 0.7;
}

.elegant-select {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--staff-gray-600);
  cursor: pointer;
  text-align: right;
  padding: 0 8px;
}

.elegant-select-box i:last-child {
  color: var(--primary-color);
  font-size: 0.75rem;
  opacity: 0.6;
}


/* زر إعادة التعيين */
.reset-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-white);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-hover));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(var(--accent-color-rgb), 0.2);
  white-space: nowrap;
}



.reset-btn i {
  font-size: 0.8rem;
}

.filters-title i {
  font-size: 1.3rem;
}

/* شريط الأدوات - صف واحد */
.filters-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.toolbar-section {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* الفاصل البصري */
.toolbar-divider {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg,
      rgba(var(--primary-color-rgb), 0.1),
      rgba(var(--primary-color-rgb), 0.3),
      rgba(var(--primary-color-rgb), 0.1));
  border-radius: 1px;
}

/* أزرار الفلترة المودرن */
.modern-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--staff-gray-600);
  background: var(--surface-0);
  border: 2px solid rgba(var(--primary-color-rgb), 0.15);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.modern-filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      var(--primary-color),
      var(--secondary-color));
  opacity: 0;
}

.modern-filter-btn i,
.modern-filter-btn span {
  position: relative;
  z-index: 1;
}


.modern-filter-btn.active {
  background: linear-gradient(135deg,
      var(--primary-color),
      var(--secondary-color));
  border-color: transparent;
  color: var(--text-white);
  box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.35);
}

.modern-filter-btn.active::before {
  opacity: 1;
}

/* القائمة المنسدلة المودرن */
.toolbar-select {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.modern-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-0);
  border: 2px solid rgba(var(--primary-color-rgb), 0.15);
  border-radius: 10px;
  padding: 10px 15px;
}


.select-icon {
  color: var(--primary-color);
  font-size: 1rem;
  margin-inline-start: 10px;
}

.modern-select {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--staff-gray-600);
  cursor: pointer;
  text-align: right;
  padding-inline-start: 25px;
}

.modern-select-wrapper .select-arrow {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--primary-color);
  font-size: 0.85rem;
  pointer-events: none;
}


/* زر إعادة التعيين المودرن */
.modern-reset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-white);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-hover));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.25);
}



/* عداد النتائج */
.results-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.results-count::before {
  content: '📊';
  font-size: 1.1rem;
}

/* القائمة المنسدلة المخصصة */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.custom-select {
  width: 100%;
  padding: 14px 45px 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  color: var(--primary-color);
  background: linear-gradient(135deg,
      rgba(var(--primary-color-rgb), 0.05) 0%,
      rgba(var(--secondary-color-rgb), 0.05) 100%);
  border: 2px solid rgba(var(--primary-color-rgb), 0.2);
  border-radius: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: right;
  direction: rtl;
  position: relative;
  box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.05);
}


.custom-select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--surface-0);
  box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
}

.select-arrow {
  position: absolute;
  inset-inline-end: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 0.9rem;
  pointer-events: none;
}


/* تحسين تصميم الخيارات */
.custom-select option {
  padding: 12px;
  background: var(--surface-0);
  color: var(--staff-gray-700);
  font-weight: 600;
}

/* تأثير إخفاء/إظهار فلتر المواد */
#subjectFilterSection {
  transform-origin: top;
}

#subjectFilterSection.hidden {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  transform: scaleY(0);
}

/* تحسين عنوان الفلتر */
.filter-title {
  position: relative;
  padding-bottom: 10px;
}

.filter-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}


/* معلومات النتائج وإعادة التعيين */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px 20px;
  background: rgba(var(--primary-color-rgb), 0.03);
  border-radius: 12px;
  border: 1px solid rgba(var(--primary-color-rgb), 0.08);
}

.results-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.results-count::before {
  content: '📊';
  font-size: 1rem;
}

.reset-filters {
  background: rgba(var(--secondary-color-rgb), 0.1);
  color: var(--secondary-color);
  border: 1px solid rgba(var(--secondary-color-rgb), 0.2);
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}


.filter-btn {
  background: var(--card-bg);
  border: 2px solid rgba(var(--black-rgb), 0.12);
  border-radius: 30px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(var(--black-rgb), 0.05);
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--white-rgb), 0.4), transparent);
}


.filter-btn.active {
  background: linear-gradient(135deg, var(--staff-peach-200) 10%, var(--staff-pink-500) 100%);
  border-color: var(--staff-pink-500);
  color: var(--card-bg);
  box-shadow: 0 8px 30px rgba(var(--staff-pink-500-rgb), 0.4);
}

/* الإحصائيات */
.family-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
  padding: 30px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px rgba(var(--black-rgb), 0.08);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: center;
  justify-content: center;
}

.stat-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--staff-sky-200) 0%, var(--staff-lilac-200) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--card-bg);
}

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

.stat-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* رسالة عدم وجود نتائج */
.no-staff-results {
  text-align: center;
  padding: 80px 20px;
  background: rgba(var(--white-rgb), 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(var(--primary-color-rgb), 0.1);
  margin: 40px 0;
}

.no-results-icon {
  font-size: 5rem;
  color: rgba(var(--primary-color-rgb), 0.3);
  margin-bottom: 30px;
}


.no-staff-results h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--staff-slate-900);
  font-weight: 700;
}

.no-staff-results p {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 30px;
  color: var(--staff-gray-500);
}

.try-again-btn {
  background: var(--primary-color);
  color: var(--text-white);
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}


/* تحسينات الموبايل */
@media (max-width: 768px) {
  /* شريط البحث - تم نقله إلى search-box-oval.css */

  .clear-search {
    inset-inline-start: 16px;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(var(--primary-color-rgb), 0.1);
  }

  /* شريط الفلاتر الموحد - موبايل */
  .unified-filters-bar {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    margin: 20px 15px;
  }

  /* أزرار الفلاتر محسنة للموبايل */
  .unified-filter-btn {
    font-size: 1rem;
    padding: 14px 20px;
    min-width: 140px;
    min-height: 48px;
    /* ارتفاع مناسب للمس */
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
  }


  .unified-filter-btn.active {
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
  }

  /* القائمة المنسدلة محسنة للموبايل */
  @media (max-width: 768px) {
    #staff-section .oval-select-wrapper {
      width: 100%;
      min-width: auto;
      max-width: none;
      justify-content: center;
      margin: 8px 0;
      border-radius: 12px;
      /* توحيد مع الأزرار */
      padding: 0;
      /* بدون padding إضافي */
      box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
      /* نفس ظل الأزرار */
      border: 2px solid rgba(var(--primary-color-rgb), 0.15);
      background: var(--surface-0);
      min-height: 48px;
      /* نفس ارتفاع الأزرار */
      display: flex;
      align-items: center;
    }

    #staff-section .oval-select {
      font-size: 1rem;
      /* نفس حجم خط الأزرار */
      text-align: center;
      width: 100%;
      height: 48px;
      /* نفس ارتفاع الأزرار */
      padding-inline-start: 30px;
      padding-inline-end: 20px;
      padding-block: 0;
      /* مساحة للأيقونة والسهم — منطقي للـ RTL */
      border-radius: 12px;
      /* نفس حدود الحاوي */
      box-shadow: none;
      border: none;
      background: transparent;
      line-height: 48px;
      /* توسيط النص عمودياً */
      font-weight: 600;
      /* نفس وزن خط الأزرار */
    }

    /* السهم في الموبايل */
    #staff-section .oval-select-arrow {
      inset-inline-end: 15px;
      font-size: 0.9rem;
      top: 50%;
      transform: translateY(-50%);
    }

    /* تأثيرات hover متوافقة مع الأزرار */


    /* تأثير عند فتح القائمة - موبايل عادي */
    #staff-section .oval-select:focus {
      outline: none;
    }

  }

  /* زر إعادة التعيين محسن */
  .unified-reset-btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 14px 20px;
    min-height: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
    margin: 8px 0;
  }


  /* عداد النتائج محسن للموبايل */
  @media (max-width: 768px) {
    #staff-section .unified-results-count {
      font-size: 0.9rem;
      margin: 12px auto;
      /* توسيط الكبسولة نفسها */
      min-width: 200px;
      /* عرض أكبر للنص العربي */
      width: auto;
      /* عرض تلقائي */
      max-width: 100%;
      /* عرض كامل إذا لزم الأمر */
      padding: 10px 16px;
      /* padding أكبر */
      background: rgba(var(--primary-color-rgb), 0.1);
      border-radius: 8px;
      text-align: center;
      /* توسيط النص داخل الكبسولة */
      white-space: nowrap;
      /* منع كسر السطر */
      overflow: hidden;
      /* إخفاء النص الزائد */
      text-overflow: ellipsis;
      /* نقاط في النهاية إذا لزم */
      display: block;
      /* عرض كعنصر block */
    }
  }

  /* تحسينات الموبايل الصغير */
  @media (max-width: 480px) {
    /* شريط البحث - تم نقله إلى search-box-oval.css */

    .clear-search {
      inset-inline-start: 14px;
      width: 28px;
      height: 28px;
      font-size: 0.85rem;
    }

    /* شريط الفلاتر للموبايل الصغير */
    @media (max-width: 480px) {
      .unified-filters-bar {
        margin: 15px 10px;
        padding: 12px;
        gap: 10px;
        flex-direction: column;
        /* عمودي للموبايل */
        align-items: stretch;
        /* تمدد كامل */
      }

      /* إزالة أي حدود أو خلفيات مضاعفة */
      #staff-section .oval-select-wrapper {
        box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
        /* ظل واحد فقط */
        border: 2px solid rgba(var(--primary-color-rgb), 0.15);
        background: var(--surface-0);
      }
    }

    /* أزرار الفلاتر محسنة للموبايل الصغير */
    .unified-filter-btn {
      font-size: 0.9rem;
      padding: 12px 16px;
      min-width: 120px;
      min-height: 44px;
      /* ارتفاع مناسب للمس */
      border-radius: 10px;
    }

    @media (max-width: 480px) {
      #staff-section .oval-select-wrapper {
        width: 100%;
        min-width: auto;
        max-width: none;
        margin: 6px 0;
        border-radius: 10px;
        /* توحيد مع الأزرار */
        padding: 0;
        /* بدون padding إضافي */
        box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
        /* نفس ظل الأزرار */
        border: 2px solid rgba(var(--primary-color-rgb), 0.15);
        background: var(--surface-0);
        min-height: 44px;
        /* نفس ارتفاع الأزرار */
        display: flex;
        align-items: center;
      }

      #staff-section .oval-select {
        font-size: 0.9rem;
        /* نفس حجم خط الأزرار */
        text-align: center;
        width: 100%;
        height: 44px;
        /* نفس ارتفاع الأزرار */
        padding-inline-start: 30px;
        padding-inline-end: 16px;
        padding-block: 0;
        /* مساحة للأيقونة والسهم */
        border-radius: 10px;
        /* نفس حدود الحاوي */
        box-shadow: none;
        border: none;
        background: transparent;
        line-height: 44px;
        /* توسيط النص عمودياً */
        font-weight: 600;
        /* نفس وزن خط الأزرار */
      }

      /* السهم في الموبايل الصغير */
      #staff-section .oval-select-arrow {
        inset-inline-end: 12px;
        font-size: 0.85rem;
        top: 50%;
        transform: translateY(-50%);
      }

      /* تأثيرات hover متوافقة مع الأزرار */


      /* تأثير عند فتح القائمة - موبايل صغير */
    }

    .unified-reset-btn {
      font-size: 0.9rem;
      padding: 12px 16px;
      min-height: 44px;
      border-radius: 10px;
      margin: 6px 0;
    }

    /* عداد النتائج للموبايل الصغير */
    @media (max-width: 480px) {
      #staff-section .unified-results-count {
        font-size: 0.85rem;
        margin: 8px auto;
        /* توسيط الكبسولة نفسها */
        min-width: 180px;
        /* عرض أكبر للنص العربي */
        width: auto;
        /* عرض تلقائي */
        max-width: 95%;
        /* عرض كامل تقريباً */
        padding: 8px 12px;
        /* padding أكبر */
        border-radius: 6px;
        text-align: center;
        /* توسيط النص داخل الكبسولة */
        white-space: nowrap;
        /* منع كسر السطر */
        overflow: hidden;
        /* إخفاء النص الزائد */
        text-overflow: ellipsis;
        /* نقاط في النهاية إذا لزم */
        display: block;
        /* عرض كعنصر block */
      }
    }

    .card__heart-btn {
      width: 35px;
      height: 35px;
      top: 12px;
      inset-inline-start: 12px;
    }

    .card__details-btn {
      padding: 10px 16px;
      font-size: 0.85rem;
      margin-block: 1px -15px;
      margin-inline: -16px -15px;
      width: calc(100% + 31px);
      font-weight: 500;
    }
  }

  .advanced-filters {
    padding: 25px 20px;
    margin-bottom: 40px;
  }

  .filter-title {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .staff-filters {
    gap: 10px;
  }

  .custom-select-wrapper {
    max-width: 100%;
  }

  .custom-select {
    font-size: 0.95rem;
    padding-block: 12px;
    padding-inline-start: 40px;
    padding-inline-end: 16px;
  }

  .select-arrow {
    inset-inline-end: 15px;
    font-size: 0.85rem;
  }

  .filter-title::after {
    width: 40px;
    height: 2px;
  }

  .results-info {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .no-staff-results {
    padding: 60px 15px;
  }

  .no-results-icon {
    font-size: 4rem;
  }

  .no-staff-results h3 {
    font-size: 1.5rem;
  }

  .section {
    padding: 40px 0;
  }

  .section__title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .layout__wrapper {
    padding: 0 15px;
  }

  /* تم حذف الأنماط القديمة غير المستخدمة */

  .card__title {
    font-size: 1.5rem;
    font-weight: 700;
  }

  .card__subtitle {
    font-size: 0.95rem;
  }

  .card__block--main {
    min-height: 250px;
    padding: 20px;
    padding-top: 45px;
    border-radius: 15px;
  }

  .button {
    font-size: 0.9rem;
    padding: .7rem 1.4rem;
    letter-spacing: .08rem;
  }

  .button--primary {
    box-shadow: 0 4px 0 var(--neutral-800);
  }

  .button--secondary {
    inset-inline-end: 30px;
    padding: .7rem;
    width: 45px;
    height: 45px;
  }

  .card__actions {
    margin-top: 1.2rem;
  }

  /* تم حذف التعريفات المكررة للهيرو */

  .family-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
  }

  .staff-filters {
    gap: 15px;
    margin-bottom: 50px;
    padding: 0 10px;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 25px;
  }

  .no-results-icon {
    font-size: 4rem;
  }

  .no-staff-results h3 {
    font-size: 1.5rem;
  }

  .section {
    padding: 40px 0;
  }

  .section__title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .layout__wrapper {
    padding: 0 15px;
  }

  /* تم حذف .card القديم */

  /* تم حذف الأنماط القديمة غير المستخدمة */

  .button {
    font-size: 0.9rem;
    padding: .7rem 1.4rem;
    letter-spacing: .08rem;
  }

  .button--primary {
    box-shadow: 0 4px 0 var(--neutral-800);
  }

  .button--secondary {
    inset-inline-end: 30px;
    padding: .7rem;
    width: 45px;
    height: 45px;
  }

  /* تم حذف card__actions المكرر */

  /* تم حذف التعريفات المكررة للهيرو */

  .section-header {
    margin: 5px 0 20px 0;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .hero-info {
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    padding: 0 15px;
  }

  .info-item {
    font-size: 0.8rem;
    padding: 10px 12px;
    gap: 6px;
    flex: 1;
    min-width: 120px;
  }

  .info-item i {
    font-size: 0.9rem;
    width: 14px;
  }

  .hero-shapes .shape-1 {
    width: 80px;
    height: 80px;
  }

  .hero-shapes .shape-2 {
    width: 60px;
    height: 60px;
  }

  .hero-shapes .shape-3 {
    width: 70px;
    height: 70px;
  }

  .hero-shapes .shape-4 {
    width: 50px;
    height: 50px;
  }

  .family-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
  }

  .stat-item {
    flex-direction: column;
    gap: 8px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .staff-filters {
    gap: 15px;
    margin-bottom: 50px;
    padding: 0 10px;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 25px;
  }

  .no-results-icon {
    font-size: 4rem;
  }

  .no-staff-results h3 {
    font-size: 1.5rem;
  }

  .section {
    padding: 40px 0;
  }

  .section__title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .layout__wrapper {
    padding: 0 15px;
  }

  /* تم حذف .card القديم */

  /* تم حذف الأنماط القديمة غير المستخدمة */

  .button {
    font-size: 0.9rem;
    padding: .7rem 1.4rem;
    letter-spacing: .08rem;
  }

  .button--primary {
    box-shadow: 0 4px 0 var(--neutral-800);
  }

  .button--secondary {
    inset-inline-end: 30px;
    padding: .7rem;
    width: 45px;
    height: 45px;
  }

  /* تم حذف card__actions المكرر */

  /* Hero responsive */
  .hero-section {
    min-height: 60vh;
    margin-bottom: 30px;
    margin-top: 70px;
  }

  .hero-section .hero-content {
    max-width: 95%;
    padding: 30px 15px 0 15px;
  }

  .hero-section .hero-tag span {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .hero-section .hero-title {
    font-size: 5rem;
  }

  .hero-section .hero-subtitle {
    font-size: 1.9rem;
    margin-bottom: 25px;
  }

  .hero-section .hero-info {
    gap: 8px;
    margin-top: 25px;
    margin-bottom: 30px;
    flex-direction: column;
    padding: 0 15px;
  }

  .hero-section .info-item {
    padding: 8px 12px;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    font-size: 0.75rem;
    flex: none;
  }

  .hero-section .hero-tag {
    margin-bottom: 16px;
  }

  .hero-section .hero-tag span {
    font-size: 0.85rem;
    padding: 6px 16px;
  }

  .section-header {
    margin: 5px 0 20px 0;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .hero-info {
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    padding: 0 15px;
  }

  .info-item {
    font-size: 0.8rem;
    padding: 10px 12px;
    gap: 6px;
    flex: 1;
    min-width: 120px;
  }

  .info-item i {
    font-size: 0.9rem;
    width: 14px;
  }

  .hero-shapes .shape-1 {
    width: 80px;
    height: 80px;
  }

  .hero-shapes .shape-2 {
    width: 60px;
    height: 60px;
  }

  .hero-shapes .shape-3 {
    width: 70px;
    height: 70px;
  }

  .hero-shapes .shape-4 {
    width: 50px;
    height: 50px;
  }

  .family-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
  }

  .stat-item {
    flex-direction: column;
    gap: 8px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .staff-filters {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
    padding: 0 15px;
  }

  .filter-btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 120px;
    max-width: 180px;
    justify-content: center;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 25px;
  }

  @media (max-width: 480px) {
    .page-hero {
      padding: 30px 0 25px;
      min-height: auto;
    }

    .hero-content {
      max-width: 100%;
      padding: 0 15px;
    }

    .hero-title {
      font-size: 1.8rem;
      margin-bottom: 12px;
      line-height: 1.3;
    }

    .hero-subtitle {
      font-size: 0.85rem;
      margin-bottom: 18px;
      line-height: 1.4;
    }

    .hero-tag {
      margin-bottom: 15px;
      text-align: center;
    }

    .hero-tag span {
      font-size: 0.75rem;
      padding: 6px 14px;
      display: inline-block;
    }

    .hero-info {
      gap: 10px;
      margin-top: 20px;
      flex-direction: column;
      padding: 0 10px;
    }

    .info-item {
      padding: 12px 16px;
      font-size: 0.8rem;
      flex: 1 1 100%;
      min-width: auto;
      text-align: center;
      border-radius: 12px;
      min-height: 50px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    .stat-icon {
      width: 35px;
      height: 35px;
      font-size: 1rem;
      margin-bottom: 5px;
    }

    .stat-number {
      font-size: 1.3rem;
      font-weight: 700;
      margin-bottom: 2px;
    }

    .stat-label {
      font-size: 0.75rem;
      opacity: 0.9;
    }

    .section-title {
      font-size: 1.6rem;
      margin-bottom: 15px;
    }

    .section-subtitle {
      font-size: 0.85rem;
      margin-bottom: 25px;
    }

    .staff-filters {
      gap: 8px;
      margin-bottom: 30px;
      padding: 0 10px;
      flex-wrap: wrap;
    }

    .filter-btn {
      flex: 1 1 calc(50% - 4px);
      min-width: 140px;
      max-width: none;
      font-size: 0.8rem;
      padding: 10px 12px;
      border-radius: 20px;
    }

    /* شريط البحث - تم نقله إلى search-box-oval.css */

    .staff-grid {
      grid-template-columns: 1fr;
      gap: 20px;
      padding: 0 10px;
    }

    .staff-card-modal {
      min-height: 320px;
      margin-bottom: 15px;
    }

    .card-footer-btn {
      padding: 12px 18px;
      font-size: 0.85rem;
    }

    .load-more-container {
      margin-top: 30px;
      padding: 0 10px;
    }

    .load-more-btn {
      padding: 12px 25px;
      font-size: 0.9rem;
    }
  }

  /* تحسينات للموبايل الصغير جداً */
  @media (max-width: 360px) {
    .page-hero {
      padding: 25px 0 20px;
    }

    /* شريط البحث - تم نقله إلى search-box-oval.css */

    /* أزرار الفلاتر للهواتف الصغيرة جداً */
    .unified-filters-bar {
      margin: 12px 8px;
      padding: 10px;
      gap: 8px;
    }

    .unified-filter-btn {
      font-size: 0.85rem;
      padding: 10px 14px;
      min-width: 110px;
      min-height: 42px;
      border-radius: 8px;
    }

    #staff-section .oval-select {
      font-size: 0.85rem;
      /* نفس حجم خط الأزرار */
      text-align: center;
      width: 100%;
      height: 42px;
      /* نفس ارتفاع الأزرار */
      padding-inline-start: 28px;
      padding-inline-end: 14px;
      padding-block: 0;
      /* مساحة للأيقونة والسهم */
      border-radius: 8px;
      /* نفس حدود الحاوي */
      box-shadow: none;
      border: none;
      background: transparent;
      line-height: 42px;
      /* توسيط النص عمودياً */
      font-weight: 600;
      /* نفس وزن خط الأزرار */
    }

    #staff-section .oval-select-wrapper {
      width: 100%;
      min-width: auto;
      max-width: none;
      border-radius: 8px;
      /* توحيد مع الأزرار */
      padding: 0;
      /* بدون padding إضافي */
      box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
      /* نفس ظل الأزرار */
      border: 2px solid rgba(var(--primary-color-rgb), 0.15);
      background: var(--surface-0);
      min-height: 42px;
      /* نفس ارتفاع الأزرار */
      display: flex;
      align-items: center;
    }

    /* السهم في الموبايل الصغير جداً */
    #staff-section .oval-select-arrow {
      inset-inline-end: 10px;
      font-size: 0.8rem;
      top: 50%;
      transform: translateY(-50%);
    }

    /* تأثيرات hover متوافقة مع الأزرار */


    /* تأثير عند فتح القائمة - موبايل صغير جداً */

    .unified-reset-btn {
      font-size: 0.85rem;
      padding: 10px 14px;
      min-height: 42px;
      border-radius: 8px;
    }

    #staff-section .unified-results-count {
      font-size: 0.8rem;
      margin: 6px auto;
      /* توسيط الكبسولة نفسها */
      min-width: 160px;
      /* عرض أكبر للنص العربي */
      width: auto;
      /* عرض تلقائي */
      max-width: 90%;
      /* عرض كامل تقريباً */
      padding: 6px 10px;
      /* padding أكبر */
      text-align: center;
      /* توسيط النص داخل الكبسولة */
      white-space: nowrap;
      /* منع كسر السطر */
      overflow: hidden;
      /* إخفاء النص الزائد */
      text-overflow: ellipsis;
      /* نقاط في النهاية إذا لزم */
      display: block;
      /* عرض كعنصر block */
    }

    /* بطاقات المعلمين للهواتف الصغيرة جداً */
    .staff-card-modal {
      min-height: 280px;
      margin-bottom: 10px;
    }

    .staff-grid {
      gap: 15px;
      padding: 0 8px;
    }

    .hero-content {
      padding: 0 10px;
    }

    .hero-title {
      font-size: 1.6rem;
      margin-bottom: 10px;
    }

    .hero-subtitle {
      font-size: 0.8rem;
      margin-bottom: 15px;
    }

    .hero-tag span {
      font-size: 0.7rem;
      padding: 5px 12px;
    }

    .info-item {
      padding: 10px 12px;
      min-height: 45px;
    }

    .stat-icon {
      width: 30px;
      height: 30px;
      font-size: 0.9rem;
    }

    .stat-number {
      font-size: 1.2rem;
    }

    .stat-label {
      font-size: 0.7rem;
    }

    .section-title {
      font-size: 1.4rem;
      margin-bottom: 12px;
    }

    .section-subtitle {
      font-size: 0.8rem;
      margin-bottom: 20px;
    }

    .staff-filters {
      gap: 6px;
      margin-bottom: 25px;
      padding: 0 5px;
    }

    .filter-btn {
      flex: 1 1 100%;
      min-width: auto;
      font-size: 0.75rem;
      padding: 8px 10px;
      border-radius: 18px;
    }

    /* شريط البحث - تم نقله إلى search-box-oval.css */

    .staff-grid {
      gap: 15px;
      padding: 0 5px;
    }

    .staff-card-modal {
      min-height: 300px;
      margin-bottom: 12px;
    }

    .card-footer-btn {
      padding: 10px 15px;
      font-size: 0.8rem;
    }

    .load-more-btn {
      padding: 10px 20px;
      font-size: 0.85rem;
    }
  }

  /* ========== تأثيرات الأنيميشن للبطاقات - مطابقة لبطاقات الطلاب ========== */

  /* أنيميشن fadeInUp - ظهور البطاقات من الأسفل */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* تأثير slide-in للبطاقات */
  @keyframes cardSlideIn {
    from {
      opacity: 0;
      transform: translateY(50px) scale(0.9);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  /* ========== Visibility Logic for JS Observer ========== */
  .staff-card-modal {
    /* opacity: 0; */
    /* transform: translateY(30px); */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
  }

  .staff-card-modal.visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* شريط البحث البيضاوي - تم نقله إلى search-box-oval.css */

}

/* ─── أيقونات الأوسمة في بطاقة المعلم (بدلاً من student-stars) ─── */
.teacher-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 16px 0;
  padding: 0 10px;
  min-height: 25px;
}

.teacher-badges i {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .teacher-badges i:hover {
    transform: scale(1.25);
  }
}

/* ─── معاينة الأوسمة في هيدر المودال ─── */
.teacher-modal-badges-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ─── لمعة (sheen) على أيقونة الوسام مباشرة ───
 * محصور بـ #staff-section و #custom-teacher-modal حتى لا يتعارض مع students-modern.css
 * (كلاهما يُحمّلان معًا في index.html).
 */
@keyframes badge-sheen-move-staff {
  0%   { inset-inline-start: -80%; }
  100% { inset-inline-start: 130%; }
}

#staff-section .badge-sheen-wrap,
#custom-teacher-modal .badge-sheen-wrap {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 6px;
  line-height: 1;
  padding: 3px 4px;
}

#staff-section .badge-sheen-wrap::after,
#custom-teacher-modal .badge-sheen-wrap::after {
  content: '';
  position: absolute;
  top: -20%;
  inset-inline-start: -80%;
  width: 45%;
  height: 140%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.75), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  #staff-section .badge-sheen-wrap::after,
  #custom-teacher-modal .badge-sheen-wrap::after {
    animation: badge-sheen-move-staff 2.8s infinite ease-in-out;
  }
}

/* ═══════════════════════════════════════════════════════════
 * TEACHER MODAL — CSS-driven (no inline hardcoded colors)
 * كل الألوان عبر CSS variables لدعم الثيمات
 * ═══════════════════════════════════════════════════════════ */

.teacher-modal-overlay {
  box-sizing: border-box;
}

html.detail-modal-scroll-lock {
  overflow: hidden;
  height: 100%;
}

body.detail-modal-scroll-lock {
  overscroll-behavior: none;
}

@media (max-width: 768px) {
  .teacher-modal-overlay {
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .teacher-modal-overlay .teacher-modal-card {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 0 1 auto !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .teacher-modal-close-btn {
    top: calc(12px + env(safe-area-inset-top, 0px));
    inset-inline-start: calc(16px + env(safe-area-inset-left, 0px));
  }
}

/* البطاقة الداخلية */
.teacher-modal-card {
  --teacher-modal-header-h: 100px;
  --teacher-modal-avatar-size: 120px;
  position: relative;
  background: var(--surface-0);
  margin: 0;
  padding: 0;
  border-radius: 18px;
  width: min(420px, 92vw);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.teacher-modal-card::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* زر الإغلاق */
.teacher-modal-close-btn {
  position: absolute;
  top: 12px;
  inset-inline-start: 16px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  font-size: 1.2rem;
  color: var(--text-white);
  transition: all 0.3s ease;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .teacher-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .teacher-modal-close-btn:hover {
    transform: scale(1.1);
  }
}

/* هيدر المودال — ارتفاع ثابت يطابق مركز الأفاتار على خط الفصل */
.teacher-modal-header {
  position: relative;
  width: 100%;
}

.profile-header.teacher-modal-header {
  height: var(--teacher-modal-header-h);
  min-height: var(--teacher-modal-header-h);
}

/* الأفاتار: مركز الدائرة على حافة الشريط الملون والجسم */
.teacher-modal-avatar {
  position: absolute;
  left: 50%;
  top: var(--teacher-modal-header-h);
  transform: translate(-50%, -50%);
  transform-origin: center center;
  z-index: 5;
  width: var(--teacher-modal-avatar-size);
  height: var(--teacher-modal-avatar-size);
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 4px solid var(--surface-0);
}

.teacher-modal-avatar.profile-avatar {
  margin-left: 0;
  margin-inline-start: 0;
  transition: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

/* إلغاء أبعاد .profile-avatar img العامة داخل مودال المعلم */
.teacher-modal-card .profile-avatar.teacher-modal-avatar img,
.teacher-modal-card .profile-avatar.teacher-modal-avatar .teacher-modal-img {
  position: static;
  top: auto;
  left: auto;
  transform: scale(1.07);
  transform-origin: center center;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
}

.teacher-modal-card .profile-avatar.teacher-modal-avatar .modal-teacher-avatar-placeholder {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* صورة المعلم في المودال (التكبير الطفيف داخل المحدد أعلاه لأفاتار المودال) */
.teacher-modal-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* placeholder الأفاتار */
.modal-teacher-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 3rem;
}

/* اسم المعلم */
.teacher-modal-name {
  margin: calc(var(--teacher-modal-avatar-size) / 2 + 14px) 0 10px;
  font-size: 1.4rem;
  color: var(--text-strong);
}

@media (max-width: 768px) {
  .teacher-modal-card {
    --teacher-modal-header-h: 88px;
    --teacher-modal-avatar-size: 118px;
  }
}

/* وصف المعلم */
.teacher-modal-desc {
  padding: 0.35rem 1rem 0.8rem;
  text-align: center;
  line-height: 1.4;
}

.teacher-modal-position {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 3px;
}

/* النجوم */
.teacher-modal-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
}

.teacher-modal-stars .star.filled,
.teacher-modal-stars .star.half {
  color: #ffc107;
}

.teacher-modal-stars .star.empty {
  color: var(--border-color);
}

/* صف الأوسمة */
.teacher-modal-badges-row {
  text-align: center;
  padding: 0 1rem 0.8rem;
}

/* منطقة التفاصيل */
.teacher-modal-details {
  padding: 1rem 1.2rem 1.2rem;
  background: var(--surface-1);
  margin: 0 1rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* عناصر التفاصيل — RTL: أيقونة بجوار بداية السطر، نص لليمين */
.teacher-modal-detail-item {
  display: flex;
  flex-direction: row;
  direction: rtl;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.35rem;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--surface-0);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: right;
  color: var(--text-strong);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.teacher-modal-detail-item:last-child {
  margin-bottom: 0;
}

@media (hover: hover) {
  .teacher-modal-detail-item:hover {
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.08);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .teacher-modal-detail-item:hover {
    transform: translateY(-1px);
  }
}

.teacher-modal-detail-item strong {
  color: var(--text-strong);
  font-weight: 600;
  margin-inline: 0;
  margin-inline-end: 0.3em;
  display: inline;
}

.teacher-modal-detail-item span {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  text-align: right;
  line-height: 1.55;
}

.teacher-modal-details .teacher-modal-detail-item > .detail-icon {
  margin: 0;
  width: 1.05em;
  min-width: 1.05em;
  flex-shrink: 0;
  line-height: 1.45;
  font-size: 1em;
  align-self: flex-start;
  padding-top: 0.1em;
  text-align: center;
}

/* أيقونات */
.teacher-modal-star-icon {
  color: var(--gold, #ffc107);
}

.teacher-modal-medal-icon {
  color: var(--gold, #edb527);
}

.teacher-modal-subject-icon {
  color: var(--primary-color);
}

.teacher-modal-edu-icon {
  color: #28a745;
}

.teacher-modal-exp-icon {
  color: #17a2b8;
}

.teacher-modal-bio-icon {
  color: var(--primary-color);
  opacity: 0.85;
}

/* نبذة — أيقونة الاقتباس بمحاذاة «نبذة:» */
.teacher-modal-bio-item {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.teacher-modal-bio-item .detail-icon {
  flex-shrink: 0;
  margin: 0;
  margin-top: 0.12em;
  padding-top: 0;
  color: var(--primary-color);
}

.teacher-modal-bio-item > div {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

.teacher-modal-bio-text {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
  text-align: right;
}

/* فوتر المودال */
.teacher-modal-footer {
  padding: 1rem;
  background: var(--primary-color);
  text-align: center;
  min-height: 20px;
  border-radius: 0 0 15px 15px;
}

/* ═══════════════════════════════════════════════════════════
 * TEACHER MODAL — Responsive
 * ═══════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .teacher-modal-card {
    --teacher-modal-header-h: 80px;
    --teacher-modal-avatar-size: 104px;
    border-radius: 14px;
    max-height: 92vh;
    max-height: 92dvh;
  }

  .teacher-modal-name {
    margin: calc(var(--teacher-modal-avatar-size) / 2 + 10px) 0 8px;
    font-size: 1.15rem;
  }

  .teacher-modal-desc {
    padding: 0 0.75rem 0.6rem;
  }

  .teacher-modal-details {
    padding: 0.75rem 0.8rem 0.8rem;
    margin: 0 0.6rem 0.8rem;
  }

  .teacher-modal-detail-item {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .teacher-modal-bio-text {
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .teacher-modal-card {
    --teacher-modal-header-h: 76px;
    --teacher-modal-avatar-size: 92px;
    width: 96vw;
    border-radius: 12px;
  }

  .teacher-modal-name {
    margin: calc(var(--teacher-modal-avatar-size) / 2 + 8px) 0 6px;
    font-size: 1rem;
  }

  .teacher-modal-detail-item {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}

/* ─── تقليل الحركة: بطاقات الكادر + فلاتر (إتاحة أفضل) ─── */
@media (prefers-reduced-motion: reduce) {
  .staff-card-modal,
  .staff-card-modal.visible {
    transition: none !important;
  }

  .profile-avatar,
  .profile-name,
  .card-footer-btn,
  .card-footer-btn i,
  .unified-filter-btn {
    transition: none;
  }
}

/* ============================================================
   بطاقة وضع الصيانة للكادر — متوافقة مع الثيم الليلي (SEC)
   ============================================================ */
#staffGrid.staff-grid--maintenance {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.staff-maintenance-card {
  position: relative;
  overflow: hidden;
  max-width: 520px;
  width: 100%;
  padding: 3rem 2.5rem;
  text-align: center;
  border-radius: 16px;
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border-color, #e9ecef);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.staff-maintenance-card.animate,
.staff-maintenance-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.staff-maintenance-card__bar {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color, #6366f1),
    var(--secondary-color, #8b5cf6)
  );
}

.staff-maintenance-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  font-size: 1.75rem;
  border-radius: 50%;
  margin-bottom: 1.25rem;
  color: var(--primary-color, #6366f1);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary-color, #6366f1) 12%, transparent),
    color-mix(in srgb, var(--secondary-color, #8b5cf6) 12%, transparent)
  );
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .staff-maintenance-card__icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  }
}

.staff-maintenance-card__msg {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  white-space: pre-line;
  color: var(--text-secondary, #64748b);
}

.staff-maintenance-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: #fff;
  background: var(--primary-color, #6366f1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.staff-maintenance-card__btn:hover,
.staff-maintenance-card__btn:focus-visible {
  opacity: 0.88;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.staff-maintenance-card__btn:focus-visible {
  outline: 2px solid var(--primary-color, #6366f1);
  outline-offset: 3px;
}

body.theme-night .staff-maintenance-card,
[data-theme="night"] .staff-maintenance-card {
  background: var(--surface-1, #1e293b);
  border-color: var(--border-color, #334155);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

body.theme-night .staff-maintenance-card__msg,
[data-theme="night"] .staff-maintenance-card__msg {
  color: var(--text-secondary, #cbd5e1);
}