/**
 * معلمون — واجهة حديثة بألوان الهوية
 * --brand-bg: #0D474C | --brand-primary: #31B0A8 | --brand-accent: #EBF024
 */
:root {
  --brand-bg:       #0D474C;
  --brand-bg-dark:  #082a2d;
  --brand-primary:  #31B0A8;
  --brand-primary-hover: #3dd4cb;
  --brand-accent:   #EBF024;
  --brand-accent-soft: rgba(235, 240, 36, 0.15);
  --text-on-bg:     #fff;
  --text-body:      #1a2634;
  --text-muted:     #5a6c7d;
  --surface:        #ffffff;
  --surface-2:      #f8fafb;
  --border:         rgba(13, 71, 76, 0.12);
  --radius:         16px;
  --radius-sm:      10px;
  --radius-pill:    999px;
  --shadow-sm:      0 2px 8px rgba(13, 71, 76, 0.06);
  --shadow:         0 8px 32px rgba(13, 71, 76, 0.12);
  --shadow-lg:      0 24px 56px rgba(13, 71, 76, 0.18);
  --transition:     0.25s ease;
  --font:           'Tajawal', sans-serif;
}

* { box-sizing: border-box; }
html { direction: rtl; font-family: var(--font); scroll-behavior: smooth; }
body { margin: 0; color: var(--text-body); background: var(--surface-2); line-height: 1.7; font-weight: 500; }

/* ========== الهيدر ========== */
.site-header {
  background: linear-gradient(135deg, var(--brand-bg) 0%, var(--brand-bg-dark) 100%);
  color: var(--text-on-bg);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header a { color: var(--text-on-bg); text-decoration: none; transition: color var(--transition), transform var(--transition); }
.site-header a:hover { color: var(--brand-accent); }
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.logo-wrap img { height: 40px; width: auto; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.site-header { position: relative; }
.site-header .logo-wrap { gap: 0; }
.site-header .logo-wrap img { height: 40px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-on-bg);
  transition: background var(--transition);
}
.nav-toggle:hover { background: rgba(255,255,255,0.2); }
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  margin: 0 auto;
  transition: transform var(--transition), opacity var(--transition);
}
.site-header.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links > a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links > a:hover { background: rgba(255,255,255,0.12); }
.nav-out { opacity: 0.85; font-size: 0.9rem; }
.btn-nav {
  background: var(--brand-accent) !important;
  color: var(--brand-bg) !important;
  padding: 0.6rem 1.4rem !important;
  border-radius: var(--radius-pill) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(235, 240, 36, 0.4);
}
.btn-nav:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(235, 240, 36, 0.5); color: var(--brand-bg) !important; }

/* الهيدر على الموبايل: لوجو أوضح + قائمة هامبرغر */
@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 1rem;
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
  .site-header .logo-wrap img {
    height: 30px;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: linear-gradient(180deg, var(--brand-bg-dark) 0%, var(--brand-bg) 100%);
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 1rem 1.25rem;
    gap: 0.25rem;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  .site-header.nav-open .nav-links {
    display: flex;
  }
  .nav-links > a {
    display: block;
    padding: 0.85rem 1rem;
    text-align: right;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }
  .nav-links .btn-nav {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0.75rem 1.25rem !important;
  }
}

/* ========== المحتوى الرئيسي ========== */
.main-wrap { max-width: 1140px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-dashboard .main-wrap { max-width: none; padding: 0; }
.page-dashboard .dash-content { max-width: none; padding: 2rem 1.5rem; }

/* ========== الفوتر ========== */
.site-footer {
  background: linear-gradient(180deg, var(--brand-bg-dark) 0%, var(--brand-bg) 100%);
  color: var(--text-on-bg);
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
  text-align: center;
}
.site-footer p { margin: 0.5rem 0; opacity: 0.9; }
.site-footer a { color: var(--brand-accent); font-weight: 600; text-decoration: none; transition: opacity var(--transition), color var(--transition); }
.site-footer a:hover { opacity: 1; text-decoration: underline; color: var(--brand-accent); }

/* ========== أزرار ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  text-decoration: none;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #2a9d96 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(49, 176, 168, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(49, 176, 168, 0.45); }
.btn-accent {
  background: var(--brand-accent);
  color: var(--brand-bg);
  box-shadow: 0 6px 20px rgba(235, 240, 36, 0.4);
}
.btn-accent:hover { box-shadow: 0 10px 28px rgba(235, 240, 36, 0.5); color: var(--brand-bg); }
.btn-ghost {
  background: transparent;
  border: 2px solid var(--brand-accent);
  color: var(--brand-accent);
}
.btn-ghost:hover { background: var(--brand-accent-soft); }
.btn-dark {
  background: var(--brand-bg);
  color: var(--text-on-bg);
  border: 2px solid var(--brand-bg);
}
.btn-dark:hover {
  background: var(--brand-bg-dark);
  border-color: var(--brand-bg-dark);
  color: var(--text-on-bg);
}

/* ========== نماذج ========== */
input, select, textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  direction: rtl;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--surface);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(49, 176, 168, 0.2);
}
label { display: block; margin-bottom: 0.4rem; font-weight: 700; color: var(--text-body); font-size: 0.95rem; }
.required { color: #c00; }
textarea { min-height: 100px; resize: vertical; }
.form-group { margin-bottom: 1.25rem; }
.form-actions { margin-top: 1.5rem; }

/* ========== بطاقات ========== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(49, 176, 168, 0.25);
}
.card h2, .card h3 { margin-top: 0; color: var(--brand-bg); font-weight: 800; font-size: 1.25rem; }
.card .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.6rem; font-weight: 500; }
.card p:last-child { margin-bottom: 0; }

/* ========== لوحات التحكم ========== */
.dash-header {
  background: linear-gradient(135deg, var(--brand-bg) 0%, var(--brand-bg-dark) 100%);
  color: var(--text-on-bg);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.dash-header .logo-wrap img { height: 40px; }
.dash-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.dash-nav a {
  color: var(--text-on-bg);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}
.dash-nav a:hover { background: rgba(255,255,255,0.15); color: var(--brand-accent); }
.dash-nav a.active { background: var(--brand-accent); color: var(--brand-bg); }
.dash-content { padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.dash-content h1 { font-weight: 800; color: var(--brand-bg); font-size: 1.75rem; margin-bottom: 1.5rem; }
.dash-content h2 { font-weight: 700; color: var(--text-body); font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
.dash-side { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.dash-side a {
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--brand-bg);
  border: 2px solid var(--border);
  font-weight: 600;
  transition: all var(--transition);
}
.dash-side a:hover, .dash-side a.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  transform: translateX(-4px);
}

/* ========== صفحة الرسائل ========== */
.messages-page .messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (max-width: 767px) {
  .messages-page .messages-layout { grid-template-columns: 1fr; }
}
.messages-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  height: fit-content;
}
.messages-list h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.conversations-list { list-style: none; padding: 0; margin: 0; }
.conversations-list li { margin-bottom: 0.25rem; }
.conversations-list a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-body);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.conversations-list a:hover { background: var(--surface-2); }
.conversations-list a.active { background: var(--brand-accent-soft); border-color: var(--brand-primary); color: var(--brand-bg); }
.conversations-list .last-preview { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.messages-conversation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.messages-conversation h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.messages-thread {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.message-row {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  max-width: 85%;
}
.message-row.mine { background: var(--brand-accent-soft); margin-right: 0; margin-left: auto; }
.message-row.theirs { background: var(--surface-2); }
.message-sender { font-size: 0.85rem; font-weight: 700; color: var(--brand-bg); }
.message-body { margin: 0.35rem 0 0; font-size: 0.95rem; }
.message-time { font-size: 0.8rem; color: var(--text-muted); }
.message-form textarea { width: 100%; max-width: none; margin-bottom: 0.75rem; }
.message-form .btn { margin-top: 0; }

/* ========== الصفحة الرئيسية — هيرو ========== */
.hero {
  background: var(--brand-bg);
  color: var(--text-on-bg);
  padding: 4rem 2rem;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(49, 176, 168, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 50%;
  height: 100%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
}
.hero .logo-hero {
  height: auto;
  max-height: 90px;
  width: auto;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.25));
  object-fit: contain;
}
@media (max-width: 768px) {
  .hero .logo-hero {
    max-height: 48px;
    margin-bottom: 0.75rem;
    display: block;
    margin-right: auto;
    margin-left: auto;
  }
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.hero p {
  margin: 0 auto 1.75rem;
  max-width: 520px;
  font-size: 1.1rem;
  color: #f0f9f8;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,0.25);
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}
.hero-actions .btn { min-width: 180px; }
.hero-actions .btn:first-child { background: var(--brand-accent); color: var(--brand-bg); box-shadow: 0 6px 24px rgba(235, 240, 36, 0.45); }
.hero-actions .btn:first-child:hover { box-shadow: 0 10px 32px rgba(235, 240, 36, 0.55); color: var(--brand-bg); }
.hero-actions .btn:nth-child(2) { background: transparent; border: 2px solid var(--brand-accent); color: var(--brand-accent); }
.hero-actions .btn:nth-child(2):hover { background: var(--brand-accent-soft); color: var(--brand-accent); }
.hero-actions .btn:last-child { background: transparent; border: 2px solid var(--brand-accent); color: var(--brand-accent); }
.hero-actions .btn:last-child:hover { background: var(--brand-accent-soft); color: var(--brand-accent); }
.stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.stats span {
  color: #0D474C;
  font-weight: 800;
  font-size: 1.2rem;
  padding: 0.65rem 1.35rem;
  background: var(--brand-accent);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(235, 240, 36, 0.4);
}

/* ========== قسم "لماذا معلمون" ========== */
.why-section { margin-top: 2rem; }
.why-section > h2 {
  font-weight: 800;
  color: var(--brand-bg);
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.cards-grid .card { margin-bottom: 0; }
.cta-wrap { text-align: center; margin-top: 2rem; }

/* ========== تنبيهات ========== */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-weight: 600; }
.alert-success { background: rgba(49, 176, 168, 0.15); color: #0d5c57; border: 1px solid rgba(49, 176, 168, 0.4); }
.alert-error { background: rgba(200, 60, 60, 0.12); color: #8b2635; border: 1px solid rgba(200, 60, 60, 0.3); }

/* ========== جداول ========== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
th, td { padding: 1rem 1.25rem; text-align: right; border-bottom: 1px solid var(--border); }
th { background: var(--brand-bg); color: var(--text-on-bg); font-weight: 700; font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* خانات اختيار (مواد/مراحل) */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.checkbox-label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: 500; white-space: nowrap; }
.checkbox-label input { width: 1.1em; height: 1.1em; accent-color: var(--brand-primary); cursor: pointer; }
.form-hint { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.75rem; }

/* جدول أوقات العمل المتاحة */
.availability-table-wrap { overflow-x: auto; margin-top: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.availability-table { margin: 0; min-width: 100%; }
.availability-table th { padding: 0.6rem 0.5rem; font-size: 0.8rem; white-space: nowrap; }
.availability-table td { padding: 0.4rem 0.5rem; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--border); }
.availability-table .slot-time { text-align: left; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; padding-left: 0.75rem; }
.availability-table .cell-check { display: flex; justify-content: center; align-items: center; margin: 0; cursor: pointer; }
.availability-table .cell-check input { width: 1.2em; height: 1.2em; accent-color: var(--brand-primary); cursor: pointer; }
.availability-table tbody tr:hover td { background: var(--brand-accent-soft); }
.availability-table tbody tr:hover .slot-time { background: var(--surface-2); }

/* جدول الخدمات (مادة × مرحلة) */
.services-grid { width: 100%; border-collapse: collapse; margin: 0; min-width: 320px; }
.services-grid th { padding: 0.6rem 0.75rem; font-size: 0.9rem; text-align: right; border-bottom: 2px solid var(--border); background: var(--surface-2); }
.services-grid td { padding: 0.5rem 0.75rem; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--border); }
.services-grid td:first-child { text-align: right; font-weight: 500; }
.services-grid .checkbox-label { display: flex; justify-content: center; align-items: center; margin: 0; cursor: pointer; }
.services-grid .checkbox-label input { width: 1.2em; height: 1.2em; accent-color: var(--brand-primary); cursor: pointer; }
.services-grid tbody tr:hover td { background: var(--brand-accent-soft); }

/* ========== صفحة بروفايل المدرس (عامة) ========== */
.page-teacher-profile .main-wrap { padding-top: 0; }
.teacher-hero {
  position: relative;
  color: var(--text-on-bg);
  padding: 2.5rem 1.5rem;
  margin: 0 -1.5rem 2rem;
  overflow: hidden;
}
.teacher-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--brand-bg) 0%, var(--brand-bg-dark) 50%, #062224 100%);
  z-index: 0;
}
.teacher-hero-bg::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(49, 176, 168, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.teacher-hero-bg::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(235, 240, 36, 0.08) 0%, transparent 65%);
  pointer-events: none;
}
.teacher-hero .main-wrap { position: relative; z-index: 1; padding: 0 1.5rem; max-width: 1140px; margin: 0 auto; }
.teacher-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}
.teacher-hero-avatar-wrap { flex-shrink: 0; }
.teacher-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: var(--brand-bg);
  font-size: 2.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(235, 240, 36, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.5);
  transition: transform var(--transition), box-shadow var(--transition);
}
.teacher-avatar.teacher-avatar-img,
img.teacher-avatar-img {
  object-fit: cover;
  display: block;
}
.teacher-hero:hover .teacher-avatar { transform: scale(1.02); box-shadow: 0 10px 36px rgba(235, 240, 36, 0.45); }
.teacher-hero-content { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.teacher-hero-name {
  color: var(--text-on-bg);
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.teacher-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.25rem;
}
.teacher-hero-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.teacher-hero-stat-num {
  font-weight: 800;
  color: var(--brand-accent);
  font-size: 1.15rem;
}
.teacher-hero-stat-label { opacity: 0.95; }
.teacher-hero-qual {
  font-size: 0.9rem;
  opacity: 0.92;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.teacher-hero-cta { margin-top: 0.25rem; }
.badge {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(235, 240, 36, 0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}
.badge:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(235, 240, 36, 0.5); }
.badge-available { background: var(--brand-accent); color: var(--brand-bg); }
@media (max-width: 479px) {
  .teacher-hero-qual { max-width: 100%; white-space: normal; }
}
.teacher-profile-wrap { padding-top: 0; }
.teacher-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .teacher-hero { padding: 3rem 2rem; margin-bottom: 2.5rem; }
  .teacher-hero .main-wrap { padding: 0 2rem; }
  .teacher-avatar { width: 100px; height: 100px; font-size: 2.75rem; border-width: 4px; }
  .teacher-hero-name { font-size: 2.15rem; }
  .teacher-hero-qual { max-width: 420px; }
  .teacher-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .profile-availability { grid-column: 1 / -1; }
}
@media (min-width: 992px) {
  .teacher-grid { gap: 1.5rem; }
}
.profile-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.profile-card:hover { box-shadow: 0 12px 36px rgba(13, 71, 76, 0.14); border-color: rgba(49, 176, 168, 0.25); }
.profile-card h2 {
  margin: 0 0 1.25rem;
  padding: 0.6rem 1rem;
  border-left: 4px solid var(--brand-primary);
  background: var(--brand-accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  width: fit-content;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-bg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.icon-circle { font-size: 1.1rem; opacity: 0.9; }
.profile-bio { margin: 0; line-height: 1.75; font-size: 0.95rem; }
.profile-meta-list { list-style: none; padding: 0; margin: 0 0 1rem; font-size: 0.95rem; }
.profile-meta-list li { margin-bottom: 0.35rem; }
.qualifications-text { margin: 0; line-height: 1.75; font-size: 0.95rem; white-space: pre-wrap; }
.video-embed-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-sm); background: #000; }
.video-embed-wrap iframe { position: absolute; top: 0; right: 0; width: 100%; height: 100%; border: none; }
.review-summary { margin: 0 0 1rem; font-size: 1.1rem; }
.review-avg { font-weight: 800; color: var(--brand-bg); margin-left: 0.35rem; }
.review-stars { color: var(--brand-accent); }
.review-count { color: var(--text-muted); font-size: 0.95rem; }
.reviews-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.reviews-list li { padding: 0.85rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.reviews-list li:last-child { border-bottom: none; }
.review-rating { color: var(--brand-accent); font-size: 1rem; }
.review-comment { margin: 0.35rem 0 0; line-height: 1.6; }
.review-date { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.review-action { margin: 0; }
.text-muted { color: var(--text-muted); }
.services-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.services-list li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.services-list li:nth-child(even) { background: rgba(49, 176, 168, 0.04); margin: 0 -2rem; padding: 0.85rem 2rem; }
.services-list li:last-child { border-bottom: none; }
.service-subject { font-weight: 700; color: var(--brand-bg); }
.service-stage { color: var(--text-muted); font-weight: 500; }
.service-price {
  font-weight: 700;
  color: var(--brand-bg);
  background: var(--brand-accent-soft);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
}
.service-type { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.profile-availability .availability-intro { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--text-muted); }
.availability-readonly.availability-table-wrap { margin-top: 0; border-radius: var(--radius); overflow: hidden; }
.page-teacher-profile .availability-display thead th {
  background: var(--brand-bg);
  color: var(--text-on-bg);
  font-weight: 700;
  padding: 0.7rem 0.5rem;
  font-size: 0.85rem;
}
.page-teacher-profile .availability-display .slot-time {
  background: var(--surface-2);
  font-size: 0.95rem;
  color: var(--text-body);
  font-weight: 500;
}
.page-teacher-profile .availability-display tbody td {
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.page-teacher-profile .availability-display td.slot-available {
  background: rgba(49, 176, 168, 0.28);
  color: var(--brand-bg);
  font-weight: 700;
}
.profile-availability.no-slots .availability-table-wrap { display: none; }
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2rem;
  padding-top: 0;
}
.profile-actions .btn-accent { font-size: 1.05rem; padding: 0.9rem 1.85rem; }
.profile-actions .btn-dark { font-size: 0.98rem; }

/* ========== صفحة البحث عن مدرس ========== */
.filter-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.filter-card .form-group { margin-bottom: 0; }
.filter-card select { max-width: 200px; }

/* ========== تنسيقات عامة ========== */
h1 { font-weight: 800; color: var(--brand-bg); font-size: 1.75rem; margin-top: 0; }
h2 { font-weight: 700; color: var(--text-body); font-size: 1.35rem; }
a { color: var(--brand-primary); font-weight: 600; transition: color var(--transition); }
a:hover { color: var(--brand-bg); }

@media (min-width: 768px) {
  .dash-layout { display: flex; gap: 1.5rem; }
  .dash-side { width: 240px; flex-shrink: 0; }
  .dash-main { flex: 1; }
  .hero { padding: 5rem 2rem; }
}
