/* ==========================================================================
   ALLODOC design system — MediFlow layout, ALLODOC logo colours
   Logo blues (#005cbb / #0174c8) for accents and gradients, navy #081226 for titles,
   Plus Jakarta Sans, large uniform radii and blue-tinted shadows.
   Logical properties everywhere so RTL (Arabic) works without overrides.
   ========================================================================== */

:root {
  --navy-950: #081226;
  --navy-900: #0d1b33;
  --navy-800: #15294a;
  --navy-700: #233c63;
  --primary-700: #00499a;
  --primary-600: #005cbb;   /* logo blue (dark) — interactive: 6.5:1 on white */
  --primary-500: #0174c8;   /* gradients and accents: 4.8:1 on white */
  --primary-200: #bfe3f8;
  --primary-100: #dcf0fb;
  --primary-50:  #eff8fd;
  --teal-700: #0b7f79;   /* "available" signal: 4.9:1 on white */
  --teal-50:  #f0fdfa;
  --amber-700:#9a5b00;
  --amber-50: #fff6e5;
  --red-700:  #b42318;
  --red-50:   #fef0ee;

  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0d1b33;
  --text-strong: var(--navy-950);
  --muted: #64748b;
  --border: #e3eff8;
  --border-strong: #cbd5e1;

  /* MediFlow uses Plus Jakarta Sans for everything; Arabic falls back to Noto Sans Arabic. */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-ar: "Noto Sans Arabic", "Noto Sans", system-ui, sans-serif;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --bubble: 16px;
  --shadow-sm: 0 1px 2px rgba(8, 18, 38, .05);
  --shadow: 0 10px 30px -10px rgba(0, 92, 187, .15);
  --shadow-lg: 0 25px 50px -12px rgba(0, 92, 187, .25);
  --ring: 0 0 0 3px rgba(0, 92, 187, .3);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body, html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { font-family: var(--font-ar); }
html[dir="rtl"] [data-bubble] { border-radius: 18px; }

img, svg { display: block; max-width: 100%; }
a { color: var(--primary-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text-strong); line-height: 1.2; margin: 0 0 var(--s3); letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 var(--s4); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.icon { display: inline-block; vertical-align: -0.2em; width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--navy-950); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.stack > * + * { margin-top: var(--s4); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.section { padding: var(--s7) 0; }
@media (min-width: 900px) { .section { padding: var(--s8) 0; } }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-600); margin-bottom: var(--s2); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: var(--s4); height: 68px; }
.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.brand-mark { width: 64px; height: 64px; }
.brand-word { width: auto; height: 22px; }
.nav { display: none; gap: 4px; margin-inline-start: var(--s4); }
.nav a { white-space: nowrap; color: var(--text); text-decoration: none; font-weight: 600; font-size: .9375rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--primary-50); color: var(--navy-950); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s2); }
.lang-switch { font-weight: 700; font-size: .875rem; text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); }
.menu-toggle { display: inline-flex; }
@media (min-width: 1100px) { .nav { display: flex; } .menu-toggle { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--border); background: #fff; padding: var(--s3) 16px var(--s4); }
.mobile-nav.open { display: grid; gap: 4px; }
.mobile-nav a { padding: 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.mobile-nav a:hover { background: var(--primary-50); }



/* ---------- Buttons ---------- */
.btn { --bg: var(--primary-600); --fg: #fff; --bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 700; font-size: .9375rem;
  text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:hover { --bg: var(--primary-700); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-dark { --bg: var(--navy-950); } .btn-dark:hover { --bg: var(--navy-800); }
.btn-ghost { --bg: transparent; --fg: var(--text-strong); --bd: var(--border-strong); }
.btn-ghost:hover { --bg: var(--primary-50); --fg: var(--navy-950); }
.btn-quiet { --bg: transparent; --fg: var(--primary-600); padding-inline: 10px; }
.btn-quiet:hover { --bg: var(--primary-50); --fg: var(--primary-700); }
.btn-danger { --bg: #fff; --fg: var(--red-700); --bd: #fecdd3; } .btn-danger:hover { --bg: var(--red-50); --fg: var(--red-700); }
.btn-success { --bg: var(--teal-700); } .btn-success:hover { --bg: #096b66; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; padding: 0; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--s4); }
.label { font-weight: 700; font-size: .875rem; color: var(--text-strong); }
.hint { font-size: .8125rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; color: var(--text-strong);
  background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 36px; }
html[dir="rtl"] .select { background-position: 18px 50%, 13px 50%; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-500); box-shadow: var(--ring); outline: none; }
.input[aria-invalid="true"] { border-color: var(--red-700); }
.field-error { color: var(--red-700); font-size: .8125rem; font-weight: 600; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary-600); flex: none; }
.form-grid { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } .form-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.form-actions { display: flex; gap: var(--s3); justify-content: flex-end; margin-top: var(--s5); flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 800; color: var(--text-strong); margin-bottom: var(--s3); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); }
.card-tight { padding: var(--s4); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.0625rem; }
.divider { height: 1px; background: var(--border); margin: var(--s5) 0; border: 0; }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: .9375rem; margin-bottom: var(--s4); }
.alert .icon { margin-top: 3px; }
.alert-info { background: var(--primary-50); border-color: var(--primary-100); color: var(--navy-900); }
.alert-success { background: var(--teal-50); border-color: #99f6e4; color: #064e4a; }
.alert-warning { background: var(--amber-50); border-color: #f5d9a8; color: #6b3f00; }
.alert-error { background: var(--red-50); border-color: #f6cbc6; color: #7a1a12; }
.alert p:last-child { margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: .75rem; font-weight: 700; border-radius: 999px; background: var(--primary-50); color: var(--primary-700); white-space: nowrap; line-height: 1.6; }
.badge .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.badge-verified { background: var(--primary-50); color: var(--primary-700); }
.badge-available { background: var(--teal-50); color: var(--teal-700); }
.badge-listed { background: #f1f5f9; color: #475569; }
.badge-demo { background: var(--amber-50); color: var(--amber-700); }
.badge-danger { background: var(--red-50); color: var(--red-700); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--amber-700); } .status-confirmed { color: var(--teal-700); }
.status-cancelled, .status-no_show { color: var(--red-700); } .status-completed { color: var(--muted); } .status-rescheduled { color: var(--muted); }

.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto var(--s3); color: var(--primary-500); stroke-width: 1.5; }
.empty h3 { margin-bottom: 6px; }

/* ---------- Hero / search ---------- */
.hero { position: relative; overflow: hidden; padding: var(--s7) 0 var(--s8); background:
  radial-gradient(900px 400px at 85% -10%, rgba(0, 92, 187,.16), transparent 60%),
  radial-gradient(700px 360px at -10% 110%, rgba(11,127,121,.10), transparent 60%), var(--bg); }
.hero-inner { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 1180px) { .hero-inner { grid-template-columns: 1.4fr .6fr; } }
.hero h1 { max-width: 16ch; }
.hero h1 span { color: var(--primary-500); }
.hero-sub { font-size: 1.125rem; color: var(--muted); max-width: 52ch; }
.hero-art { display: none; }
@media (min-width: 1180px) { .hero-art { display: block; } }
.bubble-stack { position: relative; height: 340px; }
.bubble { position: absolute; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--bubble); padding: 16px 18px; }
html[dir="rtl"] .bubble { border-radius: 18px; }
.bubble-a { inset-inline-start: 0; top: 10px; width: 270px; }
.bubble-b { inset-inline-end: 0; top: 140px; width: 250px; background: var(--navy-950); color: #fff; border-color: var(--navy-950); }
.bubble-c { inset-inline-start: 40px; bottom: 0; width: 230px; }
.bubble-dots { display: flex; gap: 6px; } .bubble-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--primary-500); display: block; }
.slot-chip-demo { display: inline-block; padding: 6px 12px; border-radius: 10px; background: var(--teal-50); color: var(--teal-700); font-weight: 700; font-size: .875rem; margin: 4px 4px 0 0; }

.search-panel { margin-top: var(--s5); background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; display: grid; gap: 4px; }
@media (min-width: 900px) { .search-panel { grid-template-columns: 1.3fr 1fr .85fr auto; align-items: center; } }
.search-field { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; }
.search-field:focus-within { background: var(--primary-50); }
.search-field .icon { color: var(--primary-600); }
.search-field label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.search-field input { border: 0; outline: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text-strong); width: 100%; padding: 2px 0; min-height: 28px; }
.search-field input::placeholder { color: #94a3b8; font-weight: 500; }
@media (min-width: 900px) { .search-field + .search-field { border-inline-start: 1px solid var(--border); border-radius: 0; } .search-field + .search-field:focus-within { border-radius: 12px; } }
.search-panel .btn { min-height: 56px; border-radius: 14px; }
.search-compact { box-shadow: var(--shadow-sm); margin: 0; }

.suggest { position: absolute; inset-inline: 0; top: calc(100% + 8px); z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 360px; overflow: auto; }
.suggest.open { display: block; }
.suggest-group { padding: 8px 10px 4px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.suggest a, .suggest button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text-strong); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: start; }
.suggest a small, .suggest button small { color: var(--muted); font-weight: 500; margin-inline-start: auto; }
.suggest a:hover, .suggest [aria-selected="true"], .suggest button:hover { background: var(--primary-50); }

.trust-row { display: flex; gap: var(--s5); flex-wrap: wrap; margin-top: var(--s5); color: var(--muted); font-size: .9375rem; }
.trust-row span { display: inline-flex; gap: 8px; align-items: center; }
.trust-row .icon { color: var(--teal-700); }

/* ---------- Tiles ---------- */
.tile { display: flex; gap: 14px; align-items: center; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); text-decoration: none; color: var(--text-strong); font-weight: 700; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: var(--primary-200); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--navy-950); }
.tile-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); border-radius: 14px; flex: none; }
html[dir="rtl"] .tile-icon { border-radius: 14px; }
.tile small { display: block; font-weight: 500; color: var(--muted); font-size: .8125rem; }
.chip-link { display: inline-flex; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; text-decoration: none; color: var(--text-strong); font-weight: 600; font-size: .9375rem; }
.chip-link:hover { border-color: var(--primary-200); background: var(--primary-50); }
.chip-link small { color: var(--muted); margin-inline-start: 6px; }
.chip-link[aria-current="page"] { border-color: var(--primary-600); background: var(--primary-600); color: #fff; }
.chip-link[aria-current="page"] small { color: rgba(255, 255, 255, .8); }

.steps { counter-reset: step; display: grid; gap: var(--s4); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding: var(--s5); background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--bubble); background: var(--navy-950); color: #fff; font-weight: 800; margin-bottom: var(--s3); }
html[dir="rtl"] .step::before { border-radius: 18px; }
.step p { margin: 0; color: var(--muted); font-size: .9375rem; }

.pro-band { background: var(--navy-950); color: #cbd5e1; border-radius: 28px; padding: var(--s7) var(--s5); display: grid; gap: var(--s5); position: relative; overflow: hidden; }
@media (min-width: 900px) { .pro-band { grid-template-columns: 1.2fr 1fr; padding: var(--s7); align-items: center; } }
.pro-band h2 { color: #fff; }
.pro-band ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pro-band li { display: flex; gap: 10px; align-items: flex-start; }
.pro-band li .icon { color: var(--primary-200); margin-top: 4px; }
.pro-band::after { content: ""; position: absolute; inset-inline-end: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50% 50% 50% 12%; background: rgba(0, 92, 187,.18); }

details.faq { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 0 var(--s5); }
details.faq + details.faq { margin-top: var(--s3); }
details.faq summary { cursor: pointer; padding: var(--s4) 0; font-weight: 700; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; gap: var(--s3); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary-600); }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--muted); }

/* ---------- Doctor card ---------- */
.avatar { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(135deg, var(--primary-100), var(--primary-50)); color: var(--primary-700); font-weight: 800; font-size: 1.25rem; overflow: hidden; }
html[dir="rtl"] .avatar { border-radius: 20px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 112px; height: 112px; font-size: 2rem; border-radius: 30px; }
html[dir="rtl"] .avatar-lg { border-radius: 30px; }
.avatar-sm { width: 40px; height: 40px; font-size: .875rem; border-radius: 12px; }

.doctor-card { display: grid; gap: var(--s4); background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); transition: border-color .15s, box-shadow .15s; }
.doctor-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow); }
@media (min-width: 760px) { .doctor-card { grid-template-columns: minmax(0, 1fr) 260px; } }
.doctor-main { display: flex; gap: var(--s4); min-width: 0; }
.doctor-name { font-size: 1.125rem; font-weight: 800; margin: 0 0 2px; }
.doctor-name a { color: var(--text-strong); text-decoration: none; }
.doctor-name a:hover { color: var(--primary-600); }
.doctor-spec { color: var(--primary-600); font-weight: 700; font-size: .9375rem; margin: 0 0 6px; }
.doctor-meta { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: .9rem; margin: 0 0 var(--s2); }
.doctor-meta .icon { margin-top: 4px; }
.doctor-side { display: grid; gap: var(--s2); align-content: center; padding-top: var(--s4); border-top: 1px dashed var(--border); }
@media (min-width: 760px) { .doctor-side { border-top: 0; padding-top: 0; padding-inline-start: var(--s5); border-inline-start: 1px dashed var(--border); } }
.next-slot { font-size: .875rem; color: var(--muted); }
.next-slot strong { display: block; color: var(--teal-700); font-size: .9375rem; }
.listed-note { font-size: .8125rem; color: var(--muted); }

/* ---------- Search layout ---------- */
.search-layout { display: grid; gap: var(--s5); padding: var(--s5) 0 var(--s7); }
@media (min-width: 1000px) { .search-layout { grid-template-columns: 270px minmax(0, 1fr); align-items: start; } .filters { position: sticky; top: 92px; } }
.filters { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); }
.filters .field + .field { margin-top: var(--s3); }
.filter-toggle { display: inline-flex; }
@media (min-width: 1000px) { .filter-toggle { display: none; } }
@media (max-width: 999px) { .filters:not(.open) { display: none; } }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.results-head h1 { font-size: 1.5rem; margin: 0; }
.result-list { display: grid; gap: var(--s4); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: var(--s6); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: #fff; text-decoration: none; font-weight: 700; color: var(--text-strong); }
.pagination [aria-current="page"] { background: var(--navy-950); color: #fff; border-color: var(--navy-950); }
.breadcrumbs { font-size: .875rem; color: var(--muted); padding-top: var(--s4); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: 6px; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; } .breadcrumbs a:hover { color: var(--primary-600); }

/* ---------- Profile ---------- */
.profile-hero { background: #fff; border-bottom: 1px solid var(--border); padding: var(--s5) 0 var(--s6); }
.profile-head { display: flex; gap: var(--s5); align-items: flex-start; flex-wrap: wrap; margin-top: var(--s4); }
.profile-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 4px; }
.profile-layout { display: grid; gap: var(--s5); padding: var(--s5) 0 var(--s7); }
@media (min-width: 1000px) { .profile-layout { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } .booking-panel { position: sticky; top: 92px; } }
.info-list { display: grid; gap: var(--s4); margin: 0; }
.info-list div { display: flex; gap: 12px; }
.info-list dt { flex: none; color: var(--primary-600); } .info-list dd { margin: 0; }
.info-list dd strong { display: block; color: var(--text-strong); }
.hours-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.hours-table th { text-align: start; font-weight: 600; color: var(--muted); padding: 7px 0; width: 40%; }
.hours-table td { padding: 7px 0; color: var(--text-strong); font-weight: 600; }
.hours-table tr + tr { border-top: 1px solid var(--border); }
.hours-table .today th, .hours-table .today td { color: var(--primary-600); }
.map-frame { width: 100%; height: 240px; border: 0; border-radius: var(--r); background: var(--primary-50); }
.source-note { font-size: .8125rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: var(--s3); margin-top: var(--s4); }

/* ---------- Slot picker ---------- */
.slot-picker { display: grid; gap: var(--s3); }
.slot-days { display: grid; grid-template-columns: 36px 1fr 36px; gap: 6px; align-items: start; }
.slot-days-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.slot-day h4 { margin: 0 0 6px; text-align: center; font-size: .8125rem; font-weight: 700; color: var(--muted); line-height: 1.3; }
.slot-day h4 strong { display: block; color: var(--text-strong); font-size: .875rem; }
.slot-day ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.slot { display: block; width: 100%; padding: 8px 0; border-radius: 10px; border: 0; background: var(--teal-50); color: var(--teal-700); font: inherit; font-weight: 800; font-size: .875rem; text-align: center; cursor: pointer; text-decoration: none; }
.slot:hover { background: var(--teal-700); color: #fff; }
.slot-none { text-align: center; color: #94a3b8; font-size: .875rem; padding: 8px 0; }
.slot-nav { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--text-strong); }
.slot-nav[disabled] { opacity: .35; cursor: default; }
html[dir="rtl"] .slot-nav .icon { transform: scaleX(-1); }
.slot-more { justify-self: center; }
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #f6f8fa 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; height: 36px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: var(--s6) 16px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 1.75rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: #94a3b8; padding: var(--s7) 0 var(--s5); margin-top: var(--s7); font-size: .9375rem; }
.site-footer a { color: #d6e1ec; text-decoration: none; } .site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: var(--s5); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h3 { color: #fff; font-size: .9375rem; margin-bottom: var(--s3); }
.footer-grid .footer-contact, .footer-grid .footer-social { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: 8px; }
.footer-contact li { display: flex; align-items: flex-start; gap: 8px; }
.footer-contact .icon { width: 16px; height: 16px; flex: none; margin-top: 3px; color: #6cc8ee; }
.footer-grid .footer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-social a { display: inline-flex; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; font-size: .8125rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: var(--s6); padding-top: var(--s4); display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; font-size: .8125rem; }

/* ---------- App shell (pro / admin / account) ---------- */
.app { display: grid; min-height: 100vh; }
@media (min-width: 1024px) { .app { grid-template-columns: 256px minmax(0, 1fr); } }
.sidebar { background: #fff; border-inline-end: 1px solid var(--border); padding: var(--s4); display: none; flex-direction: column; gap: var(--s2); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar.open { display: flex; position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; box-shadow: var(--shadow-lg); }
html[dir="rtl"] .sidebar.open { inset: 0 0 0 auto; }
@media (min-width: 1024px) { .sidebar { display: flex; } }
.sidebar .brand { padding: 6px 8px var(--s4); }
.side-label { font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #94a3b8; padding: var(--s3) 10px 4px; }
.side-link { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.side-link:hover { background: var(--bg); color: var(--navy-950); }
.side-link[aria-current="page"] { background: var(--primary-50); color: var(--navy-950); }
.side-link[aria-current="page"] .icon { color: var(--primary-600); }
.side-link .count { margin-inline-start: auto; background: var(--amber-50); color: var(--amber-700); font-size: .75rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.side-foot { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--border); }
.practice-card { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg); }
.practice-card strong { display: block; font-size: .875rem; color: var(--text-strong); line-height: 1.3; }
.practice-card small { color: var(--muted); font-size: .75rem; }
.topbar { height: 64px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s3); padding: 0 16px; position: sticky; top: 0; z-index: 30; }
@media (min-width: 768px) { .topbar { padding: 0 var(--s5); } }
.topbar .menu-toggle { display: inline-flex; }
@media (min-width: 1024px) { .topbar .menu-toggle { display: none; } }
.topbar-title { font-weight: 800; color: var(--text-strong); font-size: 1rem; }
.topbar-actions { margin-inline-start: auto; display: flex; gap: var(--s2); align-items: center; }
.main { padding: var(--s5) 16px var(--s7); min-width: 0; }
@media (min-width: 768px) { .main { padding: var(--s6) var(--s6) var(--s7); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(8, 18, 38,.4); z-index: 55; }
.scrim.open { display: block; }

.kpis { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--s5); }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: var(--s4); }
.kpi-label { font-size: .8125rem; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.kpi-value { font-size: 1.85rem; font-weight: 800; color: var(--text-strong); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: .8125rem; color: var(--muted); }
.dash-grid { display: grid; gap: var(--s4); }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: start; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fafc; }
.table .actions { text-align: end; white-space: nowrap; }
.cell-strong { font-weight: 700; color: var(--text-strong); }
.time-cell { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text-strong); }

.appt-list { list-style: none; margin: 0; padding: 0; }
.appt-item { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: var(--s3); align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.appt-item:first-child { border-top: 0; }
.appt-time { font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.appt-time small { display: block; font-weight: 600; color: var(--muted); font-size: .75rem; }

.tabs { display: inline-flex; gap: 2px; background: #f1f5f9; padding: 3px; border-radius: 12px; }
.tabs a { padding: 7px 14px; border-radius: 10px; font-weight: 700; font-size: .875rem; color: var(--muted); text-decoration: none; }
.tabs a[aria-current="page"] { background: #fff; color: var(--text-strong); box-shadow: var(--shadow-sm); }

/* ---------- Agenda ---------- */
.agenda-toolbar { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s4); }
.agenda-nav { display: flex; gap: 6px; align-items: center; }
.agenda-nav strong { font-size: 1.0625rem; color: var(--text-strong); margin-inline: 8px; text-transform: capitalize; }
html[dir="rtl"] .agenda-nav .icon { transform: scaleX(-1); }
.agenda { --hour: 64px; display: grid; grid-template-columns: 56px repeat(var(--days, 7), minmax(130px, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; }
.agenda-head { position: sticky; top: 0; background: #f8fafc; border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: center; font-size: .8125rem; font-weight: 700; color: var(--muted); z-index: 2; }
.agenda-head strong { display: block; font-size: 1.05rem; color: var(--text-strong); }
.agenda-head.is-today strong { color: #fff; background: var(--primary-600); border-radius: 999px; width: 32px; height: 32px; display: grid; place-items: center; margin: 2px auto 0; }
.agenda-hours { border-inline-end: 1px solid var(--border); }
.agenda-hour { height: var(--hour); font-size: .75rem; color: var(--muted); text-align: end; padding: 0 8px; transform: translateY(-8px); font-variant-numeric: tabular-nums; }
.agenda-col { position: relative; border-inline-end: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--border) calc(var(--hour) - 1px), var(--border) var(--hour)); }
.agenda-col:last-child { border-inline-end: 0; }
.agenda-open { position: absolute; inset-inline: 0; background: rgba(0, 92, 187,.06); }
.agenda-block { position: absolute; inset-inline: 4px; border-radius: 8px; background: repeating-linear-gradient(135deg, #f1f5f9, #f1f5f9 6px, #e2e8f0 6px, #e2e8f0 12px); color: var(--muted); font-size: .75rem; padding: 4px 8px; overflow: hidden; }
.agenda-event { position: absolute; inset-inline: 4px; border-radius: 8px; padding: 4px 8px; font-size: .78rem; line-height: 1.3; overflow: hidden; border-inline-start: 3px solid var(--primary-600); background: var(--primary-50); color: var(--navy-900); text-decoration: none; display: block; }
.agenda-event:hover { box-shadow: var(--shadow); z-index: 3; color: var(--navy-950); }
.agenda-event strong { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-event.status-pending { border-color: var(--amber-700); background: var(--amber-50); }
.agenda-event.status-confirmed { border-color: var(--teal-700); background: var(--teal-50); }
.agenda-event.status-completed { border-color: #94a3b8; background: #f1f5f9; }
.agenda-event.status-no_show { border-color: var(--red-700); background: var(--red-50); }
.agenda-event::before { display: none; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.month-cell { min-height: 108px; padding: 8px; border-inline-end: 1px solid var(--border); border-top: 1px solid var(--border); font-size: .8125rem; }
.month-cell:nth-child(7n) { border-inline-end: 0; }
.month-cell.is-other { background: #f8fafc; color: #94a3b8; }
.month-cell .num { font-weight: 800; color: var(--text-strong); }
.month-cell a { display: block; margin-top: 4px; padding: 2px 6px; border-radius: 6px; background: var(--primary-50); color: var(--navy-900); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-head { padding: 8px; font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--muted); background: #f8fafc; text-align: center; }

dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(8, 18, 38,.45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.125rem; }
.modal-body { padding: var(--s5); }

.rule-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.day-block { padding: var(--s4) 0; border-top: 1px solid var(--border); }
.day-block:first-of-type { border-top: 0; }
.day-block h3 { font-size: 1rem; margin-bottom: var(--s2); }

.notice-medical { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #f4f1fb; border: 1px solid #e0d8f3; color: #3b2a6b; font-size: .875rem; margin-bottom: var(--s4); }
.note-card { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s4); background: #fff; }
.note-card + .note-card { margin-top: var(--s3); }
.note-card dl { display: grid; gap: 8px; margin: var(--s3) 0 0; }
.note-card dt { font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.note-card dd { margin: 0 0 6px; white-space: pre-wrap; }

@media print { .site-header, .site-footer, .sidebar, .topbar { display: none !important; } }

/* Utilities placed last so they win over component display rules. */
.header-actions .hide-sm { display: none; }
@media (min-width: 760px) { .header-actions .hide-sm { display: inline-flex; } }
@media (min-width: 1100px) { .header-actions .menu-toggle { display: none; } }
.app > div { min-width: 0; }

/* Editorial (CMS) content */
.prose { font-size: 1.0625rem; line-height: 1.75; }
.prose h2 { font-size: 1.35rem; margin-top: var(--s6); }
.prose h3 { font-size: 1.125rem; margin-top: var(--s5); }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 var(--s4); }
.prose li + li { margin-top: 6px; }
.prose blockquote { margin: var(--s4) 0; padding: var(--s3) var(--s4); border-inline-start: 3px solid var(--primary-500); background: var(--primary-50); border-radius: 0 10px 10px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: .9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: start; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: var(--s6) 0; }

/* Mobile: a bookable doctor's calendar comes right after the header. */
@media (max-width: 999px) { .booking-panel.booking-first { order: -1; } }

/* ==========================================================================
   Home (ui-ux-pro-max: Marketplace/Directory pattern, calm healthcare palette,
   subtle motion, spacious density). Classes prefixed h- so other pages are untouched.
   ========================================================================== */
.flip-rtl { transition: transform .2s ease; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.h-hero { position: relative; overflow: hidden; padding: 40px 0 32px;
  background:
    radial-gradient(60rem 28rem at 100% -10%, rgba(0, 92, 187,.14), transparent 60%),
    radial-gradient(40rem 22rem at -10% 100%, rgba(11,127,121,.08), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%); }
@media (min-width: 900px) { .h-hero { padding: 72px 0 40px; } }
.h-hero-grid { display: grid; gap: 32px 56px; align-items: center; }
@media (min-width: 1100px) { .h-hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); } }
.h-hero-search { grid-column: 1 / -1; }
@media (min-width: 1100px) { .h-hero-search { margin-top: -8px; } }
.h-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: .8125rem; font-weight: 700; color: var(--primary-700); }
.h-pill .icon { color: var(--primary-500); }
.h-title { font-size: clamp(2.25rem, 5.2vw, 3.75rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; max-width: 15ch; margin-bottom: 18px; text-wrap: balance; }
html[lang="ar"] .h-title { letter-spacing: 0; line-height: 1.3; }
.h-title span { color: var(--primary-600); }
.h-lead { font-size: 1.125rem; line-height: 1.65; color: var(--muted); max-width: 46ch; margin-bottom: 0; }
@media (min-width: 900px) { .h-lead { font-size: 1.25rem; } }
.h-search .search-panel { margin-top: 0; border-radius: 22px; padding: 10px; box-shadow: 0 1px 2px rgba(8, 18, 38,.04), 0 24px 48px -24px rgba(8, 18, 38,.28); }
.h-search .search-panel .btn { border-radius: 16px; }

/* Illustrative preview (decorative) */
.h-preview { display: none; position: relative; padding: 8px 0 44px; max-width: 420px; justify-self: end; width: 100%; }
@media (min-width: 1100px) { .h-preview { display: block; } }
.h-preview-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-lg); }
.h-preview-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.h-preview-avatar { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--primary-100), var(--primary-50)); color: var(--primary-600); }
html[dir="rtl"] .h-preview-avatar { border-radius: 18px; }
.h-preview-avatar .icon { width: 26px; height: 26px; }
.h-preview-lines { flex: 1; display: grid; gap: 8px; }
.h-preview-lines i { display: block; height: 10px; border-radius: 6px; background: #e6edf2; }
.h-preview-lines .w70 { width: 70%; height: 12px; background: #d5e0e8; }
.h-preview-lines .w45 { width: 45%; background: var(--primary-100); }
.h-preview-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.h-preview-label { font-size: .8125rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.h-preview-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.h-preview-slots span { text-align: center; padding: 9px 0; border-radius: 10px; background: var(--teal-50); color: var(--teal-700); font-weight: 800; font-size: .875rem; font-variant-numeric: tabular-nums; }
.h-preview-slots .is-picked { background: var(--teal-700); color: #fff; box-shadow: 0 6px 16px -6px rgba(11,127,121,.6); }
.h-preview-toast { position: absolute; inset-inline-start: -28px; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 12px 16px 12px 12px;
  background: var(--navy-950); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: h-rise .5s .25s ease-out both; }
.h-preview-toast strong { display: block; font-size: .9375rem; }
.h-preview-toast small { color: #b9c7d6; font-size: .8125rem; }
.h-preview-check { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--teal-700); }
@keyframes h-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.h-trust { list-style: none; margin: 40px 0 0; padding: 18px 0 0; border-top: 1px solid var(--border); display: grid; gap: 12px; }
@media (min-width: 760px) { .h-trust { grid-template-columns: repeat(3, auto); justify-content: start; gap: 32px; } }
.h-trust li { display: flex; align-items: center; gap: 10px; font-size: .9375rem; font-weight: 600; color: var(--text); }
.h-trust .icon { color: var(--teal-700); width: 20px; height: 20px; }

/* Sections */
.h-section { padding: 56px 0; }
@media (min-width: 900px) { .h-section { padding: 88px 0; } }
.h-section-flush { padding-top: 0; }
.h-section-tint { background: #fff; border-block: 1px solid var(--border); }
.h-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 32px; }
.h-head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.h-head .eyebrow { margin-bottom: 8px; }
.h-head-sub { color: var(--muted); max-width: 52ch; margin: 10px 0 0; }
.h-head-center { justify-content: center; text-align: center; }
.h-head-center .h-head-sub { margin-inline: auto; }

/* Specialties */
.h-spec-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .h-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .h-spec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.h-spec { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; min-height: 72px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--text-strong);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.h-spec:hover { border-color: var(--primary-200); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--navy-950); }
.h-spec:hover .h-spec-arrow { color: var(--primary-600); }
.h-spec-icon { grid-row: 1 / span 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-50); color: var(--primary-600); }
html[dir="rtl"] .h-spec-icon { border-radius: 14px; }
.h-spec-name { grid-column: 2; font-weight: 700; line-height: 1.3; }
.h-spec-count { grid-column: 2; font-size: .8125rem; color: var(--muted); }
.h-spec-arrow { grid-column: 3; grid-row: 1 / span 2; color: #94a3b8; transition: color .15s; }

/* How to read a profile */
.h-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 900px) { .h-status { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.h-status-item { position: relative; padding: 24px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); }
.h-status-item.is-strong { background: var(--teal-50); border-color: #99f6e4; }
.h-status-item h3 { margin: 14px 0 6px; font-size: 1.0625rem; }
.h-status-item p { margin: 0; color: var(--muted); font-size: .9375rem; line-height: 1.6; }
@media (min-width: 900px) {
  .h-status-item:not(:last-child)::after { content: ""; position: absolute; top: 36px; inset-inline-end: -12px; width: 8px; height: 8px;
    border-top: 2px solid var(--border-strong); border-inline-end: 2px solid var(--border-strong); transform: rotate(45deg); }
  html[dir="rtl"] .h-status-item:not(:last-child)::after { transform: rotate(-45deg); }
}

/* Empty bookable state */
.h-empty { display: grid; gap: 16px; align-items: center; padding: 28px; border-radius: 20px; background: #fff; border: 1px dashed var(--border-strong); }
@media (min-width: 760px) { .h-empty { grid-template-columns: auto minmax(0, 1fr) auto; } }
.h-empty h3 { margin: 0 0 4px; }
.h-empty p { margin: 0; color: var(--muted); }
.h-empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--primary-50); color: var(--primary-600); }
.h-empty-icon .icon { width: 26px; height: 26px; }

/* Steps */
.h-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 900px) { .h-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.h-step { position: relative; padding: 28px 24px 24px; background: #fff; border: 1px solid var(--border); border-radius: 20px; }
.h-step-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--navy-950); color: #fff; margin-bottom: 16px; }
html[dir="rtl"] .h-step-icon { border-radius: 16px; }
.h-step-num { position: absolute; top: 20px; inset-inline-end: 22px; font-family: var(--font-heading); font-size: 2.5rem; font-weight: 800; line-height: 1; color: var(--primary-100); }
.h-step h3 { font-size: 1.125rem; margin-bottom: 6px; }
.h-step p { margin: 0; color: var(--muted); line-height: 1.6; }

/* Governorates */
.h-gov { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .h-gov { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .h-gov { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.h-gov a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid transparent; color: var(--text-strong); font-weight: 600; font-size: .9375rem; text-decoration: none; transition: border-color .15s, background-color .15s; }
.h-gov a:hover { background: var(--primary-50); border-color: var(--primary-200); color: var(--navy-950); }
.h-gov small { min-width: 26px; text-align: center; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--primary-700); font-weight: 800; font-size: .75rem; }

/* Professionals */
.h-pro { position: relative; overflow: hidden; display: grid; gap: 32px; padding: 40px 24px; border-radius: 28px; color: #cbd5e1;
  background: radial-gradient(40rem 20rem at 100% 100%, rgba(0, 92, 187,.35), transparent 60%), var(--navy-950); }
@media (min-width: 900px) { .h-pro { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; padding: 56px; gap: 48px; } }
.h-pro h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.02em; }
.h-pro-copy p { max-width: 50ch; line-height: 1.7; }
.h-pro-eyebrow { color: var(--primary-200); }
.h-pro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.h-btn-light { --bg: #fff; --fg: var(--navy-950); }
.h-btn-light:hover { --bg: var(--primary-50); --fg: var(--navy-950); }
.h-btn-outline { --bg: transparent; --fg: #fff; --bd: rgba(255,255,255,.35); }
.h-btn-outline:hover { --bg: rgba(255,255,255,.08); --fg: #fff; }
.h-pro .btn:focus-visible { box-shadow: 0 0 0 3px rgba(191, 227, 248,.6); }
.h-pro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.h-pro-list li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: #e5edf5; font-weight: 600; }
.h-pro-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 92, 187,.25); color: var(--primary-200); }

/* FAQ */
.h-faq { display: grid; gap: 24px; }
@media (min-width: 1000px) { .h-faq { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; } .h-faq-intro { position: sticky; top: 100px; } }
.h-faq-intro h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }

@media (prefers-reduced-motion: reduce) {
  .h-preview-toast { animation: none; }
  .h-spec, .h-spec:hover { transform: none; }
}

/* ==========================================================================
   Search + doctor card + profile — same language as the home (v2)
   ========================================================================== */
/* ---------- Doctor card ---------- */
.dcard { display: grid; gap: 14px 24px; grid-template-areas: "main" "badges" "side"; background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; transition: border-color .15s, box-shadow .15s; }
.dcard:hover { border-color: var(--primary-200); box-shadow: var(--shadow); }
.dcard.is-bookable { border-inline-start: 4px solid var(--teal-700); }
@media (min-width: 760px) { .dcard { grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "main side" "badges side"; padding: 22px 24px; } }
.dcard-main { grid-area: main; display: flex; gap: 16px; min-width: 0; text-decoration: none; color: inherit; border-radius: var(--r); }
.dcard-avatar { flex: none; width: 60px; height: 60px; display: grid; place-items: center; border-radius: var(--bubble);
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50)); color: var(--primary-700); font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; }
html[dir="rtl"] .dcard-avatar { border-radius: 18px; }
.dcard-body { display: grid; gap: 3px; min-width: 0; align-content: start; }
.dcard-name { font-family: var(--font-heading); font-size: 1.1875rem; font-weight: 800; color: var(--text-strong); line-height: 1.3; overflow-wrap: anywhere; }
.dcard-main:hover .dcard-name { color: var(--primary-600); text-decoration: underline; text-underline-offset: 3px; }
.dcard-spec { color: var(--primary-600); font-weight: 700; font-size: .9375rem; }
.dcard-place, .dcard-clinic { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: .9rem; }
.dcard-place .icon, .dcard-clinic .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; }
.dcard-badges { grid-area: badges; display: flex; flex-wrap: wrap; gap: 6px; padding-inline-start: 76px; }
@media (max-width: 479px) { .dcard-badges { padding-inline-start: 0; } }
.dcard-side { grid-area: side; display: grid; gap: 10px; align-content: center; padding-top: 14px; border-top: 1px dashed var(--border); }
@media (min-width: 760px) { .dcard-side { border-top: 0; padding-top: 0; padding-inline-start: 24px; border-inline-start: 1px dashed var(--border); } }
.dcard-next { margin: 0; display: grid; gap: 2px; font-size: .8125rem; color: var(--muted); }
.dcard-next strong { display: flex; align-items: center; gap: 6px; color: var(--teal-700); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.dcard-next strong .icon { width: 16px; height: 16px; }
.dcard-next.is-none { font-size: .8125rem; line-height: 1.45; }

/* ---------- Search ---------- */
.s-bar { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); padding: 16px 0; }
.s-filters-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 var(--s4); }
.s-filters-title .icon { color: var(--primary-600); width: 18px; height: 18px; }
.s-checks { border: 0; padding: 0; margin: var(--s4) 0; display: grid; gap: 10px; }
.s-checks legend { margin-bottom: 8px; }
.s-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: var(--s4); }
.s-title { font-size: clamp(1.4rem, 2.6vw, 1.875rem); margin: 0 0 4px; }
.s-count { margin: 0; color: var(--muted); font-size: .9375rem; }
.s-count strong { color: var(--text-strong); }
.s-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.s-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-strong); font-weight: 700; font-size: .875rem; text-decoration: none; transition: background .15s, border-color .15s; }
.s-toggle .icon { width: 16px; height: 16px; color: var(--primary-600); }
.s-toggle:hover { border-color: var(--primary-200); background: var(--primary-50); }
.s-toggle.is-on { background: var(--navy-950); border-color: var(--navy-950); color: #fff; }
.s-toggle.is-on .icon { color: #fff; }
.s-intro { color: var(--muted); max-width: 70ch; margin: 0 0 var(--s4); }
.s-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: var(--s4); padding: 12px 14px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--r); }
.s-active-label { font-size: .8125rem; font-weight: 700; color: var(--muted); }
.s-active ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.s-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 8px 4px 12px; border-radius: 999px; background: var(--primary-50);
  color: var(--primary-700); font-weight: 700; font-size: .8125rem; text-decoration: none; max-width: 100%; }
html[dir="rtl"] .s-chip { padding: 4px 12px 4px 8px; }
.s-chip span { overflow-wrap: anywhere; }
.s-chip .icon { flex: none; width: 14px; height: 14px; }
.s-chip:hover { background: var(--primary-100); }
.s-clear { margin-inline-start: auto; font-size: .875rem; font-weight: 700; color: var(--primary-600); }
.s-empty { text-align: center; background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: 48px 24px; }
.s-empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: var(--bubble); background: var(--primary-50); color: var(--primary-600); margin-bottom: 12px; }
.s-empty h2 { font-size: 1.25rem; }
.s-empty p { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.s-empty p.s-empty-suggest { font-weight: 600; color: var(--text-strong); }
.s-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: var(--s4); }

/* ---------- Profile ---------- */
.p-hero { background:
    radial-gradient(50rem 22rem at 100% -20%, rgba(0, 92, 187,.12), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); padding: 4px 0 24px; }
.p-id { display: grid; gap: 16px 24px; grid-template-columns: auto minmax(0, 1fr); align-items: start; margin-top: 20px; }
.p-avatar { width: 88px; height: 88px; display: grid; place-items: center; border-radius: 26px; color: #fff; font-family: var(--font-heading);
  font-weight: 800; font-size: 1.75rem; background: linear-gradient(135deg, var(--primary-500), var(--navy-800)); box-shadow: 0 12px 28px -14px rgba(8, 18, 38,.55); }
html[dir="rtl"] .p-avatar { border-radius: 26px; }
@media (max-width: 559px) { .p-avatar { width: 64px; height: 64px; font-size: 1.25rem; } }
.p-id-body { min-width: 0; }
.p-name { font-size: clamp(1.6rem, 3.4vw, 2.375rem); margin: 0 0 4px; overflow-wrap: anywhere; }
.p-spec { margin: 0 0 6px; color: var(--primary-600); font-weight: 700; font-size: 1.0625rem; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.p-spec-sec { color: var(--muted); font-weight: 600; }
.p-spec-sec::before { content: "·"; margin-inline-end: 10px; color: var(--border-strong); }
.p-place { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 12px; color: var(--muted); }
.p-place .icon { flex: none; width: 16px; height: 16px; margin-top: 4px; }
.p-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.p-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 900px) { .p-id { grid-template-columns: auto minmax(0, 1fr) auto; } .p-actions { grid-column: auto; flex-direction: column; align-items: stretch; min-width: 220px; } }
@media (max-width: 559px) { .p-actions .btn { flex: 1 1 100%; } }
.p-facts { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.p-facts li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); }
.p-facts .icon { flex: none; color: var(--primary-600); width: 18px; height: 18px; margin-top: 2px; }
.p-facts span { display: grid; font-size: .9375rem; color: var(--text-strong); }
.p-facts strong { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
html[lang="ar"] .p-facts strong { text-transform: none; letter-spacing: 0; }

@media (max-width: 999px) { .p-layout { grid-template-columns: minmax(0, 1fr); } }
.p-book .btn { white-space: normal; text-align: center; }
.p-main { display: grid; gap: var(--s4); min-width: 0; }
.p-main > .alert { margin: 0; }
.p-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.p-card-title { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; margin: 0 0 16px; }
.p-card-title .icon { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.p-place-block { display: grid; gap: 16px; }
.p-place-block + .p-place-block { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.p-info { display: grid; gap: 14px; margin: 0; }
.p-info dt { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
html[lang="ar"] .p-info dt { text-transform: none; letter-spacing: 0; }
.p-info dd { margin: 0; display: grid; gap: 2px; }
.p-info dd strong { color: var(--text-strong); }
.p-info dd span { color: var(--muted); font-size: .9375rem; }
.p-phone { font-weight: 800; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.p-map { display: block; height: 280px; }
.p-bio { white-space: pre-line; margin: 0 0 12px; max-width: 72ch; }
.p-sub { font-size: .9375rem; margin: 16px 0 8px; }
.p-quals { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.p-quals li { display: flex; gap: 8px; align-items: flex-start; }
.p-quals .icon { flex: none; width: 16px; height: 16px; margin-top: 4px; color: var(--teal-700); }
.p-fee { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.p-fee span { font-weight: 800; color: var(--text-strong); font-size: 1.125rem; }
.p-fee small { flex-basis: 100%; color: var(--muted); }
.p-hours th { width: 45%; }
.p-hours .today { background: var(--primary-50); }
.p-hours .today th, .p-hours .today td { padding-inline: 10px; }
.p-hours .is-closed td { color: var(--muted); font-weight: 500; }
.p-today { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 999px; background: var(--primary-600); color: #fff; font-size: .6875rem; font-weight: 700; vertical-align: 1px; }
.p-hint { margin: 12px 0 0; }
.p-meta { display: grid; gap: 16px; }
.p-meta-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; }
@media (min-width: 640px) { .p-meta-row { grid-template-columns: auto minmax(0, 1fr) auto; } }
@media (max-width: 639px) { .p-meta-row > .btn, .p-meta-row > .badge { grid-column: 2; justify-self: start; } }
.p-meta-row + .p-meta-row { padding-top: 16px; border-top: 1px solid var(--border); }
.p-meta-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--bg); color: var(--muted); }
.p-meta-row strong { color: var(--text-strong); }
.p-meta-row p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.p-meta .source-note { margin-top: 0; }

.p-book { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.p-book-head { background: var(--navy-950); color: #fff; padding: 18px 22px; }
.p-book-head h2 { color: #fff; font-size: 1.125rem; margin: 0; }
.p-book-head p { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--primary-200); font-size: .875rem; }
.p-book-head .icon { width: 15px; height: 15px; flex: none; }
.p-book > .slot-picker, .p-book > .p-book-off, .p-book > .btn { margin: 20px 22px 0; }
.p-book > :last-child { margin-bottom: 22px; }
.p-book > .btn { width: calc(100% - 44px); }
.p-book > .p-book-alt { margin-top: 10px; }
.p-book .slot { font-variant-numeric: tabular-nums; }
.p-book-trust { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: .8125rem; color: var(--muted); }
.p-book-trust li { display: flex; gap: 8px; align-items: flex-start; }
.p-book-trust .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--teal-700); }
.p-book-off { display: grid; justify-items: center; text-align: center; gap: 10px; color: var(--muted); }
.p-book-off p { margin: 0; }
.p-book-off-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--bubble); background: var(--bg); color: var(--muted); }

/* ---------- Booking flow (v2) ---------- */
.b-wrap { max-width: 1040px; padding-top: 20px; padding-bottom: 64px; }
.b-wrap-narrow { max-width: 680px; }
.b-back { margin-inline-start: -10px; }
.b-steps { list-style: none; display: flex; gap: 8px; margin: 16px 0 20px; padding: 0; counter-reset: none; }
.b-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 700; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--border); min-width: 0; }
.b-steps li.is-done { border-top-color: var(--teal-700); color: var(--teal-700); }
.b-steps li.is-current { border-top-color: var(--primary-600); color: var(--text-strong); }
.b-steps li.is-done.is-current { border-top-color: var(--teal-700); }
.b-step-dot { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--border); color: var(--muted); font-size: .75rem; }
.b-step-dot .icon { width: 14px; height: 14px; stroke-width: 3; }
.is-done .b-step-dot { background: var(--teal-700); color: #fff; }
.is-current:not(.is-done) .b-step-dot { background: var(--primary-600); color: #fff; }
@media (max-width: 479px) { .b-steps li:not(.is-current) span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.b-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 20px; }
.b-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .b-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .b-summary { grid-column: 2; grid-row: 1; position: sticky; top: 92px; } .b-form { grid-column: 1; grid-row: 1; } }

.b-summary { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.b-summary-head { background: var(--navy-950); color: #fff; padding: 18px 20px; }
.b-when { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.b-when > .icon { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--primary-200); }
.b-when > span { display: grid; gap: 2px; }
.b-when strong { font-size: 1rem; color: #fff; }
.b-time { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; justify-self: start; }
.b-doc { display: flex; gap: 12px; align-items: center; padding: 18px 20px 0; }
.b-doc .dcard-avatar { width: 48px; height: 48px; font-size: 1rem; }
.b-doc > div { display: grid; min-width: 0; }
.b-doc-name { font-family: var(--font-heading); font-size: 1.0625rem; color: var(--text-strong); overflow-wrap: anywhere; }
.b-doc-spec { color: var(--primary-600); font-weight: 700; font-size: .875rem; }
.b-place { display: flex; gap: 8px; align-items: flex-start; margin: 14px 20px 18px; font-size: .875rem; color: var(--muted); }
.b-place .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; }
.b-place span { display: grid; }
.b-place strong { color: var(--text-strong); font-weight: 600; }

.b-form { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px 24px 24px; box-shadow: var(--shadow-sm); }
.b-block { border: 0; margin: 0; padding: 20px 0; border-bottom: 1px solid var(--border); display: grid; gap: 12px; min-width: 0; }
.b-legend { display: flex; align-items: center; gap: 10px; padding: 0; font-family: var(--font-heading); font-size: 1.0625rem; font-weight: 700; color: var(--text-strong); margin-bottom: 12px; }
.b-block > .b-legend:not(legend) { margin-bottom: 0; }
.b-num { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--primary-50); color: var(--primary-700); font-size: .8125rem; font-weight: 800; }
.b-options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.b-option { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; }
.b-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.b-option:hover { border-color: var(--primary-200); background: var(--primary-50); }
.b-option:has(input:checked) { border-color: var(--primary-600); background: var(--primary-50); }
.b-option:has(input:focus-visible) { box-shadow: var(--ring); }
.b-option-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--primary-600); border: 1px solid var(--border); }
.b-option-text { display: grid; min-width: 0; flex: 1; }
.b-option-text strong { color: var(--text-strong); overflow-wrap: anywhere; }
.b-option-text small { color: var(--muted); font-size: .8125rem; }
.b-option-check { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--border-strong); color: transparent; }
.b-option-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.b-option:has(input:checked) .b-option-check { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.b-add { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 700; justify-self: start; }
.b-add .icon { width: 16px; height: 16px; }
.b-segment { display: flex; flex-wrap: wrap; gap: 8px; }
.b-segment label { position: relative; cursor: pointer; }
.b-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.b-segment span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--border-strong); font-weight: 700; font-size: .9375rem; color: var(--text-strong); transition: background .15s, border-color .15s; }
.b-segment label:hover span { border-color: var(--primary-200); background: var(--primary-50); }
.b-segment input:checked + span { background: var(--navy-950); border-color: var(--navy-950); color: #fff; }
.b-segment input:focus-visible + span { box-shadow: var(--ring); }
.b-hint { display: flex; gap: 6px; align-items: flex-start; }
.b-hint .icon { flex: none; width: 14px; height: 14px; margin-top: 3px; }
.b-emergency { display: flex; gap: 10px; margin-top: 20px; padding: 12px 14px; border-radius: var(--r); background: var(--red-50); color: var(--red-700); font-size: .9rem; font-weight: 600; }
.b-emergency .icon { flex: none; margin-top: 2px; }
.b-emergency p { margin: 0; }
.b-submit { display: grid; gap: 10px; margin-top: 20px; text-align: center; }
.b-submit .hint { margin: 0; }

.b-done { text-align: center; margin: 12px 0 24px; }
.b-done-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--teal-700); color: #fff; box-shadow: 0 0 0 10px var(--teal-50); margin-bottom: 20px; }
.b-done-icon .icon { width: 34px; height: 34px; stroke-width: 2.6; }
.b-done-icon.is-pending { background: var(--amber-700); box-shadow: 0 0 0 10px var(--amber-50); }
.b-done-icon.is-off { background: var(--muted); box-shadow: 0 0 0 10px var(--bg); }
.b-done h1 { font-size: clamp(1.6rem, 3.4vw, 2.125rem); margin: 0 0 8px; }
.b-done p { color: var(--muted); margin: 0 auto; max-width: 48ch; }
.b-ticket { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.b-ticket-when { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 20px; background: var(--navy-950); color: #fff; }
.b-ticket-when > div { display: grid; flex: 1; min-width: 160px; }
.b-ticket-when > div strong { color: #fff; font-size: 1.0625rem; }
.b-ticket-when > div span { font-family: var(--font-heading); font-weight: 800; font-size: 1.375rem; font-variant-numeric: tabular-nums; justify-self: start; }
.b-ticket-day { flex: none; width: 58px; padding: 6px 0; display: grid; text-align: center; border-radius: 14px; background: #fff; color: var(--primary-700); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
html[dir="rtl"] .b-ticket-day { border-radius: 14px; }
.b-ticket-day strong { font-family: var(--font-heading); font-size: 1.5rem; line-height: 1.1; color: var(--navy-950); }
.b-ticket-when .status { padding: 4px 10px; border-radius: 999px; background: #fff; }
.b-ticket-list { margin: 0; padding: 8px 20px; display: grid; }
.b-ticket-list > div { display: flex; gap: 14px; padding: 14px 0; }
.b-ticket-list > div + div { border-top: 1px dashed var(--border-strong); }
.b-ticket-list dt { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.b-ticket-list dd { margin: 0; display: grid; gap: 2px; min-width: 0; }
.b-ticket-list dd a { text-decoration: none; }
.b-ticket-list dd strong { color: var(--text-strong); }
.b-ticket-list dd span { color: var(--muted); font-size: .9375rem; }
.b-link { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; font-weight: 700; margin-top: 4px; }
.b-link .icon { width: 14px; height: 14px; }
.b-ticket-ref { margin: 0; padding: 12px 20px; background: var(--bg); border-top: 1px solid var(--border); font-size: .8125rem; color: var(--muted); }
.b-ticket-ref code { font-weight: 800; color: var(--text-strong); letter-spacing: .08em; }
.b-after { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; }
.b-after .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.b-done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
@media (max-width: 479px) { .b-done-actions .btn { flex: 1 1 100%; } }

/* ---------- Patient space (v2) ---------- */
.a-section + .a-section { margin-top: 32px; }
.a-title { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; margin: 0 0 12px; }
.a-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--primary-50); color: var(--primary-700); font-size: .75rem; font-weight: 800; }
.a-empty { text-align: center; background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: 40px 24px; }
.a-empty h3 { font-size: 1.0625rem; margin: 0 0 16px; color: var(--muted); font-weight: 600; }
.a-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.a-appt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 18px; align-items: start; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.a-appt.is-next { border-inline-start: 4px solid var(--teal-700); }
@media (min-width: 760px) { .a-appt { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; } }
.a-date { width: 62px; padding: 6px 0; display: grid; text-align: center; border-radius: 14px; background: var(--primary-50); color: var(--primary-700); font-weight: 700; font-size: .6875rem; text-transform: uppercase; }
html[dir="rtl"] .a-date { border-radius: 14px; }
.a-date strong { font-family: var(--font-heading); font-size: 1.625rem; line-height: 1.1; color: var(--navy-950); }
.is-next .a-date { background: var(--teal-700); color: #fff; }
.is-next .a-date strong { color: #fff; }
.a-body { display: grid; gap: 3px; min-width: 0; }
.a-next-label { justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--teal-50); color: var(--teal-700); font-size: .6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
html[lang="ar"] .a-next-label, html[lang="ar"] .a-date { text-transform: none; letter-spacing: 0; }
.a-when { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-strong); font-size: .9375rem; }
.a-when .icon { flex: none; width: 15px; height: 15px; color: var(--muted); }
.a-doc { font-family: var(--font-heading); font-weight: 800; font-size: 1.125rem; color: var(--text-strong); text-decoration: none; overflow-wrap: anywhere; }
.a-doc:hover { color: var(--primary-600); text-decoration: underline; }
.a-meta { margin: 0; color: var(--muted); font-size: .875rem; }
.a-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px dashed var(--border); }
@media (min-width: 760px) { .a-actions { grid-column: auto; padding-top: 0; border-top: 0; flex-direction: column; align-items: stretch; } }
.a-cancel { --fg: var(--red-700); }
.a-cancel:hover { --bg: var(--red-50); --fg: var(--red-700); }
.a-history { padding: 0; overflow: hidden; }

/* ==========================================================================
   Espace pro (v2) — shell polish, dashboard, patients, agenda dialog
   ========================================================================== */
.side-link .icon { color: var(--muted); }
.side-link:hover .icon { color: var(--navy-950); }
.practice-card .avatar-sm { background: var(--primary-100); color: var(--primary-700); font-family: var(--font-heading); font-weight: 800; }
.topbar-title { font-family: var(--font-heading); }
.app .page-head h1 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); }
.app .card { border-radius: var(--r-lg); }

.kpi { box-shadow: var(--shadow-sm); }
.kpi-icon { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
html[dir="rtl"] .kpi-icon { border-radius: 10px; }
.kpi-icon .icon { width: 15px; height: 15px; }
.kpi-icon.is-amber { background: var(--amber-50); color: var(--amber-700); }
.kpi-icon.is-red { background: var(--red-50); color: var(--red-700); }
.kpi-icon.is-teal { background: var(--teal-50); color: var(--teal-700); }
.kpi-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; }
.kpi-row .kpi-value { margin: 0; font-family: var(--font-heading); }
.kpi-link { font-weight: 700; color: var(--primary-600); }

.pd-setup { border: 1px solid var(--primary-200); background: var(--primary-50); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: var(--s5); }
.pd-setup-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.pd-setup-head h2 { font-size: 1.0625rem; margin: 0; }
.pd-setup-head span { font-size: .875rem; font-weight: 700; color: var(--primary-700); font-variant-numeric: tabular-nums; }
.pd-setup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pd-setup-list li { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; font-size: .9rem; font-weight: 600; color: var(--text-strong); }
.pd-setup-list li.is-todo { border-style: dashed; border-color: var(--border-strong); }
.pd-setup-list a { font-weight: 700; }
.pd-tick { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--bubble); background: var(--teal-50); color: var(--teal-700); }
.is-todo .pd-tick { background: var(--bg); color: var(--muted); }
.pd-tick .icon { width: 15px; height: 15px; }

.pd-today { padding-bottom: 0; }
.pd-list, .pp-list { list-style: none; margin: 0; padding: 0; }
.pd-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--border); }
.pd-list li:first-child, .pp-list li:first-child { border-top: 0; }
.pd-time { display: grid; font-variant-numeric: tabular-nums; }
.pd-time strong { color: var(--text-strong); font-weight: 800; }
.pd-time small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.pd-who { display: grid; min-width: 0; }
.pd-who strong { color: var(--text-strong); overflow-wrap: anywhere; }
.pd-who small { color: var(--muted); font-size: .875rem; }
.pd-go { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); }
.pd-go:hover { color: var(--primary-600); border-color: var(--primary-200); background: var(--primary-50); }
.pd-go .icon { width: 17px; height: 17px; }
.pd-foot { margin: 0 calc(-1 * var(--s5)); padding: 14px var(--s5); border-top: 1px dashed var(--border-strong); }
.pd-foot a { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 700; }
.pd-foot .icon { width: 15px; height: 15px; }
.pd-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 0; text-align: center; color: var(--muted); }
.pd-empty p { margin: 0; }
.pd-empty-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--bubble); background: var(--primary-50); color: var(--primary-600); }

.pd-next { border-inline-start: 4px solid var(--teal-700); box-shadow: var(--shadow); }
.pd-eyebrow { font-family: var(--font); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-700); margin: 0 0 12px; }
html[lang="ar"] .pd-eyebrow { text-transform: none; letter-spacing: 0; }
.pd-next-body { display: flex; gap: 16px; align-items: center; }
.pd-date { flex: none; width: 60px; padding: 6px 0; display: grid; text-align: center; border-radius: var(--bubble); background: var(--teal-700); color: #fff; font-size: .6875rem; font-weight: 700; text-transform: uppercase; }
html[dir="rtl"] .pd-date { border-radius: 18px; }
html[lang="ar"] .pd-date { text-transform: none; }
.pd-date strong { font-family: var(--font-heading); font-size: 1.5rem; line-height: 1.1; }
.pd-date.is-muted { background: var(--bg); color: var(--muted); }
.pd-date.is-muted strong { color: var(--text-strong); }
.pd-next-time { margin: 0; font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pd-next-name { font-weight: 700; color: var(--text-strong); text-decoration: none; }
.pd-next-name:hover { color: var(--primary-600); text-decoration: underline; }
.pd-next-meta { margin: 2px 0 0; font-size: .875rem; color: var(--muted); }
.pd-quick { display: grid; gap: 4px; }
.pd-quick a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.pd-quick a:hover { background: var(--bg); color: var(--navy-950); }
.pd-quick-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
html[dir="rtl"] .pd-quick-icon { border-radius: 12px; }
.pd-quick-icon .icon { width: 17px; height: 17px; }

/* Patients */
.pl-card { padding: 0; overflow: hidden; }
.pl-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.pl-search-field { position: relative; flex: 1 1 260px; max-width: 420px; }
.pl-search-field .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.pl-search-field .input { padding-inline-start: 42px; }
.pl-count { margin: 0 0 0 auto; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
html[dir="rtl"] .pl-count { margin: 0 auto 0 0; }
.pl-table { border: 0; border-radius: 0; }
.pl-who { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.pl-who > span:last-child { display: grid; min-width: 0; }
.pl-who strong { color: var(--text-strong); }
.pl-who:hover strong { color: var(--primary-600); text-decoration: underline; }
.pl-who small { color: var(--muted); font-size: .8125rem; }
.pl-avatar { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--bubble); background: var(--primary-50); color: var(--primary-700); font-family: var(--font-heading); font-weight: 800; font-size: .875rem; }
html[dir="rtl"] .pl-avatar { border-radius: 18px; }
.pl-tel { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.pl-origin { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: #f1f5f9; color: #475569; }
.pl-origin .icon { width: 13px; height: 13px; }
.pl-origin.is-blue { background: var(--primary-50); color: var(--primary-700); }
.pl-origin.is-teal { background: var(--teal-50); color: var(--teal-700); }
.pl-date { font-size: .875rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-date.is-today { color: var(--teal-700); font-weight: 700; }
.pl-num { text-align: end; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pl-actions { white-space: nowrap; text-align: end; }
.pl-actions .pd-go { display: inline-grid; margin-inline-start: 4px; }
.pl-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: .875rem; color: var(--muted); }
.pl-note .icon { flex: none; width: 15px; height: 15px; margin-top: 3px; }

/* Patient file */
.pp-back { margin: 0 0 12px; margin-inline-start: -10px; }
.pp-head { margin-bottom: var(--s4); }
.pp-id { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 20px; align-items: start; }
@media (min-width: 1000px) { .pp-id { grid-template-columns: auto minmax(0, 1fr) auto; } }
.pp-avatar { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 24px; color: #fff; font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; background: linear-gradient(135deg, var(--primary-500), var(--navy-800)); box-shadow: 0 12px 28px -14px rgba(8, 18, 38,.55); }
html[dir="rtl"] .pp-avatar { border-radius: 24px; }
@media (max-width: 559px) { .pp-avatar { width: 56px; height: 56px; font-size: 1.125rem; } }
.pp-id-body { min-width: 0; }
.pp-id h1 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); margin: 0; overflow-wrap: anywhere; }
.pp-facts { margin: 4px 0 10px; color: var(--muted); }
.pp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 1000px) { .pp-actions { grid-column: auto; } }
.pp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0 0; }
@media (min-width: 760px) { .pp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pp-stats div { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.pp-stats dt { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.pp-stats dd { margin: 2px 0 0; font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pp-stats dd.is-teal { color: var(--teal-700); }
.pp-title { display: flex; align-items: center; gap: 10px; }
.pp-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.pp-list .pd-date { width: 52px; font-size: .625rem; }
.pp-list .pd-date strong { font-size: 1.25rem; }
.pp-list .pd-who { flex: 1; }
.pp-medical { display: flex; gap: 16px; align-items: flex-start; border-style: dashed; border-color: var(--border-strong); }
.pp-medical.is-open { border-style: solid; border-color: var(--border); }
.pp-medical-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--bubble); background: var(--navy-950); color: var(--primary-200); }
.pp-medical h2 { font-size: 1.0625rem; margin: 0 0 4px; }
.pp-medical p { margin: 0 0 12px; color: var(--muted); }
.pp-medical p:last-child { margin-bottom: 0; }
.pp-info { display: grid; gap: 14px; margin: 0; }
.pp-info dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
html[lang="ar"] .pp-info dt { text-transform: none; letter-spacing: 0; }
.pp-info dd { margin: 2px 0 0; font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }

/* Agenda: new appointment dialog */
dialog.modal.modal-wide { width: min(680px, calc(100vw - 32px)); }
.ag-form { display: grid; gap: 4px; }
.ag-block { border: 0; margin: 0; padding: 0 0 18px; border-bottom: 1px solid var(--border); display: grid; gap: 12px; min-width: 0; }
.ag-block + .ag-block { padding-top: 18px; }
.ag-block .field { margin: 0; }
.ag-or { margin: 4px 0 0; }
.ag-hint { display: flex; gap: 6px; align-items: flex-start; margin: 14px 0 0; }
.ag-hint .icon { flex: none; width: 14px; height: 14px; margin-top: 3px; }

/* ---------- Professionals page ---------- */
.pr-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pr-trust { margin-top: 28px; padding-top: 0; border-top: 0; }
.pr-preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pr-preview-head strong { font-family: var(--font-heading); color: var(--text-strong); }
.pr-preview-head span { font-size: .75rem; font-weight: 700; color: var(--muted); }
.pr-preview-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.pr-preview-time { width: 48px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pr-preview-lines { flex: 1; display: grid; gap: 6px; }
.pr-preview-lines i { display: block; height: 8px; width: 60%; border-radius: 999px; background: #e9eef3; }
.pr-preview-lines small { font-size: .75rem; color: var(--muted); }
@media (min-width: 900px) { .pr-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pr-note { display: flex; gap: 8px; align-items: flex-start; margin: 20px 0 0; font-size: .9rem; color: var(--muted); }
.pr-note .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--primary-600); }
.pr-features { display: grid; gap: 32px; }
@media (min-width: 1000px) { .pr-features { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; } .pr-features-intro { position: sticky; top: 100px; } }
.pr-features-intro h2 { margin: 8px 0 12px; }
.pr-feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pr-feature { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.pr-feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--bubble); background: #fff; border: 1px solid var(--border); color: var(--primary-600); margin-bottom: 14px; }
html[dir="rtl"] .pr-feature-icon { border-radius: 18px; }
.pr-feature h3 { font-size: 1.0625rem; margin: 0 0 6px; }
.pr-feature p { margin: 0; color: var(--muted); font-size: .9375rem; }
.pr-cta h2 { color: #fff; }

/* ==========================================================================
   MediFlow layer — gradients, buttons, labels and selected states.
   Colours come from the logo bubble. Text-bearing gradients start darker (#003a7d);
   the lighter end (#0174c8) keeps white text at 4.8:1.
   ========================================================================== */
:root {
  --grad-primary: linear-gradient(135deg, #005cbb 0%, #0174c8 100%);
  --grad-strong: linear-gradient(135deg, #003a7d 0%, #005cbb 100%);
  --grad-soft: linear-gradient(135deg, #eff8fd 0%, #dcf0fb 100%);
  --shadow-primary: 0 10px 20px -10px rgba(0, 92, 187, .55);
}

h1, h2, h3, h4 { letter-spacing: -0.03em; }
h1, h2 { font-weight: 800; }

/* Buttons: blue gradient for the primary action */
.btn { border-radius: 14px; }
/* Only the primary button gets the gradient; variants keep their own --bg. */
.btn:not(.btn-ghost, .btn-quiet, .btn-danger, .btn-dark, .btn-success, .h-btn-light, .h-btn-outline) {
  --bg: linear-gradient(135deg, #00499a 0%, #005cbb 55%, #0174c8 100%); box-shadow: var(--shadow-primary); }
.btn:not(.btn-ghost, .btn-quiet, .btn-danger, .btn-dark, .btn-success, .h-btn-light, .h-btn-outline):hover {
  --bg: linear-gradient(135deg, #003a7d 0%, #00499a 55%, #005cbb 100%); }
.btn-ghost { --bg: #fff; --bd: #e2e8f0; }
.btn-ghost:hover { --bg: var(--primary-50); --bd: var(--primary-200); }
.btn-dark { box-shadow: 0 10px 20px -10px rgba(8, 18, 38, .5); }
.btn-sm { border-radius: 12px; }
.btn-lg { border-radius: 18px; }

/* Small uppercase labels, MediFlow pill eyebrow */
.eyebrow, .h-pill { padding: 6px 14px; border-radius: 999px; background: var(--primary-50); border: 1px solid var(--primary-100);
  color: var(--primary-700); font-size: .6875rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; box-shadow: none; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary-600); }
.h-pill .icon { color: var(--primary-600); }
html[lang="ar"] .eyebrow, html[lang="ar"] .h-pill { letter-spacing: 0; font-size: .8125rem; }
.h-pro .eyebrow { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.h-pro .eyebrow::before { background: #fff; }

/* Highlighted words: blue gradient text (large type only) */
.h-title span { background: linear-gradient(135deg, #005cbb 0%, #0174c8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Navigation: active link with blue bar + soft tint */
.nav a[aria-current="page"], .nav a:hover { background: var(--primary-50); color: var(--primary-700); }
.side-link { border-radius: 12px; }
.side-link[aria-current="page"] { background: linear-gradient(90deg, rgba(0, 92, 187, .1) 0%, rgba(0, 92, 187, 0) 100%); color: var(--primary-700);
  border-inline-start: 4px solid var(--primary-600); border-start-start-radius: 4px; border-end-start-radius: 4px; padding-inline-start: 8px; }
.side-link[aria-current="page"] .icon { color: var(--primary-600); }
.side-link .count { background: var(--primary-600); color: #fff; }
.practice-card { background: var(--grad-soft); }
.practice-card .avatar-sm, .avatar-sm { background: var(--grad-primary); color: #fff; }

/* Brand bands and selected states */
.h-pro, .pro-band { background: radial-gradient(40rem 20rem at 100% 100%, rgba(1, 116, 200, .45), transparent 60%), var(--grad-strong); color: #dcf0fb; }
.h-pro-copy p, .pro-band p { color: #dcf0fb; }
.h-btn-light { --fg: var(--primary-700); }
.p-book-head, .b-summary-head, .b-ticket-when { background: var(--grad-strong); }
.p-book-head p, .b-summary-head .b-when > .icon { color: var(--primary-100); }
.b-ticket-day strong, .b-ticket-day { color: var(--primary-700); }
.pagination [aria-current="page"], .s-toggle.is-on, .b-segment input:checked + span, .tabs a[aria-current="page"] { background: var(--grad-strong); border-color: transparent; color: #fff; box-shadow: var(--shadow-primary); }
.h-step-icon, .step::before { background: var(--grad-primary); box-shadow: var(--shadow-primary); }
.h-spec-icon, .tile-icon, .kpi-icon, .pd-quick-icon, .s-empty-icon, .pd-empty-icon, .p-card-title .icon, .b-num { background: var(--grad-soft); }
.avatar, .dcard-avatar, .pl-avatar, .h-preview-avatar { background: var(--grad-soft); color: var(--primary-700); }
.p-avatar, .pp-avatar { background: var(--grad-primary); box-shadow: 0 16px 32px -14px rgba(0, 92, 187, .6); }
.b-option:has(input:checked) { border-color: var(--primary-600); background: var(--primary-50); }

/* Cards: soft blue shadow and generous radius */
.card, .p-card, .dcard, .b-form, .b-summary, .b-ticket, .a-appt, .h-step, .h-status-item, .h-spec, .pr-feature, .s-active, .filters { border-color: var(--border); }
.dcard:hover, .h-spec:hover { box-shadow: var(--shadow); border-color: var(--primary-100); }
.kpi { border-radius: 24px; background: linear-gradient(160deg, #fff 0%, #f6fbfe 100%); }
.kpi-label { font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
html[lang="ar"] .kpi-label { letter-spacing: 0; font-size: .8125rem; text-transform: none; }
.kpi-value { font-size: 2rem; letter-spacing: -0.03em; }
.table th { letter-spacing: .1em; font-size: .6875rem; background: #f6fbfe; }
.pd-setup { background: var(--grad-soft); border-color: var(--primary-100); }


/* ==========================================================================
   MediFlow layouts — home hero + back-office (pro / account / admin)
   ========================================================================== */
/* ---------- Home hero ---------- */
.mf-hero { padding: 48px 0 32px; }
@media (min-width: 1024px) { .mf-hero { padding: 88px 0 40px; } }
.mf-hero-grid { display: grid; gap: 48px 64px; align-items: center; }
@media (min-width: 1024px) { .mf-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.mf-hero-grid .h-hero-search { grid-column: 1 / -1; }
.mf-hero-copy { display: grid; gap: 28px; justify-items: start; }
.mf-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--primary-50); border: 1px solid var(--primary-100);
  font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-700); }
html[lang="ar"] .mf-pill { letter-spacing: 0; font-size: .875rem; }
.mf-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-600); animation: mf-pulse 2s ease-in-out infinite; }
@keyframes mf-pulse { 50% { opacity: .35; } }
.mf-title { margin: 0; font-size: clamp(2.6rem, 6.4vw, 4.5rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.045em; color: var(--navy-950); max-width: 14ch; text-wrap: balance; }
.mf-title span { background: linear-gradient(135deg, #005cbb 0%, #0174c8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[lang="ar"] .mf-title { letter-spacing: 0; line-height: 1.25; }
.mf-lead { margin: 0; font-size: 1.25rem; font-weight: 500; line-height: 1.65; color: var(--muted); max-width: 36rem; }
.mf-actions { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.mf-cta, .mf-cta-alt { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 14px 26px; border-radius: 32px; font-size: 1.125rem; text-decoration: none; transition: transform .2s, background .2s; }
.mf-cta { background: linear-gradient(135deg, #00499a 0%, #005cbb 55%, #0174c8 100%); color: #fff; font-weight: 800; box-shadow: 0 25px 50px -12px rgba(0, 92, 187, .45); }
.mf-cta:hover { transform: scale(1.03); color: #fff; }
.mf-cta-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); }
.mf-cta-icon .icon { width: 15px; height: 15px; }
.mf-cta-alt { background: #fff; color: var(--navy-950); font-weight: 700; border: 2px solid #f1f5f9; }
.mf-cta-alt:hover { background: #f8fafc; color: var(--navy-950); }
@media (max-width: 559px) { .mf-cta, .mf-cta-alt { flex: 1 1 100%; } }
.mf-hero-media { position: relative; }
.mf-hero-glow { position: absolute; inset: -16px; border-radius: 50%; background: var(--grad-primary); opacity: .2; filter: blur(48px); }
.mf-hero-frame { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 48px; padding: 16px; box-shadow: 0 10px 30px -10px rgba(0, 92, 187, .2); animation: mf-float 6s ease-in-out infinite; }
.mf-hero-frame img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 40px; }
@keyframes mf-float { 50% { transform: translateY(-14px); } }
.mf-hero-card { position: absolute; inset-inline-start: -24px; bottom: -32px; max-width: 260px; background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 20px 22px; box-shadow: var(--shadow); }
@media (max-width: 559px) { .mf-hero-card { inset-inline-start: 12px; bottom: -28px; max-width: 230px; } .mf-hero-frame { border-radius: 32px; } .mf-hero-frame img { border-radius: 24px; } }
.mf-hero-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .mf-hero-card-head { text-transform: none; letter-spacing: 0; font-size: .875rem; }
.mf-hero-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #d1fae5; color: #047857; }
.mf-hero-card p { margin: 0; font-size: .875rem; font-weight: 700; line-height: 1.4; color: var(--navy-900); }
@media (prefers-reduced-motion: reduce) { .mf-hero-frame, .mf-pill-dot { animation: none; } }
.mf-hero .h-hero-search { margin-top: 24px; }

/* ---------- Back-office shell ---------- */
.app-body { background: #f8fafc; }
@media (min-width: 1024px) { .app { grid-template-columns: 272px minmax(0, 1fr); } }
.sidebar { padding: 28px 20px 20px; gap: 6px; border-inline-end: 1px solid #e3eff8; }
.side-brand { padding: 0 8px 28px; }
.side-nav { display: grid; gap: 4px; }
.sidebar .side-link { padding: 12px 14px; font-size: .9375rem; font-weight: 600; color: #64748b; border-radius: 14px; }
.sidebar .side-link .icon { width: 20px; height: 20px; color: #94a3b8; }
.sidebar .side-link:hover { background: #f8fafc; color: var(--navy-950); }
.sidebar .side-link[aria-current="page"] { color: var(--primary-700); font-weight: 700; padding-inline-start: 10px; }
.sidebar .side-link[aria-current="page"] .icon { color: var(--primary-600); }
.side-link .count { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--primary-600); color: #fff; font-size: .6875rem; }
.side-sep { height: 1px; margin: 10px 14px; background: #e3eff8; }
.side-label { padding: 14px 14px 4px; }
.side-hint { display: flex; gap: 6px; padding: 8px 14px; margin: 0; }
.side-card { position: relative; overflow: hidden; margin-top: 20px; padding: 22px 20px; border-radius: 28px; background: linear-gradient(135deg, #003a7d 0%, #0d2a45 100%); color: #fff; }
.side-card::after { content: ""; position: absolute; top: -28px; inset-inline-end: -28px; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.side-card-label { margin: 0 0 4px; font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #bfe3f8; }
html[lang="ar"] .side-card-label { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
.side-card-title { position: relative; margin: 0 0 14px; font-weight: 800; line-height: 1.35; }
.side-card-btn { position: relative; display: block; text-align: center; padding: 10px 12px; border-radius: 14px; background: #fff; color: var(--primary-700); font-weight: 800; font-size: .875rem; text-decoration: none; }
.side-card-btn:hover { background: var(--primary-50); color: var(--primary-700); }
.side-foot { padding-top: 16px; border-top: 1px solid #e3eff8; margin-top: 20px; }
.side-logout { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: start; }
.app-main { min-width: 0; }
.topbar { height: 80px; padding: 0 20px; gap: 16px; background: rgba(255, 255, 255, .8); border-bottom: 1px solid #e3eff8; }
@media (min-width: 768px) { .topbar { padding: 0 40px; } }
.topbar-search { position: relative; flex: 1 1 auto; max-width: 420px; margin: 0; }
.topbar-search .icon { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #94a3b8; pointer-events: none; }
.topbar-search input { width: 100%; height: 48px; padding-inline: 46px 16px; border: 1px solid #f1f5f9; border-radius: 16px; background: #f8fafc; font: inherit; font-size: .875rem; color: var(--navy-950); }
.topbar-search input:focus { outline: none; background: #fff; border-color: var(--primary-200); box-shadow: var(--ring); }
@media (max-width: 639px) { .topbar-search { display: none; } }
.topbar-actions { gap: 12px; }
.topbar-icon { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #f8fafc; border: 1px solid #f1f5f9; color: #64748b; text-decoration: none; font-weight: 800; font-size: .875rem; }
.topbar-icon:hover { background: var(--primary-50); color: var(--primary-700); }
.topbar-icon .icon { width: 20px; height: 20px; }
.topbar-dot { position: absolute; top: 10px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 2px #fff; }
.topbar-sep { width: 1px; height: 32px; background: #f1f5f9; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-user-text { display: grid; text-align: end; line-height: 1.25; }
.topbar-user-text strong { font-size: .875rem; color: var(--navy-950); }
.topbar-user-text small { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-600); }
html[lang="ar"] .topbar-user-text small { letter-spacing: 0; text-transform: none; font-size: .75rem; }
@media (max-width: 559px) { .topbar-user-text, .topbar-sep { display: none; } }
.topbar-avatar { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--grad-primary); color: #fff; font-weight: 800; font-size: .875rem; box-shadow: var(--shadow-primary); }
.topbar-avatar i { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 12px; height: 12px; border-radius: 50%; background: #10b981; border: 2px solid #fff; }
.main { padding: 32px 20px 64px; }
@media (min-width: 768px) { .main { padding: 40px; } }
.main > * { max-width: 1280px; }

/* ---------- Page head ---------- */
.mf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.mf-h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 3vw, 1.875rem); font-weight: 800; font-style: italic; letter-spacing: -0.03em; color: var(--navy-950); }
.mf-h1.mf-upright { font-style: normal; }
.mf-h1 span { color: var(--primary-600); }
.mf-head p { margin: 0; color: var(--muted); font-weight: 500; }
.mf-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mf-head-actions .btn { min-height: 48px; padding: 12px 22px; border-radius: 16px; }
.mf-btn-outline { --fg: var(--primary-600); --bd: var(--primary-100); border-width: 2px; }
.mf-h2 { margin: 0 0 18px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Metric cards ---------- */
.mf-metrics { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 32px; }
.mf-metric { padding: 24px; border-radius: 40px; border: 1px solid var(--primary-50); box-shadow: 0 10px 30px -10px rgba(0, 92, 187, .15); transition: transform .2s; background: #fff; }
.mf-metric:hover { transform: scale(1.02); }
.mf-metric.is-brand { background: linear-gradient(135deg, #eff8fd 0%, #dcf0fb 100%); }
.mf-metric.is-indigo { background: linear-gradient(135deg, #e3eff8 0%, #d3ecfa 100%); border-color: #d3ecfa; }
.mf-metric.is-rose { border-color: #ffe4e6; }
.mf-metric.is-dark { background: #0d1b33; border-color: #15294a; }
.mf-metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 24px; }
.mf-metric-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: #fff; color: var(--primary-600); box-shadow: var(--shadow-sm); }
.mf-metric-icon .icon { width: 28px; height: 28px; }
.is-indigo .mf-metric-icon { color: #00499a; }
.is-rose .mf-metric-icon { background: #fff1f2; color: #e11d48; }
.is-dark .mf-metric-icon { background: #15294a; color: #34d399; }
.mf-metric-badge { padding: 4px 8px; border-radius: 8px; font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #d1fae5; color: #047857; text-decoration: none; }
html[lang="ar"] .mf-metric-badge, html[lang="ar"] .mf-metric-label { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.is-indigo .mf-metric-badge { background: #d3ecfa; color: #0d2a45; }
.is-rose .mf-metric-badge { background: #e11d48; color: #fff; }
.is-dark .mf-metric-badge { background: rgba(52, 211, 153, .2); color: #6ee7b7; }
.mf-metric-label { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(0, 73, 154, .7); }
.is-indigo .mf-metric-label { color: rgba(8, 18, 38, .7); }
.is-rose .mf-metric-label { color: rgba(136, 19, 55, .7); }
.is-dark .mf-metric-label { color: #94a3b8; }
.mf-metric-value { margin: 8px 0 0; font-size: 1.875rem; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-950); font-variant-numeric: tabular-nums; }
.is-dark .mf-metric-value { color: #fff; }

/* ---------- Panels, grids, table ---------- */
.mf-grid { display: grid; gap: 32px; margin-bottom: 32px; }
@media (min-width: 1100px) { .mf-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } .mf-grid.mf-grid-even { grid-template-columns: 1fr 1fr; } }
.mf-side, .mf-main-col { display: grid; gap: 32px; }
.mf-panel { background: #fff; border: 1px solid #e3eff8; border-radius: 40px; box-shadow: 0 20px 25px -5px rgba(226, 232, 240, .5); overflow: hidden; }
.mf-panel-pad { padding: 28px 32px; }
@media (max-width: 559px) { .mf-panel { border-radius: 28px; } .mf-panel-pad { padding: 22px; } }
.mf-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 28px 32px; border-bottom: 1px solid #e3eff8; }
.mf-panel-head-tight { padding: 0 0 18px; border-bottom: 0; }
.mf-panel-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.mf-panel-title { display: flex; align-items: center; gap: 12px; }
.mf-chip { padding: 2px 10px; border-radius: 999px; background: #e3eff8; color: #00499a; font-size: .6875rem; font-weight: 700; }
.mf-link { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; font-weight: 700; color: var(--primary-600); text-decoration: none; }
.mf-link .icon { width: 16px; height: 16px; }
.mf-square-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
.mf-table-wrap { position: relative; overflow-x: auto; }
.mf-table { width: 100%; border-collapse: collapse; text-align: start; }
.mf-table th { padding: 18px 24px; background: rgba(248, 250, 252, .5); font-size: .6875rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #64748b; text-align: start; white-space: nowrap; }
html[lang="ar"] .mf-table th { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
.mf-table th:first-child, .mf-table td:first-child { padding-inline-start: 32px; }
.mf-table td { padding: 18px 24px; border-top: 1px solid rgba(238, 242, 255, .8); vertical-align: middle; }
.mf-table tbody tr:hover { background: rgba(245, 243, 255, .4); }
.mf-person { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mf-person > span:last-child { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.mf-person strong { font-size: .9375rem; color: var(--navy-950); }
.mf-avatar { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; background: var(--grad-soft); color: var(--primary-700); font-weight: 800; font-size: .875rem; }
.mf-avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.125rem; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.mf-dot { position: absolute; bottom: -3px; inset-inline-end: -3px; width: 16px; height: 16px; border-radius: 50%; background: #10b981; border: 2px solid #fff; }
.mf-cell { display: block; font-size: .875rem; color: var(--navy-950); }
.mf-time { font-style: italic; font-variant-numeric: tabular-nums; }
.mf-sub { display: block; margin-top: 2px; font-size: .6875rem; font-weight: 700; color: #64748b; }
.mf-accent { color: var(--primary-600); font-weight: 800; }
.mf-tag { display: inline-block; padding: 3px 8px; border-radius: 8px; background: #f1f5f9; color: #475569; font-size: .6875rem; font-weight: 700; }
.mf-go { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid #e3eff8; background: #fff; color: #94a3b8; box-shadow: var(--shadow-sm); }
.mf-go:hover { color: var(--primary-600); border-color: var(--primary-200); }
.mf-go .icon { width: 18px; height: 18px; }
.mf-go-cell { text-align: end; }

/* ---------- Timeline ---------- */
.mf-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.mf-timeline li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding-inline-start: 22px; }
.mf-timeline li::before { content: ""; position: absolute; inset-inline-start: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.mf-timeline li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 7px; top: 20px; bottom: -18px; width: 1px; background: #e2e8f0; }
.mf-timeline li.is-first::before { background: var(--primary-600); box-shadow: 0 0 0 4px var(--primary-100); }
.mf-tl-kicker { grid-column: 1; font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; }
html[lang="ar"] .mf-tl-kicker { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.is-first .mf-tl-kicker { color: var(--primary-600); }
.mf-timeline a { grid-column: 1; font-weight: 700; color: var(--navy-950); text-decoration: none; }
.mf-timeline a:hover { color: var(--primary-600); }
.mf-timeline small { grid-column: 1; color: #64748b; font-size: .8125rem; }
.mf-tl-time { grid-column: 2; grid-row: 1 / span 3; align-self: start; padding: 4px 8px; border-radius: 8px; background: #f8fafc; font-size: .75rem; font-weight: 800; color: #475569; font-variant-numeric: tabular-nums; }

/* ---------- Patients cards ---------- */
.mf-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 20px 24px; margin-bottom: 28px; background: #fff; border: 1px solid #e3eff8; border-radius: 32px; box-shadow: var(--shadow-sm); }
.mf-search { position: relative; flex: 1 1 280px; }
.mf-search .icon { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #94a3b8; pointer-events: none; }
.mf-search input, .mf-input, .mf-select { width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid #f1f5f9; border-radius: 14px; background: #f8fafc; font: inherit; font-size: .875rem; font-weight: 600; color: var(--navy-900); }
.mf-search input { padding-inline-start: 48px; }
.mf-search input:focus, .mf-input:focus, .mf-select:focus { outline: none; background: #fff; border-color: var(--primary-200); box-shadow: var(--ring); }
.mf-filters .mf-select { width: auto; min-width: 200px; }
.mf-filter-btn { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 14px; background: #081226; color: #fff; cursor: pointer; }
.mf-filter-btn:hover { background: #0d1b33; }
.mf-cards { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.mf-pcard { position: relative; overflow: hidden; display: grid; gap: 20px; padding: 24px; background: #fff; border: 1px solid #e3eff8; border-radius: 40px; box-shadow: 0 10px 30px -10px rgba(0, 92, 187, .15); transition: border-color .2s; }
.mf-pcard:hover { border-color: var(--primary-200); }
.mf-pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mf-pcard-name { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-950); text-decoration: none; }
.mf-pcard-name:hover { color: var(--primary-600); }
.mf-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: #f1f5f9; color: #475569; }
html[lang="ar"] .mf-badge { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.mf-badge.is-brand { background: var(--primary-50); color: var(--primary-700); }
.mf-badge.is-teal { background: rgba(45, 212, 191, .12); color: #0f766e; border: 1px solid rgba(45, 212, 191, .25); }
.mf-pcard-meta { display: grid; justify-items: end; gap: 8px; }
.mf-pcard-meta small { font-size: .6875rem; font-weight: 700; color: #94a3b8; }
.mf-pill-status { padding: 4px 12px; border-radius: 999px; font-size: .625rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: #f8fafc; color: #64748b; white-space: nowrap; }
html[lang="ar"] .mf-pill-status { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.mf-pill-status.is-on { background: #ecfdf5; color: #047857; }
.mf-pcard-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.mf-pcard-facts div { padding: 12px; border-radius: 16px; background: #f8fafc; }
.mf-pcard-facts dt { font-size: .625rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
html[lang="ar"] .mf-pcard-facts dt { text-transform: none; letter-spacing: 0; font-size: .75rem; }
.mf-pcard-facts dd { margin: 2px 0 0; font-size: .875rem; font-weight: 700; color: #15294a; }
.mf-pcard-next { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.mf-pcard-next span { font-size: .6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #64748b; }
html[lang="ar"] .mf-pcard-next span { text-transform: none; letter-spacing: 0; font-size: .75rem; }
.mf-pcard-next strong { font-size: .875rem; color: var(--navy-950); font-variant-numeric: tabular-nums; }
.mf-pcard-next strong.is-today { color: var(--teal-700); }
.mf-pcard-next small { grid-column: 1 / -1; font-size: .75rem; color: #64748b; }
.mf-pcard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mf-soft-btn, .mf-dark-btn, .mf-ghost-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 14px; font-size: .8125rem; font-weight: 800; text-decoration: none; }
.mf-soft-btn { background: var(--primary-50); color: var(--primary-700); }
.mf-soft-btn:hover { background: var(--primary-100); color: var(--primary-700); }
.mf-dark-btn { background: #081226; color: #fff; }
.mf-dark-btn:hover { background: #0d1b33; color: #fff; }
.mf-ghost-btn { min-height: 48px; padding: 12px 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; color: var(--navy-950); font-size: .875rem; }
.mf-ghost-btn:hover { background: #f8fafc; color: var(--navy-950); }
.mf-ghost-btn .icon { width: 18px; height: 18px; }

/* ---------- Patient file ---------- */
.mf-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: .875rem; font-weight: 700; color: var(--primary-600); text-decoration: none; }
.mf-back .icon { width: 16px; height: 16px; }
.mf-ph { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 28px; align-items: center; padding: 32px; margin-bottom: 28px; }
@media (min-width: 1000px) { .mf-ph { grid-template-columns: auto minmax(0, 1fr) auto; } }
.mf-ph-avatar { position: relative; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 28px; background: var(--grad-soft); color: var(--primary-700); font-size: 1.75rem; font-weight: 800; border: 4px solid #fff; box-shadow: var(--shadow); }
.mf-ph-avatar span { position: absolute; bottom: -6px; inset-inline-end: -6px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 12px; background: #10b981; color: #fff; border: 3px solid #fff; }
.mf-ph-avatar span .icon { width: 14px; height: 14px; }
@media (max-width: 559px) { .mf-ph { padding: 22px; } .mf-ph-avatar { width: 68px; height: 68px; font-size: 1.25rem; border-radius: 20px; } }
.mf-ph-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.mf-ph-name h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.03em; }
.mf-ph-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; }
.mf-ph-facts li { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; color: #475569; }
.mf-ph-facts .icon { width: 18px; height: 18px; color: var(--primary-500); }
.mf-ph-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 1000px) { .mf-ph-actions { grid-column: auto; } }
.mf-ph-actions .btn { min-height: 48px; border-radius: 16px; }
.mf-vitals { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 32px; }
.mf-vital { padding: 22px 24px; border-radius: 28px; background: #fff; border: 1px solid #e3eff8; box-shadow: var(--shadow-sm); }
.mf-vital.is-dark { background: #0d1b33; border-color: #15294a; }
.mf-vital-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.mf-vital-icon { color: var(--primary-600); }
.mf-vital-icon .icon { width: 26px; height: 26px; }
.is-teal .mf-vital-icon { color: var(--teal-700); }
.is-rose .mf-vital-icon { color: #e11d48; }
.is-dark .mf-vital-icon { color: #6ee7b7; }
.mf-vital-label { font-size: .625rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748b; text-align: end; }
html[lang="ar"] .mf-vital-label { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.is-dark .mf-vital-label { color: #94a3b8; }
.mf-vital-value { margin: 0 0 14px; font-size: 1.875rem; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-950); font-variant-numeric: tabular-nums; }
.mf-vital-value small { font-size: .875rem; font-weight: 600; color: #64748b; }
.is-dark .mf-vital-value { color: #fff; }
.mf-bar { display: block; height: 6px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.mf-bar i { display: block; height: 100%; border-radius: inherit; background: #10b981; }
.is-brand .mf-bar i, .mf-bars .mf-bar i { background: var(--grad-primary); }
.is-rose .mf-bar i { background: #f43f5e; }
.is-dark .mf-bar { background: #15294a; }
.mf-bars .mf-bar.is-teal i { background: linear-gradient(90deg, #0b7f79, #2dd4bf); }
.mf-acards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.mf-acard { display: flex; gap: 14px; padding: 18px; border-radius: 24px; background: #f8fafc; border: 1px solid #f1f5f9; }
.mf-acard.is-next { background: var(--grad-soft); border-color: var(--primary-100); }
.mf-acard-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--primary-600); box-shadow: var(--shadow-sm); }
.mf-acard > div { display: grid; gap: 4px; min-width: 0; }
.mf-acard strong { font-size: .9375rem; color: var(--navy-950); }
.mf-acard small { font-size: .8125rem; color: #64748b; }
.mf-acard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.mf-results { display: grid; gap: 12px; margin: 0; }
.mf-results div { padding: 14px 16px; border-radius: 18px; background: #f8fafc; border: 1px solid #f1f5f9; }
.mf-results dt { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
html[lang="ar"] .mf-results dt { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.mf-results dd { margin: 2px 0 0; font-weight: 700; color: var(--navy-950); overflow-wrap: anywhere; }

/* ---------- Agenda planner ---------- */
.mf-period { display: flex; align-items: center; gap: 4px; padding: 6px; background: #fff; border: 1px solid #f1f5f9; border-radius: 16px; box-shadow: var(--shadow-sm); }
.mf-period a { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 12px; color: #15294a; text-decoration: none; }
.mf-period a:hover { background: #f8fafc; }
.mf-period-label { padding: 0 14px; font-size: .875rem; font-weight: 700; text-transform: capitalize; }
.mf-plan { display: grid; gap: 32px; }
@media (min-width: 1100px) { .mf-plan { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; } }
.mf-cal { padding: 32px; }
@media (max-width: 559px) { .mf-cal { padding: 18px; } }
.mf-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 559px) { .mf-cal-grid { gap: 6px; } }
.mf-cal-head { margin-bottom: 18px; }
.mf-cal-head span { text-align: center; font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #64748b; }
html[lang="ar"] .mf-cal-head span { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.mf-day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 16px; border: 1px solid transparent; font-weight: 700; color: var(--navy-900); text-decoration: none; transition: background .2s; font-variant-numeric: tabular-nums; }
.mf-day:hover { background: var(--primary-50); color: var(--navy-900); }
.mf-day.is-other { color: #cbd5e1; }
.mf-day.is-free { background: #ecfdf5; border-color: #d1fae5; }
.mf-day.is-full { background: #fff1f2; border-color: #ffe4e6; }
.mf-day.is-today { box-shadow: inset 0 0 0 2px var(--primary-200); }
.mf-day.is-selected { background: linear-gradient(135deg, #00499a 0%, #0174c8 100%); color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(0, 92, 187, .3); }
.mf-day-count { position: absolute; top: 4px; inset-inline-end: 6px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; background: var(--primary-600); color: #fff; font-size: .5625rem; font-style: normal; font-weight: 800; }
.is-selected .mf-day-count { background: #fff; color: var(--primary-700); }
.mf-cal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 32px; padding-top: 24px; border-top: 1px solid #e3eff8; }
.mf-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; }
.mf-legend li { display: flex; align-items: center; gap: 8px; font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
html[lang="ar"] .mf-legend li { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.mf-legend i { width: 12px; height: 12px; border-radius: 50%; }
.mf-legend i.is-selected { background: var(--grad-primary); }
.mf-legend i.is-full { background: #fecdd3; }
.mf-legend i.is-free { background: #6ee7b7; }
.mf-book { padding: 28px; position: sticky; top: 100px; }
.mf-book-date { display: flex; align-items: center; gap: 8px; margin: -8px 0 18px; font-weight: 700; color: var(--primary-700); text-transform: capitalize; }
.mf-book-date .icon { width: 18px; height: 18px; }
.mf-book-form { display: grid; gap: 4px; }
.mf-field { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.mf-label { display: block; margin: 0 0 8px; padding: 0; font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #64748b; }
html[lang="ar"] .mf-label { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
.mf-static { margin: 0; font-weight: 700; color: var(--navy-950); }
.mf-muted { color: #64748b; font-weight: 600; font-size: .875rem; margin-bottom: 8px; }
.mf-inline { display: flex; gap: 8px; align-items: center; }
.mf-new-patient { margin-top: 10px; }
.mf-new-patient summary { cursor: pointer; font-size: .8125rem; font-weight: 700; color: var(--primary-600); }
.mf-new-grid { display: grid; gap: 8px; margin-top: 10px; }
.mf-chips, .mf-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mf-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mf-chips label, .mf-slots label { position: relative; cursor: pointer; }
.mf-chips input, .mf-slots input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mf-chips span, .mf-slots span { display: grid; place-items: center; min-height: 44px; padding: 8px; border-radius: 14px; border: 1px solid #f1f5f9; background: #fff; text-align: center; font-size: .8125rem; font-weight: 700; color: #475569; }
.mf-chips input:checked + span { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary-700); }
.mf-slots span { border-color: #d1fae5; background: #ecfdf5; color: #047857; font-variant-numeric: tabular-nums; }
.mf-slots input:checked + span { background: #081226; border-color: #081226; color: #fff; }
.mf-chips input:focus-visible + span, .mf-slots input:focus-visible + span { box-shadow: var(--ring); }
.mf-book-submit { min-height: 52px; border-radius: 16px; margin-top: 4px; }
.mf-book-hint { display: flex; gap: 6px; margin: 12px 0 0; font-size: .75rem; color: #64748b; }
.mf-book-hint .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; }

/* ---------- Statistics ---------- */
.mf-seg { display: inline-flex; padding: 6px; gap: 4px; background: #fff; border: 1px solid #f1f5f9; border-radius: 16px; box-shadow: var(--shadow-sm); }
.mf-seg a { padding: 8px 16px; border-radius: 12px; font-size: .8125rem; font-weight: 800; color: #64748b; text-decoration: none; }
.mf-seg a[aria-current="page"] { background: var(--primary-50); color: var(--primary-700); }
.mf-chart { width: 100%; height: auto; display: block; }
.mf-chart-grid { stroke: #f1f5f9; stroke-dasharray: 4 6; }
.mf-chart-axis { fill: #64748b; font-size: 11px; font-weight: 700; }
.mf-chart-line { fill: none; stroke: #005cbb; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.mf-chart-line.is-teal { stroke: #2dd4bf; stroke-width: 2.5; stroke-dasharray: 6 6; }
.mf-donut { position: relative; width: 180px; height: 180px; margin: 4px auto 22px; border-radius: 50%; }
.mf-donut span { position: absolute; inset: 22px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: #fff; }
.mf-donut strong { font-size: 1.75rem; font-weight: 800; color: var(--navy-950); line-height: 1.1; }
.mf-donut small { font-size: .6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #64748b; }
.mf-donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mf-donut-legend li { display: flex; align-items: center; gap: 10px; font-size: .875rem; }
.mf-donut-legend i { width: 12px; height: 12px; border-radius: 50%; }
.mf-donut-legend span { flex: 1; color: #475569; font-weight: 600; }
.mf-donut-legend strong { color: var(--navy-950); }
.mf-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed #e2e8f0; font-size: .875rem; font-weight: 600; color: #475569; }
.mf-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mf-bars li { display: grid; grid-template-columns: 48px minmax(0, 1fr) 36px; align-items: center; gap: 12px; font-size: .8125rem; font-weight: 700; color: #475569; }
.mf-bars .mf-bar { height: 10px; }
.mf-bars strong { text-align: end; color: var(--navy-950); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Charte globale — the MediFlow shapes applied to every remaining page
   (public header/footer, forms, cards, tables, alerts, auth, account, admin,
   search, profile, booking). Colours stay the ALLODOC logo blues.
   ========================================================================== */
/* Public header: MediFlow navbar */
.site-header { background: rgba(255, 255, 255, .8); backdrop-filter: blur(12px); border-bottom-color: #e3eff8; }
.site-header .container { height: 80px; }
.site-header .brand { gap: 2px; }
.site-header .brand-mark { width: 46px; height: 46px; }
.site-header .brand-word { height: 15px; }
.nav { gap: 8px; }
.nav a { font-size: .875rem; font-weight: 700; color: #475569; padding: 10px 14px; border-radius: 12px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--primary-50); color: var(--primary-600); }
.header-actions .btn { min-height: 44px; border-radius: 14px; font-size: .875rem; }
.lang-switch { border-radius: 12px; border-color: #f1f5f9; background: #f8fafc; }
.mobile-nav a { border-radius: 14px; font-weight: 700; }

/* Footer */
.site-footer { background: #081226; border-top-left-radius: 48px; border-top-right-radius: 48px; }
@media (max-width: 559px) { .site-footer { border-top-left-radius: 28px; border-top-right-radius: 28px; } }

/* Section titles */
h1 { font-weight: 800; letter-spacing: -0.04em; }
.h-section h2, .h-head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.035em; }
.page-head h1, .auth-card h1 { font-style: italic; font-weight: 800; letter-spacing: -0.03em; }
html[lang="ar"] .page-head h1, html[lang="ar"] .auth-card h1, html[lang="ar"] .mf-h1 { font-style: normal; }

/* Cards and panels: large radius, soft shadow */
.card, .p-card, .b-form, .b-summary, .b-ticket, .filters, .s-active, .s-empty, .a-empty, .h-status-item, .h-step, .pr-feature { border-radius: 32px; border-color: #e3eff8; }
.card { padding: 28px; box-shadow: 0 20px 25px -5px rgba(226, 232, 240, .5); }
.card.card-tight { padding: 18px 20px; }
@media (max-width: 559px) { .card, .p-card, .b-form, .b-summary, .b-ticket, .filters { border-radius: 24px; } .card { padding: 20px; } }
.card-head h2, .card-head h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.dcard, .a-appt, .mf-acard { border-radius: 32px; }
.dcard { padding: 24px; box-shadow: 0 10px 30px -10px rgba(0, 92, 187, .12); }
.p-hero, .s-bar { border-bottom-color: #e3eff8; }
.p-book, .b-summary { border-radius: 32px; }
.p-facts li, .pp-stats div { border-radius: 20px; }
.h-spec { border-radius: 24px; }
.h-gov a { border-radius: 16px; }

/* Forms: MediFlow inputs and labels */
.input, .select, .textarea { min-height: 48px; border-radius: 14px; border: 1px solid #e2e8f0; background-color: #f8fafc; font-weight: 600; font-size: .9375rem; color: var(--navy-950); }
.textarea { min-height: 110px; }
.input:focus, .select:focus, .textarea:focus { background-color: #fff; border-color: var(--primary-200); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--red-700); background-color: var(--red-50); }
.label { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748b; }
html[lang="ar"] .label { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.check input { accent-color: var(--primary-600); }
.form-actions .btn, .auth-card .btn { min-height: 48px; border-radius: 16px; }
.search-panel { border-radius: 28px; border-color: #e3eff8; box-shadow: 0 20px 40px -20px rgba(0, 92, 187, .25); }

/* Auth pages */
.auth-wrap { background: radial-gradient(50rem 26rem at 100% 0%, rgba(0, 92, 187, .12), transparent 60%), radial-gradient(40rem 22rem at 0% 100%, rgba(11, 127, 121, .08), transparent 60%); }
.auth-card { max-width: 480px; padding: 36px; border-radius: 40px; box-shadow: 0 25px 50px -12px rgba(0, 92, 187, .2); }
@media (max-width: 559px) { .auth-card { padding: 24px; border-radius: 28px; } }

/* Tables (account, admin, appointments) */
.table-wrap { border-radius: 28px; border-color: #e3eff8; box-shadow: 0 20px 25px -5px rgba(226, 232, 240, .5); }
.table th { padding: 16px 20px; background: rgba(248, 250, 252, .6); font-size: .6875rem; font-weight: 800; letter-spacing: .14em; color: #64748b; }
html[lang="ar"] .table th { letter-spacing: 0; font-size: .8125rem; }
.table td { padding: 16px 20px; border-bottom-color: #eef4f7; }
.table tbody tr:hover { background: rgba(239, 248, 253, .6); }
.cell-strong { font-weight: 800; }

/* Alerts, badges, tabs, KPIs (account/admin dashboards) */
.alert { border-radius: 20px; padding: 16px 18px; }
.badge { border-radius: 8px; font-weight: 800; }
.tabs { padding: 6px; gap: 4px; background: #fff; border: 1px solid #f1f5f9; border-radius: 16px; box-shadow: var(--shadow-sm); }
.tabs a { border-radius: 12px; font-weight: 800; }
.kpis .kpi { border-radius: 32px; padding: 22px; }
.kpis .kpi:nth-child(4n+1) { background: linear-gradient(135deg, #eff8fd 0%, #dcf0fb 100%); }
.kpis .kpi:nth-child(4n+4) { background: #0d1b33; border-color: #15294a; }
.kpis .kpi:nth-child(4n+4) .kpi-label { color: #94a3b8; }
.kpis .kpi:nth-child(4n+4) .kpi-value { color: #fff; }
.empty { border-radius: 32px; }
.pagination a, .pagination span { border-radius: 14px; }
dialog.modal { border-radius: 32px; }
.modal-head { padding: 20px 28px; }
.modal-body { padding: 24px 28px; }

/* Booking and search details */
.slot, .p-book .slot { border-radius: 12px; }
.s-toggle, .s-chip { font-weight: 800; }

/* ---------- Doctor cards (MediFlow card layout, home + search) ---------- */
.dcard-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.s-results.dcard-grid { margin-bottom: var(--s5); }
.mf-photo { position: relative; flex: none; width: 64px; height: 64px; }
.mf-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 18px; border: 2px solid #fff; box-shadow: var(--shadow-sm); background: var(--primary-50); }
.mf-photo .mf-dot { bottom: -3px; inset-inline-end: -3px; }
.mf-dot.is-off { background: #cbd5e1; }
.mf-dcard .mf-pcard-name { display: block; line-height: 1.25; margin-bottom: 4px; overflow-wrap: anywhere; }
.mf-dcard .mf-person { align-items: flex-start; }
.mf-pill-status.is-verified { background: var(--primary-50); color: var(--primary-700); }
.mf-badge.is-grey { background: #f1f5f9; color: #475569; }
.mf-demo { padding: 1px 8px; border-radius: 6px; background: var(--amber-50); color: var(--amber-700) !important; }
.mf-dcard .mf-pcard-facts dd { overflow-wrap: anywhere; }
.mf-dcard.is-bookable { border-color: #d1fae5; }
.mf-dcard.is-bookable:hover { border-color: #6ee7b7; }
.mf-pcard-actions.is-single { grid-template-columns: 1fr; }
.mf-dark-btn .icon { width: 16px; height: 16px; }

/* ---------- Doctor photo (pro profile) ---------- */
.pr-photo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 24px; align-items: start; margin-bottom: 20px; }
@media (max-width: 559px) { .pr-photo { grid-template-columns: 1fr; } }
.pr-photo-img { width: 112px; height: 112px; object-fit: cover; border-radius: 28px; border: 4px solid #fff; box-shadow: var(--shadow); background: var(--primary-50); }
.pr-photo-body h2 { margin: 0 0 4px; font-size: 1.25rem; }
.pr-photo-body > p { margin: 0 0 14px; font-size: .9rem; }
.pr-photo-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.pr-photo-form .input { flex: 1 1 240px; padding: 10px 12px; }
.pr-photo-body .hint { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; }
.p-avatar-img { object-fit: cover; padding: 0; background: var(--primary-50); }

/* ---------- Search bar lists (specialty / place) ---------- */
.search-select { flex: 1; min-width: 0; }
.search-field select { width: 100%; min-height: 30px; padding: 2px 26px 2px 0; border: 0; outline: 0; background-color: transparent;
  font: inherit; font-weight: 700; color: var(--text-strong); cursor: pointer; text-overflow: ellipsis;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary-600) 50%), linear-gradient(135deg, var(--primary-600) 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
html[dir="rtl"] .search-field select { padding: 2px 0 2px 26px; background-position: 5px 55%, 10px 55%; }
.search-field select:focus-visible { outline: none; }
.search-field:focus-within { box-shadow: var(--ring); }
.search-field select option, .search-field select optgroup { color: var(--navy-950); font-weight: 600; }
.search-field select optgroup { font-weight: 800; }

/* ---------- Search bar with 4 fields (name, specialty, place, date) ---------- */
@media (min-width: 640px) { .search-panel.search-panel-4 { grid-template-columns: 1fr 1fr; } .search-panel-4 .btn { grid-column: 1 / -1; } }
@media (min-width: 1150px) { .search-panel.search-panel-4 { grid-template-columns: 1fr 1.1fr 1fr .85fr auto; } .search-panel-4 .btn { grid-column: auto; } }
.search-optional { font-weight: 600; text-transform: none; letter-spacing: 0; color: #94a3b8; }
.search-field input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Styled dropdown (select[data-dropdown] enhanced by app.js) ---------- */
/* The hero clipped overflowing children; keep the horizontal clip, let the open list overflow downwards. */
.h-hero.mf-hero { overflow-x: clip; overflow-y: visible; }
.dd-native { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd { position: relative; }
.dd-trigger { display: block; width: 100%; min-height: 30px; padding: 2px 26px 2px 0; border: 0; background: transparent; font: inherit; font-weight: 700;
  color: var(--text-strong); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary-600) 50%), linear-gradient(135deg, var(--primary-600) 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
html[dir="rtl"] .dd-trigger { padding: 2px 0 2px 26px; background-position: 5px 55%, 10px 55%; }
.dd-trigger:focus-visible { outline: none; }
.dd-panel { position: absolute; z-index: 60; top: calc(100% + 18px); inset-inline-start: -46px; width: min(360px, calc(100vw - 32px));
  background: #fff; border: 1px solid #e3eff8; border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(8, 18, 38, .25), 0 0 0 1px rgba(8, 18, 38, .02); padding: 10px; }
@media (max-width: 639px) { .dd-panel { inset-inline-start: -38px; inset-inline-end: -12px; width: auto; } }
.dd-filter, .search-field .dd-filter { width: 100%; height: 44px; padding: 0 14px 0 40px; margin-bottom: 8px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--navy-950);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px 50%; }
html[dir="rtl"] .dd-filter, html[dir="rtl"] .search-field .dd-filter { padding: 0 40px 0 14px; background-position: calc(100% - 14px) 50%; }
.dd-filter:focus, .search-field .dd-filter:focus { outline: none; background-color: #fff; border-color: var(--primary-200); box-shadow: var(--ring); }
.dd-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.dd-group { position: sticky; top: 0; z-index: 1; padding: 10px 12px 6px; background: #fff; font-size: .6875rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: #64748b; }
html[lang="ar"] .dd-group { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
.dd-option { position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; padding-inline-end: 36px; border-radius: 12px;
  font-size: .9375rem; font-weight: 600; color: var(--navy-900); cursor: pointer; }
.dd-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dd-option.is-all { font-weight: 800; color: var(--primary-700); }
.dd-option:hover, .dd-option.is-active { background: var(--primary-50); color: var(--navy-950); }
.dd-option[aria-selected="true"] { background: var(--primary-50); color: var(--primary-700); font-weight: 800; }
.dd-option[aria-selected="true"]::after { content: ""; position: absolute; inset-inline-end: 14px; top: 50%; width: 6px; height: 11px; margin-top: -7px;
  border: solid var(--primary-600); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.dd-option.is-active { box-shadow: inset 0 0 0 2px var(--primary-200); }
.dd-count { flex: none; min-width: 26px; padding: 2px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: .75rem; font-weight: 800; text-align: center; }
.dd-empty { margin: 8px 12px 10px; color: #64748b; font-size: .875rem; }

/* ---------- Internal page header (components/page-hero.php) ---------- */
.ph { position: relative; overflow-x: clip; padding: 28px 0 40px;
  background: radial-gradient(50rem 24rem at 100% -10%, rgba(0, 92, 187, .12), transparent 60%),
    radial-gradient(36rem 20rem at -10% 110%, rgba(11, 127, 121, .07), transparent 60%), linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid #e3eff8; }
@media (min-width: 900px) { .ph { padding: 36px 0 56px; } }
.ph-grid { display: grid; gap: 32px 56px; align-items: center; }
@media (min-width: 900px) { .ph-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } }
.ph-copy { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.ph-crumbs { padding-top: 0; }
.ph-crumbs [aria-current="page"] { color: var(--navy-950); font-weight: 600; }
.ph-title { margin: 0; font-size: clamp(2rem, 4.4vw, 3.25rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.04em; color: var(--navy-950); max-width: 20ch; text-wrap: balance; overflow-wrap: anywhere; }
html[lang="ar"] .ph-title { letter-spacing: 0; line-height: 1.3; }
.ph-text { margin: 0; font-size: 1.125rem; font-weight: 500; line-height: 1.65; color: var(--muted); max-width: 38rem; }
.ph-media { position: relative; }
.ph-glow { position: absolute; inset: -12px; border-radius: 50%; background: var(--grad-primary); opacity: .16; filter: blur(44px); }
.ph-frame { position: relative; background: #fff; border: 1px solid #e3eff8; border-radius: 40px; padding: 12px; box-shadow: 0 10px 30px -10px rgba(0, 92, 187, .2); }
.ph-frame img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 30px; }
@media (max-width: 899px) { .ph-media { max-width: 520px; } }
@media (max-width: 559px) { .ph-frame { border-radius: 28px; padding: 8px; } .ph-frame img { border-radius: 22px; aspect-ratio: 16 / 9; } }
.ph .pr-actions, .ph .pr-trust { margin-top: 4px; }
.ph-after { padding-top: 40px; }

/* ---------- Specialty photo cards (home) ---------- */
.sp-grid { gap: 20px; }
@media (min-width: 640px) { .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sp-card { display: flex; flex-direction: column; height: 100%; padding: 10px; background: #fff; border: 1px solid #e3eff8; border-radius: 28px;
  text-decoration: none; color: var(--navy-950); box-shadow: 0 10px 30px -14px rgba(0, 92, 187, .18); transition: transform .2s, box-shadow .2s, border-color .2s; }
.sp-card:hover { transform: translateY(-4px); border-color: var(--primary-200); box-shadow: 0 24px 40px -18px rgba(0, 92, 187, .35); color: var(--navy-950); }
.sp-media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; background: var(--grad-soft); }
.sp-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.sp-card:hover .sp-media img { transform: scale(1.05); }
.sp-media.is-icon { display: grid; place-items: center; color: var(--primary-600); }
.sp-media.is-icon > .icon { width: 56px; height: 56px; stroke-width: 1.5; }
.sp-badge { position: absolute; top: 12px; inset-inline-start: 12px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px;
  background: rgba(255, 255, 255, .92); color: var(--primary-600); box-shadow: 0 6px 16px -8px rgba(8, 18, 38, .4); backdrop-filter: blur(6px); }
.sp-badge .icon { width: 20px; height: 20px; }
.is-icon .sp-badge { display: none; }
.sp-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 14px 10px 8px; }
.sp-name { grid-column: 1; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; overflow-wrap: anywhere; }
.sp-count { grid-column: 1; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.sp-arrow { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); transition: background .2s, color .2s; }
.sp-arrow .icon { width: 18px; height: 18px; }
.sp-card:hover .sp-arrow { background: var(--primary-600); color: #fff; }
@media (prefers-reduced-motion: reduce) { .sp-card, .sp-media img { transition: none; } .sp-card:hover { transform: none; } .sp-card:hover .sp-media img { transform: none; } }

/* .section sets vertical padding only: keep the container gutters when both classes are combined */
.container.section { padding-inline: 16px; }
@media (min-width: 768px) { .container.section { padding-inline: 24px; } }

/* ---------- Governorate map (home) ---------- */
.gm { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .gm { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }
.gm-panel { display: grid; gap: 18px; padding: 28px; background: #fff; border: 1px solid #e3eff8; border-radius: 32px; box-shadow: 0 20px 40px -24px rgba(0, 92, 187, .3); }
@media (max-width: 559px) { .gm-panel { padding: 20px; border-radius: 24px; } }
.gm-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary-700); }
html[lang="ar"] .gm-kicker { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.gm-kicker .icon { width: 16px; height: 16px; }
.gm-name { margin: 0; font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: var(--navy-950); }
.gm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gm-stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--grad-soft); }
.gm-stat-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #fff; color: var(--primary-600); box-shadow: var(--shadow-sm); }
.gm-stat > span:last-child { display: grid; line-height: 1.2; }
.gm-stat strong { font-size: 1.6rem; font-weight: 800; color: var(--navy-950); font-variant-numeric: tabular-nums; }
.gm-stat small { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.gm-text { margin: 0; color: var(--muted); font-weight: 500; }
.gm-cities { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.gm-cities:empty { display: none; }
.gm-cities li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #f8fafc; border: 1px solid #e3eff8; font-size: .875rem; font-weight: 700; color: var(--navy-950); }
.gm-cities small { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: .75rem; font-weight: 800; text-align: center; }
.gm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 559px) { .gm-actions .btn { flex: 1 1 100%; } }
.gm-choose { padding-top: 16px; border-top: 1px dashed #cbd5e1; }
.gm-choose .label { display: block; margin-bottom: 8px; }
.gm-choose-row { display: flex; gap: 8px; }
.gm-choose-row .select { flex: 1; }
.gm-choose-row [hidden] { display: none; }
.gm-map { display: grid; justify-items: center; gap: 10px; min-width: 0; }
.gm-map[hidden] { display: none; }
.gm-leaflet { width: 100%; height: 560px; border-radius: 32px; overflow: hidden; border: 1px solid #e3eff8; background: #d9eaf7; box-shadow: 0 20px 40px -24px rgba(0, 92, 187, .3); z-index: 0; }
@media (max-width: 899px) { .gm-leaflet { height: 460px; } }
@media (max-width: 559px) { .gm-leaflet { height: 400px; border-radius: 24px; } }
.gm-mk { cursor: pointer; outline: none; }
.gm-mk-halo { position: absolute; inset: 2px; border-radius: 50%; background: rgba(100, 116, 139, .22); }
.gm-mk-dot { position: absolute; inset: 8px; border-radius: 50%; background: #64748b; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(8, 18, 38, .35); transition: background .2s, transform .2s; }
.gm-mk.has-doctors .gm-mk-dot { background: var(--teal-700); }
.gm-mk.has-doctors .gm-mk-halo { background: rgba(11, 127, 121, .25); animation: gm-pulse 2.4s ease-in-out infinite; }
@keyframes gm-pulse { 50% { transform: scale(1.4); opacity: .45; } }
.gm-mk:hover .gm-mk-dot, .gm-mk:focus-visible .gm-mk-dot { background: var(--primary-600); }
.gm-mk:focus-visible .gm-mk-halo { background: rgba(0, 92, 187, .4); }
.gm-mk.is-selected .gm-mk-dot { background: var(--primary-600); transform: scale(1.3); }
.gm-mk.is-selected .gm-mk-halo { background: rgba(0, 92, 187, .3); animation: none; transform: scale(1.3); }
.gm-mk-label { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--navy-950); color: #fff; font: 700 .8125rem/1.3 var(--font-heading); box-shadow: 0 6px 16px rgba(8, 18, 38, .25); pointer-events: none; }
html[lang="ar"] .gm-mk-label { font-family: var(--font-ar); }
.gm-mk.is-selected .gm-mk-label, .gm-mk:hover .gm-mk-label, .gm-mk:focus-visible .gm-mk-label { display: block; }
.gm-legend { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.gm-legend li { display: flex; align-items: center; gap: 6px; }
.gm-legend i { width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .2); }
.gm-legend i.has-doctors { background: var(--teal-700); box-shadow: 0 0 0 3px rgba(11, 127, 121, .2); }
@media (prefers-reduced-motion: reduce) { .gm-mk.has-doctors .gm-mk-halo { animation: none; } }

/* ---------- Admin: site settings (link rows) ---------- */
.set-links { display: grid; gap: 8px; }
.set-link { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.set-link-head { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
html[lang="ar"] .set-link-head { text-transform: none; letter-spacing: 0; }
@media (max-width: 719px) { .set-link { grid-template-columns: 1fr; padding-bottom: 8px; border-bottom: 1px dashed var(--border); } .set-link-head { display: none; } }
.set-save { position: sticky; bottom: 12px; z-index: 5; justify-content: flex-end; }
.set-save .btn { box-shadow: var(--shadow-primary); }

/* ---------- Admin dashboard ---------- */
.dash-section-title { margin: 24px 0 12px; font-size: .8125rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .dash-section-title { letter-spacing: 0; text-transform: none; font-size: .9375rem; }
.dash-section-title:first-of-type { margin-top: 8px; }
a.kpi-clickable { display: block; color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
a.kpi-clickable:hover { border-color: var(--primary-200); transform: translateY(-2px); }
a.kpi-clickable:focus-visible { outline: 3px solid var(--primary-500); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { a.kpi-clickable:hover { transform: none; } }

/* =====================================================================================
   Back-office v2 — "Aurora console"
   Floating dark navigation, frosted top bar, tinted canvas, luminous tiles.
   Scoped to the private areas (.app-body); the public site is untouched.
   ===================================================================================== */
.app-body {
  --bo-nav: #0b1b33; --bo-nav-2: #0a3466; --bo-nav-text: #c9d7e6; --bo-nav-muted: #8aa0bb;
  --bo-glow: #2fc4ee; --bo-surface: rgba(255, 255, 255, .86); --bo-line: rgba(15, 42, 69, .08);
  --bo-shadow: 0 1px 2px rgba(15, 42, 69, .04), 0 12px 32px -12px rgba(15, 42, 69, .14);
  --bo-shadow-hover: 0 2px 4px rgba(15, 42, 69, .05), 0 22px 44px -16px rgba(0, 92, 187, .3);
  background:
    radial-gradient(900px 520px at 100% -10%, rgba(47, 196, 238, .16), transparent 60%),
    radial-gradient(760px 560px at -10% 110%, rgba(11, 127, 121, .10), transparent 60%),
    linear-gradient(180deg, #f4f8fb 0%, #eef3f8 100%) fixed;
  color: #334155;
}

/* ---- Floating dark sidebar ---- */
@media (min-width: 1024px) { .app-body .app { grid-template-columns: 288px minmax(0, 1fr); } }
.app-body .sidebar {
  background: radial-gradient(420px 260px at 0% 0%, rgba(47, 196, 238, .18), transparent 70%), linear-gradient(180deg, var(--bo-nav) 0%, var(--bo-nav-2) 100%);
  border: 0; color: var(--bo-nav-text); padding: 22px 16px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
@media (min-width: 1024px) {
  .app-body .sidebar { margin: 12px; margin-inline-end: 0; height: calc(100vh - 24px); top: 12px; border-radius: 28px; box-shadow: 0 24px 48px -20px rgba(8, 18, 38, .55); }
}
.app-body .side-brand { padding: 0 8px 22px; }
.app-body .side-label { color: var(--bo-nav-muted); font-size: .6875rem; letter-spacing: .14em; padding: 18px 14px 6px; }
html[lang="ar"] .app-body .side-label { letter-spacing: 0; font-size: .8125rem; }
.app-body .sidebar .side-link { position: relative; color: var(--bo-nav-text); padding: 11px 14px; border-radius: 14px; font-weight: 600; transition: background .2s, color .2s; }
.app-body .sidebar .side-link .icon { color: var(--bo-nav-muted); transition: color .2s; }
.app-body .sidebar .side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.app-body .sidebar .side-link:hover .icon { color: #fff; }
.app-body .sidebar .side-link:focus-visible { outline: 2px solid var(--bo-glow); outline-offset: 2px; }
.app-body .sidebar .side-link[aria-current="page"] {
  color: #fff; font-weight: 700; padding-inline-start: 14px;
  background: linear-gradient(90deg, rgba(47, 196, 238, .22) 0%, rgba(47, 196, 238, .06) 100%);
  box-shadow: inset 0 0 0 1px rgba(47, 196, 238, .25);
}
html[dir="rtl"] .app-body .sidebar .side-link[aria-current="page"] { background: linear-gradient(270deg, rgba(47, 196, 238, .22) 0%, rgba(47, 196, 238, .06) 100%); }
.app-body .sidebar .side-link[aria-current="page"]::before {
  content: ""; position: absolute; inset-inline-start: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--bo-glow); box-shadow: 0 0 12px var(--bo-glow);
}
html[dir="rtl"] .app-body .sidebar .side-link[aria-current="page"]::before { border-radius: 4px 0 0 4px; }
.app-body .sidebar .side-link[aria-current="page"] .icon { color: var(--bo-glow); }
.app-body .sidebar .side-link .count { background: var(--bo-glow); color: var(--bo-nav); box-shadow: 0 0 0 3px rgba(47, 196, 238, .18); }
.app-body .side-card { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px; box-shadow: none; }
.app-body .side-card::after { background: rgba(47, 196, 238, .18); }
.app-body .side-card-label { color: var(--bo-glow); }
.app-body .side-foot { border-top-color: rgba(255, 255, 255, .08); }
.app-body .sidebar.open { margin: 0; height: 100vh; top: 0; border-radius: 0; }

/* ---- Frosted floating top bar ---- */
.app-body .topbar {
  height: 68px; margin: 12px 12px 0; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .72); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  box-shadow: var(--bo-shadow); top: 12px;
}
@media (min-width: 768px) { .app-body .topbar { margin: 12px 16px 0; padding: 0 20px; } }
.app-body .topbar-search input { height: 44px; border-radius: 14px; background: rgba(241, 246, 250, .9); border-color: transparent; }
.app-body .topbar-icon { width: 42px; height: 42px; border-radius: 13px; background: rgba(241, 246, 250, .9); border-color: transparent; }
.app-body .topbar-avatar { border-radius: 13px; box-shadow: 0 8px 18px -8px rgba(0, 92, 187, .7); }
.app-body .topbar-sep { background: var(--bo-line); }
.app-body .topbar-title { font-size: 1.0625rem; letter-spacing: -0.01em; }

/* ---- Canvas & page header ---- */
.app-body .main { padding-top: 28px; }
@media (min-width: 768px) { .app-body .main { padding: 32px 32px 56px; } }
.app-body .page-head { margin-bottom: 24px; padding: 4px 2px; }
.app-body .page-head h1 {
  font-style: normal; font-weight: 800; letter-spacing: -0.035em; font-size: clamp(1.6rem, 2.6vw, 2.125rem);
  background: linear-gradient(100deg, var(--navy-950) 0%, #164e6e 60%, var(--primary-600) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[lang="ar"] .app-body .page-head h1 { letter-spacing: 0; }
.app-body .page-head p { color: #5b6b80; font-weight: 500; }

/* ---- Surfaces: cards, tables ---- */
.app-body .card, .app-body .table-wrap, .app-body .kpi {
  background: var(--bo-surface); border: 1px solid rgba(255, 255, 255, .9); box-shadow: var(--bo-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.app-body .card { border-radius: 24px; padding: 24px; }
.app-body .card-head h2, .app-body .card-head h3 { font-size: 1.0625rem; letter-spacing: -0.015em; color: var(--navy-950); }
.app-body .table-wrap { border-radius: 22px; }
.app-body .table th { background: rgba(241, 246, 250, .8); color: #5b6b80; font-size: .6875rem; letter-spacing: .12em; padding: 14px 18px; border-bottom: 1px solid var(--bo-line); }
html[lang="ar"] .app-body .table th { letter-spacing: 0; font-size: .8125rem; }
.app-body .table td { padding: 14px 18px; border-bottom-color: var(--bo-line); }
.app-body .table tbody tr { transition: background .15s; }
.app-body .table tbody tr:hover { background: rgba(47, 196, 238, .07); }
.app-body .table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary-500); }
html[dir="rtl"] .app-body .table tbody tr:hover td:first-child { box-shadow: inset -3px 0 0 var(--primary-500); }
.app-body .cell-strong { color: var(--navy-950); }
.app-body a.cell-strong:hover { color: var(--primary-600); }

/* ---- KPI tiles: icon chip, accent line, lift on hover ---- */
.app-body .kpis { gap: 14px; }
@media (min-width: 1100px) { .app-body .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.app-body .kpis .kpi, .app-body .kpis .kpi:nth-child(4n+1), .app-body .kpis .kpi:nth-child(4n+4) {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px 20px 18px; background: var(--bo-surface); border-color: rgba(255, 255, 255, .9);
}
.app-body .kpis .kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--primary-600), var(--bo-glow)); opacity: .85; }
.app-body .kpis .kpi:nth-child(4n+2)::before { background: linear-gradient(90deg, var(--teal-700), #34d399); }
.app-body .kpis .kpi:nth-child(4n+3)::before { background: linear-gradient(90deg, #b45309, #f59e0b); }
.app-body .kpis .kpi:nth-child(4n+4)::before { background: linear-gradient(90deg, #4338ca, #818cf8); }
.app-body .kpis .kpi-label, .app-body .kpis .kpi:nth-child(4n+4) .kpi-label { color: #5b6b80; font-size: .6875rem; letter-spacing: .1em; gap: 10px; }
html[lang="ar"] .app-body .kpis .kpi-label { letter-spacing: 0; font-size: .8125rem; }
.app-body .kpis .kpi-label > .icon { flex: none; width: 32px; height: 32px; padding: 7px; border-radius: 11px; background: rgba(0, 92, 187, .1); color: var(--primary-600); }
.app-body .kpis .kpi:nth-child(4n+2) .kpi-label > .icon { background: rgba(11, 127, 121, .1); color: var(--teal-700); }
.app-body .kpis .kpi:nth-child(4n+3) .kpi-label > .icon { background: rgba(180, 83, 9, .1); color: #b45309; }
.app-body .kpis .kpi:nth-child(4n+4) .kpi-label > .icon { background: rgba(67, 56, 202, .1); color: #4338ca; }
.app-body .kpis .kpi-value, .app-body .kpis .kpi:nth-child(4n+4) .kpi-value { color: var(--navy-950); font-size: 2.125rem; letter-spacing: -0.04em; margin-top: 12px; }
.app-body .kpis .kpi-note { color: #5b6b80; font-weight: 500; }
.app-body a.kpi-clickable:hover { transform: translateY(-3px); box-shadow: var(--bo-shadow-hover); border-color: rgba(47, 196, 238, .5); }

/* ---- Small parts: chips, badges, links inside cards, forms ---- */
.app-body .chip-link { background: rgba(255, 255, 255, .8); border-color: rgba(15, 42, 69, .1); transition: background .15s, border-color .15s, color .15s; }
.app-body .chip-link[aria-current="page"] { background: var(--navy-950); border-color: var(--navy-950); color: #fff; box-shadow: 0 8px 18px -10px rgba(8, 18, 38, .8); }
.app-body .badge { border-radius: 999px; padding: 4px 10px; }
.app-body .badge-available { background: rgba(16, 185, 129, .12); color: #047857; }
.app-body .badge-listed { background: rgba(100, 116, 139, .12); color: #475569; }
.app-body .main .card .side-link { border-radius: 14px; padding: 11px 12px; color: #334155; }
.app-body .main .card .side-link:hover { background: rgba(47, 196, 238, .08); color: var(--navy-950); }
.app-body .main .card .side-link .count { background: var(--navy-950); color: #fff; }
.app-body .main .input, .app-body .main .select, .app-body .main .textarea { border-radius: 14px; background: rgba(255, 255, 255, .9); }
.app-body .main fieldset legend { color: var(--navy-950); }
.app-body .dash-section-title { color: #5b6b80; display: flex; align-items: center; gap: 10px; }
.app-body .dash-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(15, 42, 69, .14), transparent); }
html[dir="rtl"] .app-body .dash-section-title::after { background: linear-gradient(270deg, rgba(15, 42, 69, .14), transparent); }
.app-body .alert { border-radius: 18px; }

/* ---- Entrance: short fade-up of the page blocks (none with reduced motion) ---- */
@keyframes bo-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-body .main > * { animation: bo-rise .35s cubic-bezier(.2, .7, .2, 1) both; }
.app-body .main > *:nth-child(2) { animation-delay: .04s; }
.app-body .main > *:nth-child(3) { animation-delay: .08s; }
.app-body .main > *:nth-child(n+4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  .app-body .main > * { animation: none; }
  .app-body a.kpi-clickable:hover { transform: none; }
}
.app-body .side-sep { background: rgba(255, 255, 255, .08); }
.app-body .side-hint { color: var(--bo-nav-muted); }

/* ---- Find my profile (professionals, removal) ---- */
.rm-find { display: grid; gap: 8px; margin-bottom: 8px; }
.pr-find { display: grid; gap: 6px; margin: 20px 0 4px; max-width: 520px; }
.rm-find-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rm-find-row .input { flex: 1 1 220px; min-width: 0; }

/* ---- A4 poster (/professionnels/affiche) ---- */
.print-body { background: var(--bg); }
.poster-tools { display: flex; justify-content: space-between; gap: 12px; max-width: 210mm; margin: 24px auto 12px; padding: 0 16px; }
.poster { box-sizing: border-box; width: 210mm; max-width: calc(100% - 32px); min-height: 297mm; margin: 0 auto 40px; padding: 18mm 16mm;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r); display: flex; flex-direction: column; gap: 10mm; }
.poster-head { display: flex; justify-content: center; transform: scale(1.4); transform-origin: top center; margin-bottom: 4mm; }
.poster-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; }
.poster-lang h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 10px; color: var(--navy-950); }
.poster-lang[lang="ar"] { font-family: var(--font-ar); }
.poster-lead { font-size: 1.05rem; color: var(--text); margin: 0 0 14px; }
.poster-steps { margin: 0; padding-inline-start: 1.3em; display: grid; gap: 8px; font-size: 1rem; }
.poster-free { margin: 14px 0 0; font-weight: 700; color: var(--teal-700); }
.poster-qr { margin-top: auto; display: grid; justify-items: center; gap: 6px; text-align: center; padding-top: 8mm; border-top: 2px dashed var(--border-strong); }
.poster-qr-code svg { width: 62mm; height: 62mm; display: block; }
.poster-qr p { margin: 0; font-weight: 600; }
.poster-url { font-size: 1.2rem; color: var(--primary-700); }
@media (max-width: 720px) {
  .poster { min-height: 0; padding: 24px 16px; }
  .poster-langs { grid-template-columns: 1fr; }
  .poster-qr-code svg { width: 200px; height: 200px; }
}
@media print {
  @page { size: A4; margin: 0; }
  .no-print { display: none !important; }
  .print-body { background: #fff; }
  .poster { width: 210mm; max-width: none; height: 297mm; margin: 0; border: 0; border-radius: 0; }
  .poster-langs { grid-template-columns: 1fr 1fr; }
}

/* ---- Claim campaign (/admin/campagne) ---- */
.or-template { margin-top: 16px; }
.or-template summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.or-template form { margin-top: 12px; display: grid; gap: 8px; }
.or-template .alert { margin-top: 12px; }
.or-actions { min-width: 260px; }
.or-record { margin-top: 6px; }
.or-record summary { cursor: pointer; font-size: .85rem; color: var(--primary-700); }
.or-record form { display: grid; gap: 6px; margin-top: 6px; }
.or-record .select { max-width: 160px; }


/* ---- Page builder blocks (public) ---- */
.bk-page > .bk-section:first-child, .bk-page > .bk-notice:first-child { margin-top: 0; }
.bk-section { padding: 28px 0 8px; }
.bk-narrow { max-width: 820px; }
.bk-h2 { font-size: 1.25rem; margin: 8px 0 10px; }
.bk-notice { margin-top: 20px; margin-bottom: 8px; }
.bk-find { margin-top: 28px; }
.bk-after-hero { padding-top: 32px; }
.bk-page > :last-child { margin-bottom: 56px; }
.bk-media { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.bk-media.is-start .bk-media-img { order: -1; }
.bk-media-img img { width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--shadow); display: block; }
@media (max-width: 860px) { .bk-media { grid-template-columns: 1fr; gap: 24px; } .bk-media.is-start .bk-media-img { order: 0; } }


/* ---- Page builder (back-office) ---- */
.pg-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pg-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; box-sizing: border-box; }
.pg-card:hover, .pg-card:focus-visible { border-color: var(--primary-600); box-shadow: var(--shadow); transform: translateY(-1px); }
.pg-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.pg-icon .icon { width: 22px; height: 22px; }
.pg-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pg-go { color: var(--muted); }

.bk-form { display: grid; gap: 20px; }
.bk-settings .bk-seo { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.bk-seo summary, .bk-seo summary .icon { cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.bk-seo .bkf-grid { margin-top: 12px; }
.bk-blocks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bk-blocks-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.bk-count { font-size: .8rem; font-weight: 700; background: var(--primary-100); color: var(--primary-700); border-radius: 999px; padding: 2px 10px; }
.bk-list { display: grid; gap: 10px; }

.bk { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: box-shadow .15s, opacity .15s; }
.bk:focus-within { box-shadow: 0 0 0 2px var(--primary-200); }
.bk.is-dragging { opacity: .45; }
.bk.is-hidden { border-style: dashed; }
.bk.is-hidden .bk-title-text, .bk.is-hidden .bk-type-icon { opacity: .55; }
.bk-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
.bk-handle { cursor: grab; color: var(--muted); display: grid; place-items: center; width: 28px; height: 36px; border-radius: 8px; touch-action: none; }
.bk-handle:hover { background: var(--bg); color: var(--text); }
.bk-title { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px; border-radius: 10px;
  cursor: pointer; text-align: start; font: inherit; color: inherit; }
.bk-title:hover { background: var(--bg); }
.bk-type-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.bk-title-text { display: grid; min-width: 0; }
.bk-sum { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-chev { margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.bk-title[aria-expanded="true"] .bk-chev { transform: rotate(90deg); }
[dir="rtl"] .bk-title[aria-expanded="true"] .bk-chev { transform: rotate(-90deg); }
.bk-badge-hidden { display: none; font-size: .75rem; font-weight: 700; color: var(--amber-700); background: var(--amber-50); border-radius: 999px; padding: 2px 10px; }
.bk.is-hidden .bk-badge-hidden { display: inline-block; }
.bk-tools { display: flex; align-items: center; gap: 4px; }
.bk-vis { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; margin-inline-end: 6px; cursor: pointer; }
.bk-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px; cursor: pointer; color: var(--text); }
.bk-btn:hover { background: var(--bg); border-color: var(--primary-500); }
.bk-btn-danger:hover { color: var(--red-700); border-color: var(--red-700); background: var(--red-50); }
.bk-btn .icon { width: 16px; height: 16px; }
.bk-rot-up { transform: rotate(90deg); }
.bk-rot-down { transform: rotate(-90deg); }
.bk-body { padding: 4px 16px 18px; border-top: 1px solid var(--border); }
.bk-desc { margin: 12px 0; }

.bkf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.bkf { display: grid; gap: 6px; align-content: start; min-width: 0; }
.bkf.is-wide, .bkf-i18n, .is-wide { grid-column: 1 / -1; }
.bkf-i18n:not(.is-wide) { grid-column: 1 / -1; }
.bkf-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bkf-lang { position: relative; display: block; }
.bkf-tag { position: absolute; top: 8px; inset-inline-end: 8px; font-size: .65rem; font-weight: 800; letter-spacing: .04em; color: var(--primary-700);
  background: var(--primary-50); border-radius: 6px; padding: 1px 6px; pointer-events: none; z-index: 1; }
.bkf-lang .input, .bkf-lang .textarea { padding-inline-end: 44px; width: 100%; box-sizing: border-box; }
.bkf-html { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.bkf-bool { align-self: end; padding-bottom: 8px; }
.bkf-prefix { display: flex; align-items: center; gap: 4px; }
.bkf-prefix > span { color: var(--muted); }
.bkf-icon-row { display: flex; gap: 8px; align-items: center; }
.bkf-icon-preview { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.bkf-image-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.bkf-thumb { flex: none; width: 120px; height: 80px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border-strong); color: var(--muted); }
.bkf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bkf-image-ctl { flex: 1 1 260px; display: grid; gap: 6px; }
.bkf-rep { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; background: var(--bg); }
.bkf-rep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: rep; }
.bkf-rep-item { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 10px; counter-increment: rep; }
.bkf-rep-tools { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.bkf-rep-tools::before { content: "#" counter(rep); margin-inline-end: auto; font-weight: 700; color: var(--muted); font-size: .85rem; }
.bkf-rep > [data-rep-add] { justify-self: start; margin-top: 4px; }

.bk-add { margin-top: 16px; padding: 16px; border: 2px dashed var(--border-strong); border-radius: var(--r); display: grid; gap: 8px; }
.bk-add .select { max-width: 520px; flex: 1 1 280px; }
.bk-savebar { position: sticky; bottom: 12px; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 16px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.bk-savebar [data-bk-dirty] { color: var(--amber-700); display: inline-flex; align-items: center; gap: 6px; }
.bk-savebar [data-bk-dirty][hidden] { display: none; }
.bk-danger { margin-top: 16px; display: flex; justify-content: flex-end; }
@media (max-width: 720px) {
  .bkf-grid, .bkf-langs { grid-template-columns: 1fr; }
  .bk-tools { width: 100%; justify-content: flex-end; }
  .bk-title { flex-basis: calc(100% - 40px); }
}


/* ---- Search: nearest first ---- */
.s-geo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; padding: 10px 14px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); }
.s-geo[hidden] { display: none; }
.s-geo.is-on { border-color: var(--teal-700); background: var(--teal-50); }
.s-geo-icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.s-geo.is-on .s-geo-icon { background: #fff; color: var(--teal-700); }
.s-geo-text { margin: 0; flex: 1 1 240px; font-size: .92rem; }
.mf-dist { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .8rem; font-weight: 700; color: var(--teal-700); white-space: nowrap; }
.mf-pcard-facts dd .mf-dist { display: flex; }
.mf-dist .icon { width: 13px; height: 13px; }

/* Search updated in place, and light motion */
.s-name { position: relative; }
[data-live-results] { scroll-margin-top: 96px; }
[data-live-results] #s-title:focus { outline: 0; }
@media (min-width: 1000px) { .s-filters.is-live > .btn-block:not(.s-reset) { display: none; } }
.is-loading .s-results { pointer-events: none; }
.is-loading .mf-pcard::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, rgba(255, 255, 255, .55) 30%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, .55) 70%); background-size: 220% 100%; animation: shimmer 1.1s linear infinite; }
.is-fresh .s-results > * { animation: h-rise .32s cubic-bezier(.2, .7, .3, 1) both; }
.is-fresh .s-results > :nth-child(2) { animation-delay: 40ms; }
.is-fresh .s-results > :nth-child(3) { animation-delay: 80ms; }
.is-fresh .s-results > :nth-child(4) { animation-delay: 120ms; }
.is-fresh .s-results > :nth-child(n+5) { animation-delay: 160ms; }
.mf-pcard { transition: border-color .2s, box-shadow .2s, transform .2s; }
.mf-pcard:hover { box-shadow: 0 16px 36px -12px rgba(0, 92, 187, .28); transform: translateY(-3px); }
.btn:active, .s-toggle:active, .s-chip:active { transform: scale(.97); }
.reveal { opacity: 0; transform: translateY(14px); }
.bk-page > section, .mf-cards > * { transition: opacity .45s ease-out, transform .45s ease-out; }
.mf-cards > .mf-pcard { transition: opacity .45s ease-out, border-color .2s, box-shadow .2s, transform .25s; }
@media (prefers-reduced-motion: reduce) {
  .is-loading .mf-pcard::after { animation: none; background: rgba(255, 255, 255, .55); }
  .is-fresh .s-results > * { animation: none; }
  .mf-pcard:hover, .btn:active, .s-toggle:active, .s-chip:active { transform: none; }
}
@media print { .reveal { opacity: 1; transform: none; } }

/* Directory figures (home) */
.h-stats { padding: 40px 0 0; }
.h-stats-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .h-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.h-stat { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 18px; background: #fff; border: 1px solid #e3eff8; border-radius: 24px; }
.h-stat-icon { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--primary-50); color: var(--primary-600); }
.h-stat strong { font-family: var(--font-heading); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 800; line-height: 1.1; color: var(--navy-950); font-variant-numeric: tabular-nums; }
.h-stat > span:last-child { color: var(--muted); font-size: .875rem; font-weight: 600; line-height: 1.3; }
.h-stats-note { margin: 14px 0 0; color: var(--muted); font-size: .8125rem; text-align: center; }
html[lang="ar"] .h-stat strong { font-family: var(--font-ar); }

/* Live slots */
.slot { transition: opacity .2s, transform .2s, background-color .15s, color .15s; }
.slot.is-gone { opacity: 0; transform: scale(.9); }
.slot.is-new { animation: h-rise .3s ease-out both; }
.slot-note { margin: 0; color: var(--muted); font-size: .8125rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { .slot.is-new { animation: none; } }

/* Filters: button under the position bar and bottom sheet on small screens */
.s-filters-close { display: none; }
.s-filters-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary-600); color: #fff; font-size: .75rem; font-weight: 800; }
.s-filters-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(8, 18, 38, .45); }
.s-filters-scrim[hidden] { display: none; }
html.has-sheet { overflow: hidden; }
@keyframes s-sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 999px) {
  .search-layout > div:first-child { display: contents; }
  .s-filters-open { width: 100%; min-height: 48px; justify-content: center; margin-bottom: var(--s3); }
  .filters.open { position: fixed; inset: auto 0 0 0; z-index: 71; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 28px 28px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -16px 40px rgba(8, 18, 38, .2); animation: s-sheet .26s cubic-bezier(.2, .7, .3, 1); }
  .filters.open .s-filters-close { position: absolute; top: 14px; inset-inline-end: 14px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--primary-50); color: var(--navy-950); cursor: pointer; }
  .filters.open .s-filters-title { min-height: 44px; margin-bottom: var(--s2); padding-inline-end: 52px; }
  .filters.open > .btn-block { position: sticky; bottom: 0; margin-top: var(--s4); min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .filters.open { animation: none; } }

/* Doctor card: compact layout */
.dcard-grid { gap: 16px; }
.mf-dcard { gap: 12px; padding: 16px; border-radius: 24px; }
.mf-dcard .mf-pcard-top { gap: 10px; }
.mf-dcard .mf-person { flex: 1; gap: 10px; }
.mf-dcard .mf-photo, .mf-dcard .mf-photo img { width: 52px; height: 52px; }
.mf-dcard .mf-photo img { border-radius: 14px; }
.mf-dcard .mf-pcard-name { font-size: 1rem; margin-bottom: 2px; }
.mf-dcard .mf-pcard-meta { flex: none; max-width: 44%; gap: 4px; }
.mf-spec { padding: 4px 10px; border-radius: 12px; background: var(--primary-50); color: var(--primary-700); font-size: .75rem; font-weight: 800; line-height: 1.3; text-align: end; overflow-wrap: anywhere; }
.mf-place { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; font-size: .875rem; font-weight: 600; line-height: 1.35; color: #15294a; }
.mf-place .icon { flex: none; width: 15px; height: 15px; color: var(--primary-600); }
.mf-place .mf-dist { margin-top: 0; }
.mf-card-note { margin: 0; font-size: .75rem; color: #64748b; }
.mf-dcard .mf-pcard-next { align-items: center; }
.mf-dcard .mf-pcard-next small { grid-column: auto; text-align: end; }

.site-footer .brand { margin-bottom: var(--s3); }

/* Public menu: thin top bar (emergency, language, account) above the main bar */
.site-topbar { background: var(--primary-600); color: #fff; font-size: .8125rem; font-weight: 600; }
.site-topbar .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 38px; }
.site-topbar a { display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; min-height: 38px; color: #fff; text-decoration: none; }
.site-topbar a:hover { text-decoration: underline; }
.site-topbar a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.site-topbar .icon { width: 14px; height: 14px; flex: none; }
.site-topbar-links { display: flex; align-items: center; gap: var(--s4); }
.site-topbar .lang-switch { padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; font-weight: inherit; }
@media (min-width: 1100px) {
  .site-header .nav { margin-inline: auto 0; }
  .site-header .header-actions { margin-inline-start: 0; }
  .site-header .header-actions .btn { margin-inline-end: -13px; } /* button label lines up with the top bar links */
}
@media (max-width: 360px) {
  .site-topbar { font-size: .75rem; }
  .site-topbar .container { gap: var(--s2); }
  .site-topbar-links { gap: var(--s3); }
  .site-topbar .icon { display: none; }
}
@media print { .site-topbar { display: none !important; } }

/* Language menu in the top bar: shows the current language, opens the other one */
.lang-menu { position: relative; }
.lang-menu summary { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; color: #fff; cursor: pointer; list-style: none; white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; width: 6px; height: 6px; margin: -3px 2px 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.lang-menu[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.lang-menu summary:hover span { text-decoration: underline; }
.lang-menu summary:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.lang-menu-list { position: absolute; top: 100%; inset-inline-end: 0; z-index: 50; min-width: 140px; margin-top: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-lg); }
.site-topbar .lang-menu-list .lang-switch { display: flex; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--navy-950); font-size: .875rem; font-weight: 700; }
.site-topbar .lang-menu-list .lang-switch:hover { background: var(--primary-50); color: var(--primary-600); text-decoration: none; }
.site-topbar .lang-menu-list .lang-switch:focus-visible { outline: 2px solid var(--primary-600); outline-offset: -2px; }
@media (max-width: 360px) { .lang-menu summary .icon { display: none; } }
@media (prefers-reduced-motion: reduce) { .lang-menu summary::after { transition: none; } }

/* Doctor profile: map under the practical information */
.p-map-wrap { min-width: 0; }
.p-map-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 10px 0 0; font-size: .8125rem; color: var(--muted); }
.p-map-note a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-inline-start: auto; color: var(--primary-600); font-weight: 700; }
.p-map-note .icon { width: 15px; height: 15px; flex: none; }

/* Fields inside a grid line up: the stacked-field margin only applies outside grids */
.form-grid > .field + .field { margin-top: 0; }

/* Doctor profile: practical information */
.p-info { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.p-info > div { position: relative; min-height: 44px; padding-inline-start: 56px; }
.p-info dt { margin-bottom: 3px; font-size: .8125rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.p-info dt .icon { position: absolute; top: 0; inset-inline-start: 0; width: 44px; height: 44px; padding: 12px; border-radius: 14px; background: var(--primary-50); color: var(--primary-600); }
.p-info dd { gap: 3px; }
.p-info dd strong { font-size: 1rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.p-phone { font-size: 1rem; font-weight: 700; text-decoration: none; color: var(--primary-600); justify-self: start; }
.p-phone:hover { text-decoration: underline; }
html[dir="rtl"] .p-phone { justify-self: end; }
@media (min-width: 640px) {
  .p-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .p-info-wide { grid-column: 1 / -1; }
}

/* Claim form */
.file-pick { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px dashed var(--primary-200); border-radius: 16px; background: var(--primary-50); cursor: pointer; transition: border-color .15s, background .15s; }
.file-pick:hover { border-color: var(--primary-500); }
.file-pick:focus-within { border-color: var(--primary-600); box-shadow: var(--ring); }
.file-pick.is-filled { border-style: solid; border-color: var(--primary-600); background: #fff; }
.file-pick-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--primary-600); }
.file-pick-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.file-pick-text strong { font-size: .9375rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick-text small { font-size: .8125rem; color: var(--muted); }
.file-pick .btn { flex: none; pointer-events: none; }
.claim-attest { padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); line-height: 1.5; }
@media (max-width: 479px) { .file-pick .btn { display: none; } }

.form-grid + .field { margin-top: var(--s4); }

/* Search filters: reset, place steps, map popup */
.s-reset { margin-top: var(--s2); min-height: 44px; }
.s-reset .icon { width: 16px; height: 16px; }
.s-steps { display: grid; gap: var(--s3); }
.s-steps .field + .field { margin-top: 0; }
.filters .s-steps + .s-checks, .filters .field + .s-steps { margin-top: var(--s3); }
.s-step { position: relative; padding-inline-start: 14px; }
.s-step::before { content: ""; position: absolute; inset-block: 2px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--primary-200); }
.s-map-btn { display: none; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--primary-600); background: var(--primary-600); color: #fff; font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
.has-map .s-map-btn { display: inline-flex; }
.s-map-btn .icon { width: 16px; height: 16px; }
.s-map-btn:hover { background: var(--primary-700); }
dialog.modal.s-map { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 18px; border-radius: 24px; }
dialog.modal.s-map[open] { display: flex; flex-direction: column; gap: 10px; }
.s-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.s-map-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.125rem; }
.s-map-head h2 .icon { color: var(--primary-600); }
.s-map-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--primary-50); color: var(--navy-950); cursor: pointer; }
.s-map-hint { margin: 0; font-size: .875rem; color: var(--muted); }
.s-map-canvas { flex: 1 1 auto; height: min(62dvh, 560px); min-height: 280px; border-radius: 16px; overflow: hidden; background: #d9eaf7; }
.s-map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.s-map-count { flex: 1 1 260px; margin: 0; font-size: .8125rem; color: var(--muted); }
.s-map-pop { display: grid; gap: 6px; font-family: var(--font); }
.s-map-pop p { margin: 0; display: grid; }
.s-map-pop a { font-weight: 700; color: var(--primary-600); }
.s-map-pop span, .s-map-pop-more, .s-map-pop-note { font-size: .75rem; color: var(--muted); }
@media (max-width: 599px) { .s-map-foot .btn { width: 100%; } .s-map-canvas { height: 52dvh; } }

@media (min-width: 1000px) { .s-filters.is-live > .s-reset { margin-top: var(--s4); } }
