/* =========================================================
   SPC Physical Therapy Clinic — Design system
   Logical properties are used everywhere so RTL/LTR flip automatically.
   ========================================================= */
:root {
  --blue: #2466ae;
  --blue-d: #1a4d85;
  --blue-l: #e8f0fa;
  --teal: #2f9c92;
  --teal-l: #7ecbc4;
  --mint: #e7f5f3;
  --peach: #f3c79c;
  --peach-l: #fdf1e6;
  --ink: #17283a;
  --muted: #5d6b7a;
  --line: #e2e8ef;
  --bg: #f6f9fb;
  --white: #fff;
  --danger: #d64545;
  --danger-l: #fdecec;
  --success: #2f9c62;
  --success-l: #e6f6ee;
  --warn: #c98a1b;
  --warn-l: #fdf4e3;
  --radius: 18px;
  --radius-sm: 12px;
  --leaf: 90px 16px 90px 16px;
  --leaf-sm: 40px 10px 40px 10px;
  --shadow: 0 10px 30px rgba(23, 40, 58, .08);
  --shadow-lg: 0 24px 60px rgba(23, 40, 58, .14);
  --header-h: 78px;
  --font-en: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-en);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.45; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Intro / preloader ---------- */
html.show-intro body { overflow: hidden; }
html.show-intro body::before {
  content: ""; position: fixed; inset: 0; background: #fff; z-index: 9998;
}
#preloader {
  position: fixed; inset: 0; z-index: 9999; background: #fff;
  display: grid; place-items: center;
  transition: opacity .6s ease, visibility .6s ease;
}
#preloader.done { opacity: 0; visibility: hidden; }
#preloader::after {
  content: ""; position: absolute; inset-inline-end: 0; top: 0; width: 6px; height: 0;
  background: var(--teal); animation: sideBar 2.4s ease forwards;
}
@keyframes sideBar { to { height: 100%; } }
.intro-logo { width: min(220px, 55vw); }
.intro-logo .petal {
  transform-box: view-box; transform-origin: 50px 50px;
  opacity: 0; transform: scale(.2) rotate(-120deg);
  animation: petalIn .9s cubic-bezier(.2, .9, .25, 1.2) forwards;
}
.intro-logo .petal:nth-child(1) { animation-delay: .15s; }
.intro-logo .petal:nth-child(2) { animation-delay: .35s; }
.intro-logo .petal:nth-child(3) { animation-delay: .55s; }
.intro-logo .petal:nth-child(4) { animation-delay: .75s; }
@keyframes petalIn { to { opacity: 1; transform: scale(1) rotate(0); } }
.intro-logo .petals { transform-box: view-box; transform-origin: 50px 50px; animation: spinSettle 1.6s .2s ease-out; }
@keyframes spinSettle { from { transform: rotate(-45deg); } to { transform: rotate(0); } }
.intro-logo .word {
  font-family: var(--font-en); font-weight: 800; font-size: 34px; letter-spacing: 6px;
  fill: transparent; stroke: #5b5557; stroke-width: 1.2;
  stroke-dasharray: 260; stroke-dashoffset: 260;
  animation: drawWord 1.1s 1.05s ease forwards, fillWord .5s 1.8s ease forwards;
}
@keyframes drawWord { to { stroke-dashoffset: 0; } }
@keyframes fillWord { to { fill: #5b5557; stroke-width: 0; } }
.intro-logo .tag {
  font-family: var(--font-en); font-size: 7.2px; letter-spacing: 2.4px; fill: var(--teal);
  opacity: 0; animation: fadeUp .6s 2s ease forwards;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.5em; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(36, 102, 174, .28); }
.btn-primary:hover { background: var(--blue-d); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 8px 20px rgba(47, 156, 146, .28); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-light { background: #fff; color: var(--blue); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: var(--danger-l); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-l); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: .45em 1em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(23, 40, 58, .05); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand svg { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--font-en); font-size: 1.35rem; letter-spacing: 3px; color: #5b5557; }
.brand-text small { font-size: .7rem; color: var(--teal); font-weight: 600; }
.main-nav { display: flex; gap: 4px; margin-inline: auto; }
.main-nav a {
  padding: .5em .9em; border-radius: 999px; font-weight: 600; color: var(--muted); font-size: .95rem;
  transition: color .2s, background .2s;
}
.main-nav a:hover { color: var(--blue); }
.main-nav a.active { color: var(--blue); background: var(--blue-l); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .45em .9em;
  font-weight: 700; cursor: pointer; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center;
}
.lang-btn:hover { border-color: var(--teal); color: var(--teal); }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 4px; background: #fff; cursor: pointer; font-weight: 700; font-size: .88rem;
}
html[dir="rtl"] .user-chip { padding: 4px 4px 4px 12px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint); color: var(--teal); font-weight: 800; font-size: .85rem; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.dropdown {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: #fff; min-width: 200px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a, .dropdown button {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: .6em .8em; border-radius: 8px;
  background: none; border: 0; cursor: pointer; font-weight: 600; font-size: .9rem; text-align: start;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); color: var(--blue); }
.menu-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; padding: 6px; }

@media (max-width: 1020px) {
  .main-nav {
    position: fixed; inset-inline: 0; top: var(--header-h); background: #fff; flex-direction: column;
    padding: 16px 20px 24px; gap: 4px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateY(-120%); transition: transform .35s ease; margin: 0; z-index: -1;
  }
  .main-nav.open { transform: none; }
  .main-nav a { padding: .8em 1em; }
  .menu-toggle { display: block; }
  .header-actions .btn-book { display: none; }
  .header-inner { gap: 10px; }
  .brand { margin-inline-end: auto; }
}
@media (max-width: 480px) {
  .brand-text small { display: none; }
  .user-chip span.name { display: none; }
  .user-chip { padding: 4px !important; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 60px 0 90px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); }
.hero::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: var(--leaf);
  background: var(--mint); inset-inline-end: -140px; top: -120px; transform: rotate(12deg); opacity: .7;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 50px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: var(--peach-l); color: #a4622a;
  padding: .4em 1em; border-radius: 999px; font-weight: 700; font-size: .85rem; margin-bottom: 18px;
}
.eyebrow i { color: var(--peach); }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; }
.hero h1 .accent { color: var(--blue); position: relative; white-space: nowrap; }
.hero h1 .accent::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .08em; height: .28em; background: var(--teal-l);
  opacity: .45; z-index: -1; border-radius: 6px;
}
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 38px; }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.9rem; font-weight: 800; color: var(--ink); font-family: var(--font-en); }
.hero-stats span { color: var(--muted); font-size: .9rem; }
.hero-media { position: relative; }
.hero-media .main-img {
  border-radius: var(--leaf); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/3.4;
}
.hero-media .main-img img { width: 100%; height: 100%; object-fit: cover; }
.float-card {
  position: absolute; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 14px 18px; display: flex; gap: 12px; align-items: center; animation: floaty 5s ease-in-out infinite;
}
.float-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.float-card b { display: block; font-size: .95rem; }
.float-card small { color: var(--muted); font-size: .8rem; }
.float-card.one { bottom: -26px; inset-inline-start: -20px; }
.float-card.two { top: 24px; inset-inline-end: -18px; animation-delay: -2.5s; }
@keyframes floaty { 50% { transform: translateY(-10px); } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
  .float-card.two { inset-inline-end: 8px; }
  .float-card.one { inset-inline-start: 8px; }
}

/* ---------- Sections ---------- */
section { padding: 90px 0; }
.section-alt { background: var(--bg); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head.start { margin-inline: 0; text-align: start; }
.section-head .kicker {
  color: var(--teal); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: 2px;
  display: inline-flex; align-items: center; gap: 8px;
}
html[lang="ar"] .section-head .kicker { letter-spacing: 0; font-size: .95rem; }
.section-head .kicker::before { content: ""; width: 18px; height: 18px; border-radius: 10px 3px 10px 3px; background: var(--teal-l); }
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 800; margin-top: 8px; }
.section-head p { color: var(--muted); }
.head-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.head-row .section-head { margin: 0; }

/* page banner */
.page-banner {
  position: relative; padding: 70px 0 60px; background: var(--ink); color: #fff; overflow: hidden;
}
.page-banner .banner-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; pointer-events: none;
}
.page-banner::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: var(--leaf);
  background: var(--blue); opacity: .35; inset-inline-end: -60px; bottom: -160px; transform: rotate(18deg);
}
.page-banner .container { position: relative; z-index: 1; }
.page-banner h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.page-banner p { color: rgba(255, 255, 255, .8); max-width: 620px; margin: 0; }
.crumbs { display: flex; gap: 8px; font-size: .9rem; color: rgba(255, 255, 255, .7); margin-bottom: 10px; }
.crumbs a:hover { color: #fff; }

/* grids */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* cards */
.card { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 26px; }
.card-shadow { box-shadow: var(--shadow); border-color: transparent; }
.feature { transition: transform .3s, box-shadow .3s; }
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature .ic {
  width: 58px; height: 58px; border-radius: var(--leaf-sm); display: grid; place-items: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.ic-blue { background: var(--blue-l); color: var(--blue); }
.ic-teal { background: var(--mint); color: var(--teal); }
.ic-peach { background: var(--peach-l); color: #c0772f; }
.ic-ink { background: #edf0f4; color: var(--ink); }

/* service card */
.service-card {
  background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .3s, box-shadow .3s;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service-card .thumb { aspect-ratio: 16/10; overflow: hidden; position: relative; }
.service-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.service-card:hover .thumb img { transform: scale(1.06); }
.service-card .thumb .ic {
  position: absolute; bottom: -22px; inset-inline-start: 22px; width: 50px; height: 50px; border-radius: 14px;
  background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 1.2rem; box-shadow: var(--shadow);
}
.service-card .body { padding: 34px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.service-card h3 { font-size: 1.1rem; }
.service-card p { color: var(--muted); font-size: .93rem; flex: 1; }
.service-card .more { color: var(--blue); font-weight: 700; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; }

/* service detailed row */
.service-row { display: grid; grid-template-columns: 1fr 1.1fr; gap: 50px; align-items: center; }
.service-row + .service-row { margin-top: 80px; }
.service-row:nth-child(even) .media { order: 2; }
.service-row .media { border-radius: var(--leaf); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/3; }
.service-row .media img { width: 100%; height: 100%; object-fit: cover; }
.service-row .num { font-family: var(--font-en); font-weight: 800; color: var(--teal-l); font-size: 3rem; line-height: 1; }
.check-list { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list li i { color: var(--teal); margin-top: 5px; }
@media (max-width: 860px) {
  .service-row { grid-template-columns: 1fr; gap: 24px; }
  .service-row:nth-child(even) .media { order: 0; }
}

/* doctor card */
.doctor-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  transition: transform .3s, box-shadow .3s; display: flex; flex-direction: column;
}
.doctor-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.doctor-card .photo { position: relative; aspect-ratio: 1/1; background: linear-gradient(160deg, var(--mint), var(--blue-l)); overflow: hidden; }
.doctor-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.doctor-card .exp {
  position: absolute; top: 14px; inset-inline-start: 14px; background: #fff; border-radius: 999px;
  padding: .3em .8em; font-size: .78rem; font-weight: 700; color: var(--blue); box-shadow: var(--shadow);
}
.doctor-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.doctor-card h3 { font-size: 1.1rem; margin-bottom: 2px; }
.doctor-card .spec { color: var(--teal); font-weight: 700; font-size: .9rem; }
.doctor-card .meta { color: var(--muted); font-size: .85rem; margin: 10px 0 16px; display: grid; gap: 4px; }
.doctor-card .meta span { display: flex; gap: 8px; align-items: center; }
.doctor-card .actions { display: flex; gap: 8px; margin-top: auto; }
.doctor-card .actions .btn { flex: 1; }
.initials-avatar {
  width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--font-en);
  font-size: 3.2rem; font-weight: 800; color: var(--blue); background: linear-gradient(160deg, var(--mint), var(--blue-l));
}

/* doctor profile */
.profile-hero { background: var(--bg); padding: 50px 0; }
.profile-top { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; }
.profile-photo { border-radius: var(--leaf); overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow-lg); background: #fff; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-top h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; margin-bottom: 4px; }
.profile-top .spec { color: var(--teal); font-weight: 700; font-size: 1.1rem; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.fact { background: #fff; border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--line); }
.fact small { color: var(--muted); display: block; font-size: .8rem; }
.fact b { font-size: 1rem; }
.profile-body { display: grid; grid-template-columns: 1fr 340px; gap: 30px; padding: 50px 0 90px; }
.cv-block + .cv-block { margin-top: 26px; }
.cv-block h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.cv-block h2 i { color: var(--teal); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-inline-start: 32px; padding-bottom: 18px; }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 4px solid var(--teal-l);
}
.timeline .yr { font-family: var(--font-en); font-weight: 800; color: var(--blue); font-size: .85rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--mint); color: var(--teal); padding: .35em .9em; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.tag.blue { background: var(--blue-l); color: var(--blue); }
.sticky-side { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.days span { text-align: center; font-size: .72rem; padding: 8px 2px; border-radius: 8px; background: var(--bg); color: #9aa6b2; font-weight: 700; }
.days span.on { background: var(--mint); color: var(--teal); }
@media (max-width: 900px) {
  .profile-top, .profile-body { grid-template-columns: 1fr; }
  .profile-photo { max-width: 280px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}

/* steps */
.steps { counter-reset: step; }
.step { position: relative; padding: 30px 26px; }
.step::before {
  counter-increment: step; content: "0" counter(step); font-family: var(--font-en); font-weight: 800;
  font-size: 2.6rem; color: var(--line); position: absolute; top: 14px; inset-inline-end: 20px;
}

/* testimonials */
.quote-card { position: relative; }
.quote-card .stars { color: #f0b429; margin-bottom: 10px; letter-spacing: 2px; }
.quote-card p { color: var(--ink); }
.quote-card .who { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.quote-card .who small { color: var(--muted); display: block; }

/* CTA */
.cta {
  background: linear-gradient(120deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; border-radius: 28px;
  padding: 50px; display: flex; justify-content: space-between; align-items: center; gap: 30px; position: relative; overflow: hidden;
}
.cta::after {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: var(--leaf);
  background: var(--teal); opacity: .45; inset-inline-end: -60px; top: -90px; transform: rotate(20deg);
}
.cta > * { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta p { color: rgba(255, 255, 255, .85); margin: 0; }
.cta .btns { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .cta { flex-direction: column; align-items: flex-start; padding: 34px 24px; } }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about-collage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.about-collage .tall { grid-row: span 2; border-radius: var(--leaf); }
.about-collage .cell { aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 220px; gap: 16px; }
.gallery figure { margin: 0; overflow: hidden; border-radius: var(--radius); position: relative; }
.gallery figure.wide { grid-column: span 2; }
.gallery figure.tall { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery figure:hover img { transform: scale(1.05); }
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.numbers div { text-align: center; padding: 26px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.numbers b { font-family: var(--font-en); font-size: 2.4rem; color: var(--blue); display: block; font-weight: 800; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
}

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 30px; }
.info-item { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.info-item:last-child { border: 0; }
.info-item .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.info-item small { color: var(--muted); display: block; }
.info-item b { font-size: 1.02rem; }
.info-item a b { direction: ltr; unicode-bidi: embed; }
.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); height: 440px; background: var(--bg); }
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .88rem; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .75em 1em; background: #fff;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 102, 174, .12);
}
.field .hint { color: var(--muted); font-size: .8rem; }
.field input[type="email"], .field input[type="tel"], .ltr { direction: ltr; text-align: start; }
html[dir="rtl"] .field input[type="email"], html[dir="rtl"] .field input[type="tel"] { text-align: right; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px;
  padding: .35em .85em; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.checks input { accent-color: var(--teal); }
.alert { padding: .8em 1em; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem; }
.alert-error { background: var(--danger-l); color: var(--danger); }
.alert-success { background: var(--success-l); color: var(--success); }
.alert-info { background: var(--blue-l); color: var(--blue); }

/* auth */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; background: var(--ink) center/cover; color: #fff; display: flex; align-items: flex-end; padding: 50px; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 40, 58, .1), rgba(23, 40, 58, .88)); }
.auth-side > * { position: relative; }
.auth-side h2 { font-size: 2rem; }
.auth-form { display: grid; place-items: center; padding: 40px 20px; }
.auth-form .box { width: 100%; max-width: 440px; }
.auth-form h1 { font-size: 2rem; font-weight: 800; }
.demo-accounts { margin-top: 26px; background: var(--bg); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .85rem; }
.demo-accounts button {
  display: flex; justify-content: space-between; width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; margin-top: 6px; cursor: pointer; font-size: .82rem; gap: 10px;
}
.demo-accounts button:hover { border-color: var(--teal); }
.demo-accounts code { direction: ltr; color: var(--muted); }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Booking ---------- */
.booking-grid { display: grid; grid-template-columns: 1fr 360px; gap: 30px; align-items: start; }
.booking-grid > *, .dash > *, .profile-body > *, .contact-grid > *, .about-grid > * { min-width: 0; }
.book-step { margin-bottom: 22px; }
.book-step .step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.book-step .step-title span {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-family: var(--font-en);
}
.book-step .step-title h2 { font-size: 1.15rem; margin: 0; }
.doctor-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.doctor-pick label {
  display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer; transition: border-color .2s, background .2s;
}
.doctor-pick input { display: none; }
.doctor-pick label:has(input:checked) { border-color: var(--blue); background: var(--blue-l); }
.doctor-pick .avatar { width: 44px; height: 44px; }
.doctor-pick b { display: block; font-size: .9rem; line-height: 1.3; }
.doctor-pick small { color: var(--teal); font-size: .76rem; font-weight: 600; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.date-strip button {
  flex: 0 0 72px; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: .2s;
}
.date-strip button small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.date-strip button b { font-family: var(--font-en); font-size: 1.3rem; line-height: 1.1; }
.date-strip button:hover { border-color: var(--blue); }
.date-strip button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.date-strip button.active small { color: rgba(255, 255, 255, .85); }
.date-strip button.off { opacity: .45; cursor: not-allowed; background: var(--bg); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.slot {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: .6em .3em; cursor: pointer; font-weight: 700;
  font-family: var(--font-en); font-size: .9rem; transition: .2s; direction: ltr;
}
.slot:hover { border-color: var(--teal); color: var(--teal); }
.slot.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.slot.taken {
  background: repeating-linear-gradient(135deg, #f3f5f8, #f3f5f8 6px, #eceff3 6px, #eceff3 12px);
  color: #a3adb8; cursor: not-allowed; text-decoration: line-through;
}
.slot.taken::after { content: attr(data-label); display: block; font-size: .68rem; text-decoration: none; font-family: var(--font-ar); }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-inline-end: 6px; border: 1.5px solid var(--line); }
.legend .taken-i { background: #eceff3; }
.legend .sel-i { background: var(--teal); border-color: var(--teal); }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.summary-row span { color: var(--muted); }
.summary-row b { text-align: end; }
@media (max-width: 960px) { .booking-grid { grid-template-columns: 1fr; } .booking-grid .sticky-side { position: static; } }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - var(--header-h)); background: var(--bg); }
.dash-side { background: #fff; border-inline-end: 1px solid var(--line); padding: 26px 16px; }
.dash-user { display: flex; gap: 12px; align-items: center; padding: 0 8px 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.dash-user .avatar { width: 48px; height: 48px; font-size: 1rem; }
.dash-user b { display: block; line-height: 1.3; }
.dash-user small { color: var(--teal); font-weight: 700; }
.dash-nav { display: grid; gap: 4px; }
.dash-nav button {
  display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: .75em 1em; border-radius: 12px;
  font-weight: 700; color: var(--muted); cursor: pointer; text-align: start; width: 100%; font-size: .93rem;
}
.dash-nav button i { width: 20px; text-align: center; }
.dash-nav button:hover { background: var(--bg); color: var(--ink); }
.dash-nav button.active { background: var(--blue); color: #fff; }
.dash-nav .count { margin-inline-start: auto; background: var(--peach-l); color: #b06a2a; border-radius: 999px; padding: 0 .6em; font-size: .75rem; }
.dash-main { padding: 30px; min-width: 0; }
.dash-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.dash-title h1 { font-size: 1.6rem; margin: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); }
.stat .ic { width: 50px; height: 50px; border-radius: var(--leaf-sm); display: grid; place-items: center; font-size: 1.2rem; }
.stat b { font-family: var(--font-en); font-size: 1.6rem; display: block; line-height: 1.1; }
.stat small { color: var(--muted); font-weight: 600; }
.panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 22px; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.1rem; margin: 0; }
.dash-mobile-tabs { display: none; }
@media (max-width: 1080px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .dash-side { border: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .dash-user { border: 0; padding-bottom: 8px; margin: 0; }
  .dash-nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .dash-nav button { white-space: nowrap; width: auto; }
  .dash-main { padding: 20px 16px; }
}
@media (max-width: 480px) { .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 14px; flex-direction: column; align-items: flex-start; gap: 8px; } }

/* table */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; background: var(--bg); }
html[lang="ar"] .table th { letter-spacing: 0; font-size: .85rem; }
.table tr:last-child td { border-bottom: 0; }
.table td .who { display: flex; gap: 10px; align-items: center; }
.table .actions { display: flex; gap: 6px; }
.badge { display: inline-block; padding: .25em .75em; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-confirmed { background: var(--blue-l); color: var(--blue); }
.badge-completed { background: var(--success-l); color: var(--success); }
.badge-cancelled { background: var(--danger-l); color: var(--danger); }
.num { font-family: var(--font-en); direction: ltr; unicode-bidi: embed; }

/* user-entered text may be English inside Arabic pages (or vice versa): let each value pick its own direction */
.record h3, .record dd, .record p, .table td, .med b, .med small, .info-grid b, .dash-user b, .who b, .summary-row b { unicode-bidi: plaintext; }
html[dir="rtl"] .record dd, html[dir="rtl"] .info-grid b, html[dir="rtl"] .table td { text-align: right; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty i { font-size: 2.2rem; color: var(--line); display: block; margin-bottom: 10px; }

/* record card */
.record { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; position: relative; }
.record + .record { margin-top: 14px; }
.record::before { content: ""; position: absolute; inset-inline-start: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--teal-l); }
.record-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.record-head h3 { font-size: 1.02rem; margin: 0; }
.record-head small { color: var(--muted); }
.record dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: .92rem; }
.record dt { color: var(--muted); font-weight: 600; }
.record dd { margin: 0; }
@media (max-width: 560px) { .record dl { grid-template-columns: 1fr; } .record dt { margin-top: 6px; } }
.med-list { display: grid; gap: 10px; }
.med {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px;
}
.med .pill { width: 42px; height: 42px; border-radius: 12px; background: var(--peach-l); color: #c0772f; display: grid; place-items: center; }
.med small { color: var(--muted); display: block; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-grid div { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.info-grid small { color: var(--muted); display: block; font-size: .8rem; font-weight: 600; }
.info-grid b { font-size: .95rem; word-break: break-word; }
@media (max-width: 760px) { .info-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Case files ---------- */
.t-good { color: var(--success); } .t-ok { color: var(--teal); } .t-low { color: var(--warn); } .t-bad { color: var(--danger); } .t-none { color: var(--muted); }
.badge-case-active { background: var(--mint); color: var(--teal); }
.badge-case-closed { background: #eef1f4; color: var(--muted); }
.case-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.case-search { position: relative; flex: 1 1 320px; }
.case-search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field.case-search input { padding-inline-start: 40px; }
.sym-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sym-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: .3em .85em; font-size: .82rem; font-weight: 700; font-family: inherit;
}
button.sym-chip { cursor: pointer; transition: .2s; }
button.sym-chip:hover { border-color: var(--teal); color: var(--teal); }
.sym-chip b { background: #fff; border-radius: 999px; padding: 0 .5em; font-size: .75rem; color: var(--muted); font-family: var(--font-en); }
.sym-chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.sym-chip.on b { color: var(--teal); }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.case-card {
  display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; transition: .25s; min-width: 0;
}
.case-card:hover { border-color: var(--teal-l); box-shadow: var(--shadow); transform: translateY(-2px); }
.case-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.case-card h3 { font-size: 1.02rem; margin: 0; line-height: 1.45; unicode-bidi: plaintext; }
.case-card .who { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.case-card .who .avatar { width: 30px; height: 30px; font-size: .7rem; }
.case-card > small { font-size: .82rem; }
.case-card .sym-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.case-card .sym-chip { font-size: .75rem; padding: .2em .7em; }
.case-card-foot { margin-top: auto; border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 8px; }
.case-imp { display: flex; justify-content: space-between; align-items: baseline; }
.case-imp small { color: var(--muted); font-weight: 600; }
.case-imp b { font-family: var(--font-en); font-size: 1.25rem; direction: ltr; }
.case-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); font-weight: 600; }
.prog { height: 8px; background: #edf1f5; border-radius: 99px; overflow: hidden; }
.prog span { display: block; height: 100%; border-radius: inherit; transition: width .6s ease; }
.prog-good span { background: var(--success); } .prog-ok span { background: var(--teal); } .prog-low span, .prog-bad span { background: var(--warn); } .prog-none span { background: transparent; }

.case-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.case-layout > div > .panel + .panel { margin-top: 20px; }
.case-actions { flex-wrap: wrap; }
@media (max-width: 1000px) { .case-layout { grid-template-columns: 1fr; } }
.chart-wrap { direction: ltr; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 8px 0; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: #dde4eb; stroke-width: 1; }
.ch-lbl { fill: var(--muted); font-size: 11px; font-family: var(--font-en), var(--font-ar); font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; font-weight: 700; margin: 12px 0 18px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.chart-legend i.ln-solid { width: 20px; height: 0; border-top: 3px solid var(--muted); border-radius: 0; }
.chart-legend i.ln-dash { width: 20px; height: 0; border-top: 2px dashed var(--muted); border-radius: 0; }
.sym-progress { display: grid; gap: 10px; }
.sym-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(140px, 1fr); gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.sym-row-name { display: flex; align-items: center; gap: 8px; }
.sym-row-name i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sym-row-vals { display: flex; gap: 16px; }
.sym-row-vals span { text-align: center; }
.sym-row-vals small { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; }
.sym-row-imp { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.sym-row-imp b { min-width: 48px; text-align: end; }
@media (max-width: 640px) { .sym-row { grid-template-columns: 1fr; gap: 8px; } .sym-row-vals { justify-content: space-between; } }

.session { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; scroll-margin-top: calc(var(--header-h) + 20px); }
.session + .session { margin-top: 14px; }
.session:target { border-color: var(--teal); box-shadow: 0 0 0 3px var(--mint); }
.session-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.session-no { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 10px; background: var(--blue-l); color: var(--blue); font-family: var(--font-en); font-weight: 800; font-size: .85rem; margin-inline-end: 10px; }
.session .lbl { display: block; color: var(--muted); font-weight: 700; font-size: .78rem; margin-bottom: 6px; }
.session p { margin: 10px 0 0; font-size: .92rem; unicode-bidi: plaintext; }
.rating-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rating-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 8px; padding: .3em .7em; font-size: .8rem; font-weight: 600; }
.rating-chip em { font-style: normal; font-weight: 800; font-size: .75rem; font-family: var(--font-en); }
.rating-chip em i { font-size: .65rem; margin-inline-end: 2px; }
.fb-box { margin-top: 12px; border-radius: 12px; padding: 12px 14px; background: var(--mint); }
.fb-box.ov-same { background: var(--warn-l); } .fb-box.ov-worse { background: var(--danger-l); }
.fb-box .rating-chip { background: rgba(255, 255, 255, .75); }
.fb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.fb-head .btn { margin-inline-start: auto; }
.fb-box.ov-better .fb-head > i { color: var(--success); } .fb-box.ov-same .fb-head > i { color: var(--warn); } .fb-box.ov-worse .fb-head > i { color: var(--danger); }
.fb-box.fb-empty { background: var(--bg); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.exam-dl { margin: 0; display: grid; gap: 4px; }
.exam-dl dt { color: var(--teal); font-weight: 700; font-size: .82rem; margin-top: 8px; }
.exam-dl dt:first-child { margin-top: 0; }
.exam-dl dd { margin: 0; font-size: .93rem; unicode-bidi: plaintext; }
.test-list { display: grid; gap: 10px; }
.test { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.test .pill { width: 38px; height: 38px; border-radius: 10px; background: var(--blue-l); color: var(--blue); display: grid; place-items: center; }
.test b, .test p { unicode-bidi: plaintext; }
.test small { display: block; }
.test p { margin: 6px 0 0; font-size: .88rem; }
.fb-feed { display: grid; gap: 8px; }
.fb-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; transition: .2s; }
.fb-item:hover { background: var(--bg); }
.fb-item p { margin: 2px 0 0; font-size: .88rem; unicode-bidi: plaintext; }
.ov-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; }
.ov-dot.ov-better { background: var(--success-l); color: var(--success); } .ov-dot.ov-same { background: var(--warn-l); color: var(--warn); } .ov-dot.ov-worse { background: var(--danger-l); color: var(--danger); }
.fb-alert { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.fb-alert span { flex: 1; }

/* rating sliders */
.rate-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 600px) { .rate-list { grid-template-columns: 1fr; } }
.rate-field { background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.rate-top { display: flex; justify-content: space-between; align-items: center; }
.rate-top label { font-weight: 700; font-size: .9rem; }
.rate-top output { font-weight: 800; color: var(--blue); font-size: 1.1rem; min-width: 28px; text-align: center; }
.rate-field input[type="range"], .sym-edit-row input[type="range"] { width: 100%; accent-color: var(--teal); }
.rate-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-weight: 600; }
.sym-edit-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.sym-base { display: flex; align-items: center; gap: 8px; }
.sym-edit-row output { font-weight: 800; color: var(--blue); min-width: 22px; }
.overall-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.overall-pick label { position: relative; }
.overall-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.overall-pick span { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: .6em 1.1em; cursor: pointer; font-weight: 700; transition: .2s; }
.overall-pick span i { font-size: 1.2rem; }
.overall-pick input:checked + .ov-better { background: var(--success-l); border-color: var(--success); color: var(--success); }
.overall-pick input:checked + .ov-same { background: var(--warn-l); border-color: var(--warn); color: var(--warn); }
.overall-pick input:checked + .ov-worse { background: var(--danger-l); border-color: var(--danger); color: var(--danger); }
.overall-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(23, 40, 58, .5); z-index: 500; display: grid; place-items: center; padding: 20px;
  opacity: 0; animation: fadeIn .2s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 22px; width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg);
  transform: translateY(14px); animation: slideIn .25s forwards;
}
.modal.lg { max-width: 860px; }
@keyframes slideIn { to { transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-close { background: var(--bg); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.form-section-title { font-size: .95rem; color: var(--blue); margin: 10px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); }

/* toast */
.toasts { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 10px; }
html[dir="rtl"] .toasts { transform: translateX(50%); }
.toast {
  background: var(--ink); color: #fff; padding: .8em 1.3em; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: center; animation: toastIn .3s ease; font-size: .93rem;
}
.toast.success i { color: #6fe0a6; }
.toast.error i { color: #ff9a9a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .72); padding: 70px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1fr; gap: 40px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.site-footer .brand-text b { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a:hover { color: #fff; }
.site-footer li { display: flex; gap: 10px; align-items: flex-start; }
.site-footer li i { color: var(--teal-l); margin-top: 5px; width: 16px; }
.socials { display: flex; gap: 8px; margin-top: 18px; }
.socials a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.socials a:hover { background: var(--teal); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 50px; padding: 20px 0; font-size: .88rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Billing & finance
   ========================================================= */
.doctor-card .photo img, .profile-photo img, .avatar img { object-position: center 22%; }

.badge-paid { background: var(--success-l); color: var(--success); }
.badge-unpaid { background: var(--warn-l); color: var(--warn); }
.badge-package { background: var(--mint); color: var(--teal); }
.badge-tx-cash { background: var(--blue-l); color: var(--blue); }
.badge-tx-package { background: var(--mint); color: var(--teal); }
.badge-tx-expense { background: var(--danger-l); color: var(--danger); }
.badge-sub-active { background: var(--success-l); color: var(--success); }
.badge-sub-expired { background: #eef1f4; color: var(--muted); }
.badge-sub-finished { background: var(--peach-l); color: #a8641f; }
td.pos, .pos b { color: var(--success); }
td.neg, .neg b { color: var(--danger); }

/* booking price box */
.price-box { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--blue-l); }
.price-box.muted-box { background: var(--bg); color: var(--muted); font-size: .9rem; }
.price-box.prepaid { background: var(--mint); }
.price-box .price-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.price-box .price-line s { color: var(--muted); }
.price-box .price-line.total b { font-size: 1.35rem; color: var(--blue-d); }
.price-box.prepaid .price-line.total b { color: var(--teal); }
.price-box p { margin: 10px 0 4px; font-weight: 700; color: var(--teal); font-size: .92rem; }
.price-box > small { color: var(--muted); display: block; margin-top: 4px; }

/* patient package */
.pkg-panel { margin-bottom: 20px; }
.pkg-panel h2 i { color: var(--teal); }
.pkg-meter { height: 10px; border-radius: 99px; background: var(--mint); overflow: hidden; }
.pkg-meter span { display: block; height: 100%; background: var(--teal); border-radius: 99px; }

/* finance */
.stat-sub { display: block; font-style: normal; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.stat b .num { font-size: inherit; }
.fin-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.fin-hero > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; border-inline-start: 5px solid var(--blue); }
.fin-hero > div:nth-child(2) { border-inline-start-color: var(--peach); }
.fin-hero > div.pos { border-inline-start-color: var(--success); }
.fin-hero > div.neg { border-inline-start-color: var(--danger); }
.fin-hero > div > small { color: var(--muted); font-weight: 700; display: block; }
.fin-hero b { font-size: 1.7rem; display: block; margin: 4px 0; color: var(--ink); }
.fin-hero .pos b { color: var(--success); }
.fin-hero .neg b { color: var(--danger); }
.fin-hero > div > span { color: var(--muted); font-size: .85rem; }
@media (max-width: 860px) { .fin-hero { grid-template-columns: 1fr; } }

.chart-legend { display: flex; gap: 18px; font-size: .88rem; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.lg-rev { background: var(--blue); }
.lg-exp { background: var(--peach); }
.bar-chart { display: grid; grid-template-columns: auto 1fr; gap: 8px; height: 260px; padding-bottom: 26px; }
.bar-chart .y-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .75rem; color: var(--muted); text-align: right; margin-bottom: -6px; margin-top: -6px; }
.bar-chart .plot { position: relative; display: flex; align-items: flex-end; justify-content: space-around; border-bottom: 1px solid var(--line); }
.bar-chart .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.bar-chart .group { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bar-chart .group small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.bar-chart .bar { display: block; width: clamp(12px, 3vw, 26px); min-height: 2px; border-radius: 4px 4px 0 0; cursor: pointer; transition: opacity .15s; }
.bar-chart .bar.rev { background: var(--blue); }
.bar-chart .bar.exp { background: var(--peach); }
.bar-chart .plot:hover .bar:not(:hover) { opacity: .55; }
.bar-chart .bar:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chart-tip { position: absolute; z-index: 3; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.chart-table { margin-top: 14px; }
.chart-table summary { cursor: pointer; color: var(--blue); font-weight: 700; font-size: .9rem; margin-bottom: 10px; }

.cell-bar { position: relative; min-width: 150px; display: flex; align-items: center; gap: 10px; }
.cell-bar > span { display: block; height: 8px; border-radius: 99px; background: var(--teal-l); flex: 0 0 auto; max-width: 60%; min-width: 2px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: .3em .9em; font-size: .85rem; }

.price-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr 1fr; } }
.pkg-row { grid-template-columns: 1.4fr 1.4fr .8fr 1fr .9fr auto; align-items: end; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 860px) { .pkg-row { grid-template-columns: 1fr 1fr; } }
.money { white-space: nowrap; } .money .num { font-size: 1em; } .money .cur { font-size: .72em; font-weight: 600; opacity: .8; }
.stat small.cur, .summary-row .cur { display: inline; color: inherit; }
