/* ==========================================================
   اختصاص IKHTESAS — الأنماط الرئيسية
   الهوية: حلقة البوصلة بستة ألوان
   أخضر مائي #04A084 · بترولي #0B5468 · أزرق #1B6690
   أخضر فاتح #7DB897 · كهرماني #F7A21C · برتقالي #F07122
   النصوص: بني #5A443D ورمادي #6D6E71 · الخلفية #FBFAF8 · الخط Cairo
   ========================================================== */

:root {
  --c1: #04A084;  /* أخضر مائي */
  --c2: #0B5468;  /* بترولي */
  --c3: #1B6690;  /* أزرق */
  --c4: #7DB897;  /* أخضر فاتح */
  --c5: #F7A21C;  /* كهرماني */
  --c6: #F07122;  /* برتقالي */

  --ink: #0B5468;          /* العناوين */
  --primary: #1B6690;      /* الأزرار والروابط */
  --primary-deep: #0B5468;
  --accent: #04A084;
  --text: #5A443D;
  --muted: #6D6E71;
  --paper: #FBFAF8;
  --white: #FFFFFF;
  --soft: #F3F1EC;
  --line: rgba(90, 68, 61, .12);
  --line-strong: rgba(90, 68, 61, .22);
  --danger: #B4441A;
  --ok: #037A65;

  --stripe: linear-gradient(90deg, var(--c1) 0 16.66%, var(--c2) 0 33.33%, var(--c3) 0 50%, var(--c4) 0 66.66%, var(--c5) 0 83.33%, var(--c6) 0);
  --ring: conic-gradient(from 200deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5), var(--c6), var(--c1));
  --glow: radial-gradient(circle at 92% 8%, rgba(4,160,132,.16), transparent 38%),
          radial-gradient(circle at 6% 12%, rgba(27,102,144,.14), transparent 36%),
          radial-gradient(circle at 10% 95%, rgba(247,162,28,.16), transparent 38%),
          radial-gradient(circle at 94% 92%, rgba(240,113,34,.13), transparent 36%);
  --dots: radial-gradient(rgba(90,68,61,.07) 1px, transparent 1px);
  --shadow: 0 30px 80px -30px rgba(11,84,104,.25);
  --shadow-sm: 0 10px 30px -18px rgba(11,84,104,.35);

  --f: "Cairo", Tahoma, sans-serif;
  --r-sm: 10px;
  --r: 18px;
  --r-lg: 32px;
  --wrap: 1180px;
  --gap: clamp(16px, 3vw, 28px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 16px/1.8 var(--f);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--f); font-weight: 700; line-height: 1.35; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--c5); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; display: block; }
.hp { position: absolute; inset-inline-start: -9999px; }
.prose { max-width: 68ch; white-space: normal; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 1rem/1 var(--f); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-deep); color: var(--white); }
.btn-gold { background: var(--c5); color: #3B2708; font-weight: 700; }
.btn-gold:hover { background: #E8930F; color: #3B2708; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: var(--white); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: var(--white); border-color: rgba(255,255,255,.45); }
.btn-ghost-light:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-danger { color: var(--danger); }
.link-quiet { color: var(--primary); font-weight: 600; text-decoration: none; }
.link-quiet:hover { color: var(--accent); text-decoration: underline; }

/* ---------- الترويسة ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header::before { content: ""; display: block; height: 5px; background: var(--stripe); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 20px; }
.brand img { height: 50px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { text-decoration: none; color: var(--text); font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav ul a:hover, .site-nav ul a[aria-current] { color: var(--ink); border-color: var(--c1); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-actions form { margin: 0; }
.nav-actions .btn { min-height: 42px; padding: 0 20px; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .brand img { height: 42px; }
  .nav-toggle { display: grid; gap: 5px; width: 44px; height: 44px; place-content: center; background: var(--white); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
  .nav-toggle span:not(.sr) { width: 20px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px var(--gap) 24px; gap: 16px; box-shadow: var(--shadow-sm); }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-actions { justify-content: space-between; }
}

/* ---------- التنبيهات ---------- */
.flashes { padding-top: 16px; }
.flash { padding: 12px 16px; border-radius: var(--r-sm); border-inline-start: 4px solid; margin: 0 0 10px; background: var(--white); }
.flash-success { background: #E8F6F2; border-color: var(--c1); color: #04574A; }
.flash-error { background: #FDEEE6; border-color: var(--c6); color: #8A3310; }
.flash-info { background: #EAF2F7; border-color: var(--c3); color: #0B4460; }

/* ---------- الصورة الشخصية داخل حلقة البوصلة ---------- */
.arch {
  --w: 58px;
  flex: none; width: var(--w); height: var(--w); border-radius: 50%;
  border: 3px solid transparent;
  background: linear-gradient(var(--white), var(--white)) padding-box, var(--ring) border-box;
  overflow: hidden; display: grid; place-items: center;
}
.arch img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.arch-initial {
  background: linear-gradient(135deg, var(--c3), var(--c1)) padding-box, var(--ring) border-box;
  color: var(--white); font: 700 calc(var(--w) * .4)/1 var(--f);
}
.arch-sm { --w: 44px; border-width: 2px; }
.arch-lg { --w: 96px; border-width: 4px; }
.arch-xl { --w: clamp(108px, 18vw, 148px); border-width: 5px; }
.arch-mark { --w: 64px; border: 0; border-radius: 0; background: url("../img/mark.png") center / contain no-repeat; margin-bottom: 14px; }

/* ---------- الواجهة الرئيسية ---------- */
.hero { position: relative; overflow: hidden; background-color: var(--paper); background-image: var(--glow), var(--dots); background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 22px 22px; }
.hero-mark {
  position: absolute; width: clamp(420px, 52vw, 720px); inset-inline-start: -12%; top: 50%; margin-top: calc(clamp(420px, 52vw, 720px) / -2);
  opacity: .09; pointer-events: none; animation: markSpin 1.6s cubic-bezier(.2,.7,.2,1) both;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; padding-block: clamp(48px, 8vw, 104px); }
.hero h1 { color: var(--ink); font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.5rem); font-weight: 700; line-height: 1.3; max-width: 15ch; margin-bottom: .45em; }
.hero h1 .hl { color: var(--c1); }
.hero .lead { font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); color: var(--muted); max-width: 46ch; }
.hero-facts { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; margin-bottom: 28px; }
.hero-facts::before { content: ""; width: 40px; height: 2px; border-radius: 2px; background: var(--c1); }
.hero-for { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero-for span { color: var(--muted); margin-inline-end: 4px; font-weight: 600; }
.hero-for a { color: var(--text); background: rgba(255,255,255,.8); text-decoration: none; border: 1px solid var(--line-strong); padding: 6px 16px; border-radius: 999px; font-size: .92rem; font-weight: 600; transition: border-color .15s, color .15s; }
.hero-for a:nth-child(6n+2):hover { border-color: var(--c1); color: var(--c1); }
.hero-for a:nth-child(6n+3):hover { border-color: var(--c3); color: var(--c3); }
.hero-for a:nth-child(6n+4):hover { border-color: var(--c5); color: #9A5F05; }
.hero-for a:nth-child(6n+5):hover { border-color: var(--c6); color: var(--c6); }
.hero-for a:nth-child(6n+6):hover { border-color: var(--c2); color: var(--c2); }
.hero-for a:nth-child(6n+1):hover { border-color: var(--c4); color: #3F7A5A; }

.hero-search {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,.82); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: clamp(28px, 4vw, 40px) clamp(22px, 3vw, 36px) clamp(24px, 3vw, 32px);
  display: grid; gap: 14px;
  animation: cardRise .8s cubic-bezier(.2,.7,.2,1) both .15s;
}
.hero-search::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--stripe); }
.hero-search h2 { font-size: 1.3rem; margin: 0 0 4px; }
.hero-search-dot { display: none; }
@keyframes cardRise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes markSpin { from { transform: rotate(-70deg) scale(.85); opacity: 0; } to { transform: none; opacity: .09; } }
@media (prefers-reduced-motion: reduce) { .hero-search, .hero-mark { animation: none; } html { scroll-behavior: auto; } }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: 40px 48px; }
  .hero-mark { width: 520px; margin-top: 0; top: -120px; inset-inline-start: -260px; }
}

/* ---------- الأقسام ---------- */
.section { padding-block: clamp(48px, 7vw, 88px); }
.section-ivory { background: var(--white); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.45rem, 1.2rem + .9vw, 2rem); display: flex; align-items: center; gap: 14px; }
.section-title::before { content: ""; width: 32px; height: 3px; border-radius: 3px; background: var(--c1); flex: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head .section-title { margin: 0; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.steps li { counter-increment: step; position: relative; padding: 28px 24px 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px;
  border-radius: 50%; color: var(--white); font: 800 1.25rem/1 var(--f); background: var(--c1);
}
.steps li:nth-child(2)::before { background: var(--c3); }
.steps li:nth-child(3)::before { background: var(--c5); color: #3B2708; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

.join-band { position: relative; background: linear-gradient(120deg, var(--c2), var(--c3)); color: var(--white); padding-block: clamp(44px, 6vw, 68px); overflow: hidden; }
.join-band::after { content: ""; position: absolute; width: 360px; height: 360px; inset-inline-end: -90px; top: -120px; background: url("../img/mark.png") center / contain no-repeat; opacity: .14; }
.join-grid { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.join-band h2 { color: var(--white); }
.join-band p { color: rgba(255,255,255,.85); max-width: 58ch; margin: 0; }

/* ---------- بطاقات المرشدين ---------- */
.mentor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.mentor-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s, border-color .2s, transform .2s; }
.mentor-card:hover { border-color: rgba(27,102,144,.3); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.mentor-card-head { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.mentor-name { display: block; font: 700 1.08rem/1.45 var(--f); color: var(--ink); }
.mentor-card-head:hover .mentor-name { color: var(--primary); }
.mentor-title { display: block; font-size: .875rem; color: var(--muted); line-height: 1.5; }
.mentor-bio { color: var(--muted); font-size: .93rem; line-height: 1.75; margin: 0; flex: 1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; font-size: .875rem; border-top: 1px solid var(--line); padding-top: 12px; }
.facts dt { color: var(--muted); font-size: .78rem; }
.facts dd { margin: 0; font-weight: 600; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: #EAF2F7; color: var(--c2); border-radius: 999px; padding: 3px 12px; font-size: .82rem; font-weight: 600; }
.chips li:nth-child(3n+2) { background: #E6F5F1; color: #04574A; }
.chips li:nth-child(3n+3) { background: #FEF3E0; color: #7A4A06; }
.chips .chip-more { background: transparent !important; color: var(--muted) !important; }

/* النجوم */
.rating { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; }
.rating b { font-weight: 700; color: var(--text); }
.rating-new { color: var(--muted); font-size: .85rem; }
.stars { position: relative; display: inline-block; line-height: 1; font-size: 1rem; letter-spacing: 1px; color: #E6DED8; white-space: nowrap; }
.stars::before { content: "★★★★★"; }
.stars-fill { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; overflow: hidden; color: var(--c5); }
.stars-fill::before { content: "★★★★★"; }
.stars-sm { font-size: .85rem; }
.stars-lg { font-size: 1.35rem; }

/* ---------- صفحات البحث ---------- */
.page-head { background-color: var(--paper); background-image: var(--glow), var(--dots); background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 22px 22px; border-bottom: 1px solid var(--line); padding-block: clamp(32px, 5vw, 56px); }
.page-head h1 { margin-bottom: .2em; }
.page-head p { color: var(--muted); margin: 0; max-width: 62ch; }
.search-layout { display: grid; grid-template-columns: 290px 1fr; gap: var(--gap); padding-block: 28px 64px; align-items: start; }
.mentor-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.filters { position: sticky; top: 100px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; overflow: hidden; }
.filters::before { content: ""; display: block; height: 4px; margin: -20px -20px 16px; background: var(--stripe); }
.filters summary { font: 700 1.05rem var(--f); color: var(--ink); cursor: pointer; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters form { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 881px) { .filters summary { pointer-events: none; } }
@media (max-width: 880px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters summary::after { content: "+"; float: left; font-size: 1.3rem; line-height: 1; }
  .filters[open] summary::after { content: "−"; }
}
.inline-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding-block: 24px; }
.inline-filters label { flex: 0 1 auto; }
.inline-filters .grow { flex: 1 1 200px; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; text-decoration: none; font-weight: 600; background: var(--white); }
.pager span { background: var(--primary); color: var(--white); border-color: var(--primary); }

.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--white); }
.empty p { color: var(--muted); }
.empty-inline { color: var(--muted); padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); }
.empty-page { text-align: center; padding-block: 80px; display: grid; justify-items: center; }

/* ---------- المواعيد ---------- */
.slot-list { display: grid; gap: 12px; }
.slot { display: grid; grid-template-columns: 68px 1fr auto; gap: 18px; align-items: start; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; background: var(--white); }
.slot-when { width: 68px; height: 72px; border-radius: 16px; background: linear-gradient(145deg, var(--c3), var(--c2)); color: var(--white); display: grid; place-content: center; text-align: center; position: relative; overflow: hidden; }
.slot-when::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--stripe); }
.slot-day { font: 800 1.5rem/1 var(--f); }
.slot-month { font-size: .75rem; font-weight: 600; }
.slot-body h3 { margin: 0 0 4px; }
.slot-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.slot-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--text); }
.slot-mentor { margin: 8px 0 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.slot-desc { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
.slot-cta { display: grid; gap: 8px; justify-items: end; min-width: 160px; }
.price { font: 800 1.1rem var(--f); color: var(--c1); }
.book-box { position: relative; }
.book-box summary { list-style: none; }
.book-box summary::-webkit-details-marker { display: none; }
.book-box[open] form { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: min(320px, 80vw); z-index: 10; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
@media (max-width: 640px) {
  .slot { grid-template-columns: 58px 1fr; }
  .slot-when { width: 58px; height: 64px; }
  .slot-cta { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; }
  .book-box[open] { grid-column: 1 / -1; }
  .book-box[open] form { position: static; width: 100%; margin-top: 10px; box-shadow: none; }
}

/* ---------- ملف المرشد ---------- */
.profile-hero { background-color: var(--paper); background-image: var(--glow), var(--dots); background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 22px 22px; border-bottom: 1px solid var(--line); padding-block: clamp(32px, 6vw, 60px); }
.profile-hero-grid { display: flex; gap: clamp(20px, 4vw, 40px); align-items: center; }
.profile-hero h1 { margin-bottom: .1em; }
.profile-title { color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.profile-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.profile-rating b { font: 800 1.4rem var(--f); color: var(--ink); }
.profile-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text); margin-bottom: 16px; font-weight: 600; }
.profile-facts span + span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c5); margin-inline-end: 10px; vertical-align: middle; }
.profile-hero .btn-ghost-light { color: var(--primary); border-color: var(--primary); background: transparent; }
.profile-hero .btn-ghost-light:hover { background: var(--primary); color: var(--white); }
@media (max-width: 640px) { .profile-hero-grid { flex-direction: column; align-items: flex-start; } }
.profile-layout { display: grid; grid-template-columns: 1fr 300px; gap: clamp(24px, 4vw, 48px); padding-block: 36px 72px; }
.profile-main { min-width: 0; }
.block { margin-bottom: 36px; }
.block h2 { font-size: 1.25rem; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.profile-side .block { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.profile-side .block h2 { font-size: 1rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
@media (max-width: 880px) { .profile-layout { grid-template-columns: 1fr; } .profile-side { order: -1; } }

.rating-summary { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: center; margin-bottom: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.rating-big { display: grid; justify-items: center; gap: 4px; text-align: center; }
.rating-big b { font: 800 2.8rem/1 var(--f); color: var(--ink); }
.rating-big span { color: var(--muted); font-size: .85rem; }
.rating-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rating-bars li { display: grid; grid-template-columns: 56px 1fr 28px; gap: 10px; align-items: center; font-size: .85rem; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c5); border-radius: 99px; }
@media (max-width: 520px) { .rating-summary { grid-template-columns: 1fr; } }
.reviews { list-style: none; padding: 0; margin: 0; }
.reviews li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.reviews li p { margin: 8px 0 4px; }
.reviews li.is-hidden { opacity: .55; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-head .push { margin-inline-start: auto; }

/* ---------- النماذج ---------- */
.form { display: grid; gap: 14px; }
label { display: block; font-size: .92rem; font-weight: 600; color: var(--text); }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; margin-top: 6px; }
.name-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; }
@media (max-width: 520px) { .name-row { grid-template-columns: 1fr; } }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=url],
input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--white); color: var(--text); font: 400 1rem/1.5 var(--f);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,102,144,.18); }
input:disabled { background: var(--soft); color: var(--muted); }
input[type=file] { font: inherit; padding: 8px 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form fieldset:not(.seg-toggle):not(.star-input) { display: grid; gap: 14px; padding-top: 8px; }
legend { font: 700 1.05rem var(--f); color: var(--ink); padding: 0; margin-bottom: 8px; }
.field-label { font-weight: 600; font-size: .92rem; margin: 4px 0 -4px; }
.hint { font-size: .82rem; color: var(--muted); margin: -6px 0 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c1); flex: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.check-grid .check { border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; background: var(--white); }
.check-grid .check:has(input:checked) { border-color: var(--c1); background: #E8F6F2; }

.seg-toggle { position: relative; margin-top: 28px; display: flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px; background: var(--white); }
.seg-toggle legend { position: absolute; top: -28px; inset-inline-start: 0; font: 600 .92rem var(--f); color: var(--text); }
.seg-toggle label { flex: 1; display: block; cursor: pointer; }
.seg-toggle input { position: absolute; opacity: 0; }
.seg-toggle span { display: block; text-align: center; padding: 8px 12px; border-radius: 999px; font-size: .92rem; font-weight: 600; color: var(--muted); }
.seg-toggle input:checked + span { background: var(--primary); color: var(--white); }
.seg-toggle input:focus-visible + span { outline: 3px solid var(--c5); }

/* إدخال النجوم (من اليمين: 1 إلى 5) */
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; position: relative; padding-top: 30px; }
.star-input legend { position: absolute; top: 0; inset-inline-start: 0; font: 600 .92rem var(--f); color: var(--text); }
.star-input input { position: absolute; opacity: 0; }
.star-input label { cursor: pointer; font-size: 2rem; line-height: 1; color: #E6DED8; display: block; }
.star-input label::before { content: "★"; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--c5); }
.star-input input:focus-visible + label { outline: 3px solid var(--c3); border-radius: 4px; }

/* ---------- الدخول والتسجيل ---------- */
.auth { padding-block: clamp(32px, 6vw, 72px); background-color: var(--paper); background-image: var(--glow), var(--dots); background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 22px 22px; }
.auth-card { position: relative; overflow: hidden; width: min(100% - 2 * var(--gap), 480px); margin-inline: auto; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(28px, 5vw, 44px); }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--stripe); }
.auth-wide .auth-card { width: min(100% - 2 * var(--gap), 780px); }
.auth-card h1 { font-size: 1.75rem; margin-bottom: .1em; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-alt { margin: 20px 0 6px; font-size: .92rem; }

/* ---------- اللوحات ---------- */
.panel-head { position: relative; overflow: hidden; background: linear-gradient(120deg, var(--c2), var(--c3)); color: var(--white); padding-block: 30px 68px; }
.panel-head::after { content: ""; position: absolute; width: 300px; height: 300px; inset-inline-end: -70px; top: -90px; background: url("../img/mark.png") center / contain no-repeat; opacity: .14; }
.panel-head .wrap { position: relative; z-index: 1; }
.panel-head h1 { color: var(--white); margin-bottom: .1em; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.panel-head p { margin: 0; color: rgba(255,255,255,.85); }
.panel-head-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.panel { margin-top: -42px; padding-bottom: 72px; position: relative; z-index: 2; }
.panel-tabs { display: flex; gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 6px; overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow-sm); }
.panel-tabs::-webkit-scrollbar { display: none; }
.panel-tabs a { flex: none; padding: 10px 18px; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
.panel-tabs a:hover { background: var(--soft); }
.panel-tabs a[aria-current] { background: #EAF2F7; color: var(--ink); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--c6); color: var(--white); font-size: .75rem; font-weight: 700; margin-inline-start: 4px; }
.panel-body { padding-top: 28px; }
.panel-title { font-size: 1.2rem; margin: 28px 0 14px; }
.panel-body > .panel-title:first-child { margin-top: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; background: var(--white); overflow: hidden; }
.stat::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--c1); }
.stat:nth-child(6n+2)::before { background: var(--c3); }
.stat:nth-child(6n+3)::before { background: var(--c5); }
.stat:nth-child(6n+4)::before { background: var(--c6); }
.stat:nth-child(6n+5)::before { background: var(--c2); }
.stat:nth-child(6n+6)::before { background: var(--c4); }
.stat b { display: block; font: 800 1.8rem/1.2 var(--f); color: var(--ink); }
.stat span { color: var(--muted); font-size: .88rem; }

.booking { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 12px; background: var(--white); }
.booking-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.booking-head > div { flex: 1; min-width: 0; }
.booking-head h3 { margin: 0; }
.booking-head p { margin: 0; font-size: .9rem; }
.reveal { background: #EAF2F7; border-radius: var(--r-sm); padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.reveal p { margin: 2px 0; }
.note { font-size: .9rem; background: var(--paper); border-inline-start: 3px solid var(--c5); padding: 6px 12px; margin: 8px 0; }
.booking-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.booking-actions .grow { flex: 1 1 200px; }
.booking-actions input, .booking-actions .btn { min-height: 44px; }

.badge { display: inline-block; flex: none; padding: 3px 12px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--soft); color: var(--text); white-space: nowrap; }
.badge-pending, .badge-queued, .badge-sending { background: #FEF3E0; color: #7A4A06; }
.badge-confirmed, .badge-active, .badge-open, .badge-sent { background: #E6F5F1; color: var(--ok); }
.badge-completed { background: #EAF2F7; color: var(--c2); }
.badge-rejected, .badge-cancelled, .badge-suspended, .badge-no_show, .badge-failed { background: #FDEEE6; color: var(--danger); }
.badge-closed { background: var(--soft); color: var(--muted); }

.card-form { border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 3vw, 28px); background: var(--white); margin-bottom: 20px; }
.card-form.narrow { max-width: 640px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }
.slot-form-box summary { cursor: pointer; margin: 0; list-style: none; display: flex; justify-content: space-between; }
.slot-form-box summary::-webkit-details-marker { display: none; }
.slot-form-box summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); }
.slot-form-box[open] summary::after { content: "−"; }
.slot-form-box[open] summary { margin-bottom: 16px; }
.avatar-edit { display: flex; gap: 20px; align-items: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.table-wrap:empty { display: none; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
.table th { text-align: start; font-weight: 700; color: var(--muted); background: var(--paper); padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .actions form { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }

/* الإدارة */
.admin-item { border: 1px solid var(--line); border-radius: var(--r); background: var(--white); margin-bottom: 10px; }
.admin-item summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.admin-item summary::-webkit-details-marker { display: none; }
.admin-item-main { flex: 1; min-width: 180px; display: grid; }
.admin-item-main .muted { font-size: .82rem; text-align: start; }
.admin-item-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; margin: 14px 0; font-size: .9rem; }
.kv dt { color: var(--muted); font-size: .8rem; }
.kv dd { margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions .grow { flex: 1 1 200px; }
.admin-actions .btn, .admin-actions input { min-height: 44px; }
.copy-box { display: flex; gap: 8px; margin: 10px 0; }
.copy-box input { flex: 1; font-size: .85rem; min-height: 42px; }
.copy-box .btn { min-height: 42px; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.list-admin { list-style: none; padding: 0; margin: 0 0 14px; max-height: 420px; overflow-y: auto; }
.list-admin li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list-admin li.is-hidden span { color: var(--muted); text-decoration: line-through; }
.list-admin form { margin: 0; }
.inline-add { display: flex; gap: 8px; }
.inline-add .grow { flex: 1; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--white); color: var(--muted); border-top: 1px solid var(--line); }
.site-footer::before { content: ""; display: block; height: 6px; background: var(--stripe); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-block: 44px 28px; }
.footer-grid img { height: 56px; width: auto; margin-bottom: 14px; }
.footer-grid p { max-width: 42ch; font-size: .95rem; }
.footer-grid nav { display: grid; gap: 8px; align-content: start; }
.footer-grid h2 { color: var(--ink); font-size: 1rem; margin-bottom: 4px; }
.footer-grid a { color: var(--text); text-decoration: none; font-size: .95rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-mail { display: inline-flex; margin-top: 4px; padding: 10px 22px; border: 1.5px solid var(--primary); border-radius: 999px; color: var(--primary) !important; font-weight: 700; direction: ltr; }
.footer-mail:hover { background: var(--primary); color: var(--white) !important; }
.footer-base { border-top: 1px solid var(--line); padding-block: 18px; font-size: .85rem; display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; }
.footer-credit a { color: var(--primary); font-weight: 700; }
.footer-credit a:hover { color: var(--accent); }
@media (max-width: 560px) { .footer-base { justify-content: center; text-align: center; } }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div { grid-column: 1 / -1; } }

/* ---------- واتساب ---------- */
.wa-body { background: #E6F5F1; border-radius: 12px 12px 12px 2px; padding: 10px 12px; margin: 8px 0 0; font-size: .85rem; max-width: 360px; white-space: normal; }
.phone-set { display: inline-flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.phone-set input { width: 150px; min-height: 44px; }
.bulk-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: #EAF2F7; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; margin-bottom: 14px; }
.bulk-box p { margin: 0; }
code { font-size: .9em; background: var(--soft); padding: 1px 6px; border-radius: 4px; direction: ltr; unicode-bidi: embed; }


/* ==========================================================
   الشاشة الافتتاحية (نفس حركة فيديو الإنترو)
   ========================================================== */
.intro { display: none; }
.intro-on body { overflow: hidden; }
.intro-on .intro {
  display: flex; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; cursor: pointer;
  background-color: var(--paper); background-image: var(--glow), var(--dots);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 22px 22px;
}
.intro.leave { opacity: 0; transition: opacity .3s ease; }
.intro-center { display: grid; justify-items: center; gap: clamp(22px, 4vw, 40px); width: min(620px, 84vw); }
.intro-logo { position: relative; width: 100%; aspect-ratio: 2122 / 1034; }
.intro-stage { position: absolute; inset: 0; transform-origin: 26.532% 50.484%; }
.il { position: absolute; height: auto; max-width: none; opacity: 0; will-change: transform, opacity; }
.il-c1{left:8.483%;top:0.000%;width:10.603%;transform-origin:170.222% 127.007%;}
.il-c2{left:18.143%;top:0.000%;width:11.263%;transform-origin:74.477% 226.957%;}
.il-c3{left:29.972%;top:10.348%;width:16.965%;transform-origin:-20.278% 199.519%;}
.il-c4{left:1.791%;top:35.977%;width:11.074%;transform-origin:223.404% 46.729%;}
.il-c5{left:0.000%;top:65.667%;width:21.301%;transform-origin:124.558% -65.690%;}
.il-c6{left:20.405%;top:79.110%;width:16.164%;transform-origin:37.901% -137.037%;}
.il-arrow{left:20.829%;top:37.234%;width:12.017%;transform-origin:49.804% 49.832%;}
.il-ar{left:42.177%;top:34.333%;width:56.975%;}
.il-en0{left:43.308%;top:69.439%;width:0.613%;}
.il-en1{left:48.633%;top:69.439%;width:3.346%;}
.il-en2{left:56.503%;top:69.439%;width:3.629%;}
.il-en3{left:64.562%;top:69.439%;width:3.864%;}
.il-en4{left:72.856%;top:69.439%;width:3.063%;}
.il-en5{left:80.254%;top:69.439%;width:3.440%;}
.il-en6{left:88.172%;top:69.439%;width:3.911%;}
.il-en7{left:96.560%;top:69.439%;width:3.440%;}
.intro-stripe { display: flex; width: 46%; height: 7px; }
.intro-stripe span { flex: 1; transform: scaleX(0); transform-origin: right center; }
.intro-stripe span:nth-child(1) { background: var(--c1); --i: 0; }
.intro-stripe span:nth-child(2) { background: var(--c2); --i: 1; }
.intro-stripe span:nth-child(3) { background: var(--c3); --i: 2; }
.intro-stripe span:nth-child(4) { background: var(--c4); --i: 3; }
.intro-stripe span:nth-child(5) { background: var(--c5); --i: 4; }
.intro-stripe span:nth-child(6) { background: var(--c6); --i: 5; }
.intro-skip { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); inset-inline: 0; text-align: center; font-size: .85rem; color: var(--muted); opacity: 0; }

/* التشغيل */
.intro.play .intro-stage { animation: ilStage 1s cubic-bezier(.65, 0, .35, 1) 2s both; }
.intro.play .il-seg { animation: ilSeg .95s cubic-bezier(.3, 1.35, .5, 1) calc(.15s + var(--i) * .1s) both; }
.intro.play .il-arrow { animation: ilNeedle 1.35s ease-out 1.05s both; }
.intro.play .il-ar { animation: ilReveal 1s cubic-bezier(.2, .7, .2, 1) 2.45s both; }
.intro.play .il-en { animation: ilRise .55s cubic-bezier(.2, .7, .2, 1) calc(3.15s + var(--i) * .06s) both; }
.intro.play .intro-stripe span { animation: ilStripe .5s cubic-bezier(.16, 1, .3, 1) calc(3.95s + var(--i) * .07s) both; }
.intro.play .intro-skip { animation: ilFade .4s ease 1.2s both; }
.intro.play { animation: ilOut .6s ease 5s both; }

@keyframes ilStage { from { transform: translate(23.468%, -.484%) scale(1.45); } to { transform: none; } }
@keyframes ilSeg { 0% { opacity: 0; transform: rotate(-130deg) scale(.35); } 45% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes ilNeedle {
  0% { opacity: 0; transform: rotate(-170deg) scale(0); }
  18% { opacity: 1; transform: rotate(55deg) scale(1.12); }
  36% { transform: rotate(-22deg) scale(.98); }
  54% { transform: rotate(9deg) scale(1); }
  72% { transform: rotate(-3deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes ilReveal { 0% { opacity: 0; clip-path: inset(0 0 0 100%); transform: translateX(5%); } 30% { opacity: 1; } 100% { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@keyframes ilRise { from { opacity: 0; transform: translateY(45%); } to { opacity: 1; transform: none; } }
@keyframes ilStripe { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ilFade { to { opacity: 1; } }
@keyframes ilOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .intro-on .intro { display: none; } .intro-on body { overflow: auto; } }

/* ==========================================================
   الإصدار 3: الرسائل، الاستعادة بالجوال، نموذج المرشد
   ========================================================== */
.req { color: var(--c6); font-weight: 700; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: .88rem; }
.btn-lg { min-height: 54px; padding: 0 34px; font-size: 1.08rem; }
.forgot-link { justify-self: start; font-size: .88rem; font-weight: 600; margin-top: -6px; }
.otp { text-align: center; font-size: 1.6rem !important; letter-spacing: .5em; font-weight: 700; }
.field { display: grid; gap: 6px; align-content: start; }
.field .field-label { margin: 0; }

/* قائمة منسدلة متعددة الاختيار */
.multi-drop { position: relative; }
.multi-drop summary {
  list-style: none; cursor: pointer; min-height: 48px; padding: 10px 16px 10px 40px; border: 1px solid var(--line-strong);
  border-radius: 12px; background: var(--white); color: var(--muted); display: flex; align-items: center; position: relative;
}
.multi-drop summary::-webkit-details-marker { display: none; }
.multi-drop summary::after { content: ""; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-left: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.multi-drop[open] summary::after { transform: rotate(135deg); margin-top: -1px; }
.multi-drop.has-value summary { color: var(--text); font-weight: 600; }
.multi-drop[open] summary, .multi-drop summary:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,102,144,.18); outline: none; }
.multi-drop.is-invalid summary { border-color: var(--c6); box-shadow: 0 0 0 3px rgba(240,113,34,.18); }
.md-list { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 6px); background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; max-height: 300px; overflow-y: auto; display: grid; gap: 2px; }
.md-list .check { padding: 9px 10px; border-radius: 10px; }
.md-list .check:hover { background: var(--soft); }
.md-list .check:has(input:checked) { background: #E8F6F2; }

/* لوحات: أزرار الرأس وبطاقات المحادثات */
.panel-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel-head-actions .count { background: var(--c6); }
.conv-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.conv-cards a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--text); }
.conv-cards a:hover { border-color: rgba(27,102,144,.3); box-shadow: var(--shadow-sm); }
.conv-cards a > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.conv-cards b { color: var(--ink); }
.conv-cards .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.nav-msgs { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-weight: 600; }
.nav-msgs:hover { color: var(--ink); }
.nav-msgs .count { margin: 0; }

/* ملف المرشد */
.profile-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.review-form { margin-top: 20px; }
.review-form h3 { margin: 0; }

/* ---------- شاشة الرسائل (بأسلوب واتساب) ---------- */
body.is-chat .site-footer { display: none; }
.chat-page {
  display: grid; grid-template-columns: 340px 1fr; height: calc(100dvh - 79px);
  width: min(100%, 1280px); margin-inline: auto; background: var(--white); border-inline: 1px solid var(--line);
}
.chat-list { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-list-head h1 { font-size: 1.3rem; margin: 0; }
.chat-list ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.chat-item:hover { background: var(--paper); }
.chat-item.is-active { background: #EAF2F7; }
.chat-item-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-item-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-item-top b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-top time { font-size: .75rem; color: var(--muted); flex: none; }
.chat-item-last { font-size: .86rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-empty-list { padding: 24px 18px; color: var(--muted); }

.chat-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background-color: #F4F1EC; background-image: var(--dots); background-size: 20px 20px; }
.chat-placeholder { margin: auto; text-align: center; color: var(--muted); }
.chat-placeholder img { margin: 0 auto 12px; opacity: .35; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--white); border-bottom: 1px solid var(--line); }
.chat-head-main { flex: 1; min-width: 0; display: grid; line-height: 1.4; }
.chat-head-main b { color: var(--ink); }
.chat-head-main span { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { display: none; font-size: 1.4rem; text-decoration: none; color: var(--ink); padding: 0 4px; }
.chat-review { display: block; text-align: center; padding: 8px; background: #FEF3E0; color: #7A4A06; font-weight: 700; font-size: .9rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.chat-review:hover { background: #FDE8C4; color: #7A4A06; }

.chat-log { flex: 1; overflow-y: auto; padding: 18px clamp(12px, 4vw, 48px); display: flex; flex-direction: column; gap: 4px; }
.chat-hint { margin: auto; max-width: 380px; text-align: center; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; color: var(--muted); font-size: .92rem; }
.chat-day { align-self: center; margin: 10px 0 6px; }
.chat-day span { display: inline-block; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px; font-size: .78rem; color: var(--muted); }
.bubble { max-width: min(75%, 560px); padding: 7px 12px 5px; border-radius: 12px; box-shadow: 0 1px 1px rgba(90,68,61,.08); position: relative; }
.bubble p { margin: 0; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.7; }
/* في الواجهة العربية: رسائلي على اليسار، ورسائل الطرف الآخر على اليمين */
.bubble.theirs { align-self: flex-start; background: var(--white); border-start-start-radius: 4px; }
.bubble.mine { align-self: flex-end; background: #D9F1EA; border-start-end-radius: 4px; }
.bubble.is-mentor { background: #E4EEF5; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.tick { display: inline-block; width: 16px; height: 10px; position: relative; }
.tick::before { content: "✓"; position: absolute; inset-inline-start: 0; top: -5px; font-size: .8rem; color: var(--muted); }
.tick.read::before { content: "✓✓"; color: var(--c3); letter-spacing: -3px; }

.chat-composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--white); border-top: 1px solid var(--line); }
.chat-composer .grow { flex: 1; }
.chat-composer textarea { min-height: 46px; max-height: 160px; resize: none; border-radius: 24px; padding: 11px 18px; line-height: 1.5; }
.chat-send { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--c1); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .15s; }
.chat-send:hover { background: #038A71; }
.chat-closed { margin: 0; padding: 14px; text-align: center; background: var(--white); border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 760px) {
  .chat-page { grid-template-columns: 1fr; height: calc(100dvh - 79px); border: 0; }
  .chat-page.has-thread .chat-list { display: none; }
  .chat-page:not(.has-thread) .chat-thread { display: none; }
  .chat-back { display: block; }
  .bubble { max-width: 86%; }
}

/* الحقول داخل الصفوف الأفقية لا تحتاج مسافة علوية */
.inline-filters label > *, .phone-set label > *, .admin-actions label > *, .booking-actions label > *, .inline-add label > *, .chat-composer label > *, .copy-box label > * { margin-top: 0 !important; }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1DA851; color: #fff; }