/* ============================================================
   Brands Factory — Dental Clinic Demo
   Design system per build brief. RTL-first, mobile-first.
   ============================================================ */

:root {
  --bg:        #FCFCFD;
  --surface:   #FFFFFF;
  --ink:       #101828;
  --ink-soft:  #667085;
  --accent:    #0F766E;
  --accent-dk: #115E59;
  --accent-sf: #ECFDF5;
  --locked:    #B45309;
  --locked-sf: #FFFBEB;
  --line:      #EAECF0;

  --r-panel:  12px;
  --r-button: 10px;
  --r-pill:   999px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-3: 0 20px 48px rgba(15, 118, 110, 0.14);

  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;

  --switcher-h: 64px;
  --leads-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-block-start: var(--switcher-h);
  padding-block-end: var(--leads-h);
}

h1, h2, h3 { line-height: 1.35; margin: 0; }
h1 { font-size: clamp(26px, 7vw, 38px); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 20px; font-weight: 600; }
p  { margin: 0; max-width: 70ch; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* ---------- التركيز بالكيبورد ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: 1060px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ============================================================
   شريط تبديل الباقات — مثبت أعلى الشاشة
   ============================================================ */
.switcher {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--line);
  height: var(--switcher-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 10px;
}

.switcher-pills {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-inline: auto;
  max-width: 440px;
  box-shadow: var(--shadow-1);
}

.switcher-pill {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: 44px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.3;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.switcher-pill small {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
  opacity: .85;
  white-space: nowrap;
}
.switcher-pill[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, .35);
}
.switcher-pill[aria-pressed="true"] small { color: #fff; opacity: .9; }

.demo-badge {
  flex-shrink: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  border: 1px dashed var(--locked);
  color: var(--locked);
  border-radius: var(--r-pill);
  padding: 3px 8px;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .demo-badge { font-size: 0; padding: 4px 9px; }
  .demo-badge::after { content: 'تجريبي'; font-size: 12px; }
}

/* ============================================================
   الهيدر
   ============================================================ */
.site-header {
  padding-block: 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.site-nav a, .site-nav button { color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.site-nav a:hover, .site-nav button:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   الهيرو — شريط نعناعي + موك-أب حي
   ============================================================ */
.hero-band {
  background: var(--accent-sf);
  border-block-end: 1px solid #D1FAE5;
  padding-block: 36px 44px;
  margin-block-end: 8px;
}
.hero-grid {
  display: grid;
  gap: 32px;
  align-items: center;
}
.hero-copy .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  margin-block-end: 10px;
  background: var(--surface);
  border: 1px solid #D1FAE5;
  border-radius: var(--r-pill);
  padding: 5px 14px;
}
.hero-copy p.lead {
  color: var(--ink-soft);
  font-size: 16px;
  margin-block: 14px 20px;
}
.hero-copy .hours {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin-block-end: 22px;
}
.hero-copy .hours svg { flex-shrink: 0; }
.hero-copy .hours span { min-width: 0; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* موك-أب التليفون */
.phone-mock { display: none; }
.phone-frame {
  width: 300px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 36px;
  padding: 10px;
  box-shadow: var(--shadow-3);
}
.phone-notch {
  width: 110px; height: 22px;
  background: var(--ink);
  border-radius: 0 0 14px 14px;
  margin: -10px auto 0;
  position: relative;
  z-index: 2;
}
.phone-screen {
  background: var(--bg);
  border-radius: 28px;
  padding: 26px 12px 12px;
  margin-block-start: -12px;
}
.pm-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 10px; }
.pm-head b { font-size: 14px; }
.pm-head span { font-size: 11px; color: var(--ink-soft); }
.pm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-block-end: 6px;
  font-size: 11px;
}
.pm-row.sent { background: var(--accent-sf); border-color: #A7F3D0; }
.pm-time { font-weight: 600; white-space: nowrap; }
.pm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.pm-btn {
  background: var(--accent); color: #fff;
  border-radius: 6px; padding: 3px 10px; font-weight: 600; font-size: 10px;
}
.pm-done { color: var(--accent); font-weight: 600; font-size: 10px; }
.pm-foot {
  text-align: center; font-size: 11px; color: var(--ink-soft);
  padding-block-start: 6px;
}
.phone-caption {
  text-align: center; font-size: 13px; color: var(--ink-soft);
  margin-block-start: 12px;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.2fr .8fr; }
  .phone-mock { display: block; }
}

/* ============================================================
   الأزرار
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--r-button);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .28);
}
.btn-primary:hover { background: var(--accent-dk); box-shadow: 0 8px 20px rgba(15, 118, 110, .34); }
.btn-primary:disabled { background: var(--ink-soft); box-shadow: none; cursor: default; }
.btn-ghost {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:disabled { color: var(--ink-soft); border-color: var(--line); cursor: default; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 14px; }

/* ============================================================
   الأقسام
   ============================================================ */
section { padding-block: 28px; }
.section-title { margin-block-end: 6px; }
.section-sub { color: var(--ink-soft); font-size: 14px; margin-block-end: 20px; }

/* ============================================================
   كروت الباقات
   ============================================================ */
.tier-cards {
  display: grid;
  gap: 14px;
}
.tier-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.tier-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tier-card.featured {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-3);
}
.tier-card.current {
  border: 2px dashed var(--accent);
}
.tier-card h3 { font-size: 20px; margin-block-end: 2px; }
.tier-price {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
}
.tier-price small { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.tier-tag { font-size: 13px; color: var(--ink-soft); margin-block: 2px 14px; }
.tier-best {
  position: absolute;
  inset-block-start: -13px;
  inset-inline-start: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 3px 12px;
  box-shadow: 0 4px 10px rgba(15, 118, 110, .3);
}
.tier-current {
  position: absolute;
  inset-block-start: -13px;
  inset-inline-end: 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 3px 12px;
}
.tier-feats {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
  flex: 1;
}
.tier-feats li { display: flex; gap: 8px; align-items: flex-start; }
.tier-feats li::before {
  content: '';
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-block-start: 3px;
  background: var(--accent-sf);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F766E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}
@media (min-width: 880px) {
  .tier-cards { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  .tier-card.featured { transform: scale(1.03); }
  .tier-card.featured:hover { transform: scale(1.03) translateY(-2px); }
}

/* ============================================================
   شريط مزية الواتساب
   ============================================================ */
.feat-band {
  background: var(--accent-sf);
  border: 1px solid #D1FAE5;
  border-radius: 20px;
  padding: 24px 20px;
  margin-block: 12px;
}
.feat-grid { display: grid; gap: 24px; align-items: center; }
.feat-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
}
.feat-points li { display: flex; gap: 10px; align-items: flex-start; }
.feat-points svg { color: var(--accent); flex-shrink: 0; margin-block-start: 4px; }

/* محاكاة شات واتساب */
.wa-mock {
  background: #E7E0D7;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  max-width: 380px;
  margin-inline: auto;
  width: 100%;
}
.wa-head {
  background: #075E54;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
}
.wa-head b { display: block; font-size: 14px; }
.wa-head span { font-size: 11px; opacity: .8; }
.wa-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-sf);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.wa-body { padding: 16px 12px; }
.wa-bubble {
  background: #DCF8C6;
  border-radius: 10px 2px 10px 10px;
  padding: 10px 12px 6px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,.12);
  position: relative;
}
.wa-time {
  display: block;
  text-align: end;
  font-size: 10px;
  color: #8696A0;
  margin-block-start: 4px;
}
@media (min-width: 880px) {
  .feat-grid { grid-template-columns: 1.1fr .9fr; }
  .feat-band { padding: 36px 32px; }
}

/* ============================================================
   خطوات الاستخدام
   ============================================================ */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
}
.steps b { display: block; margin-block-end: 2px; }
.steps p { font-size: 14px; color: var(--ink-soft); }
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 118, 110, .3);
}
@media (min-width: 880px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   الخدمات — قائمة نضيفة
   ============================================================ */
.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.services-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  transition: background 120ms ease;
}
.services-list li:hover { background: var(--accent-sf); }
.services-list li + li { border-block-start: 1px solid var(--line); }
.services-list .price {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

/* عن الدكتور */
.about {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
  padding: 20px;
}
.about img {
  width: 96px;
  height: 96px;
  border-radius: var(--r-panel);
  flex-shrink: 0;
  background: var(--bg);
}
.about .creds {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.about .creds li { padding-block: 2px; }
.about .creds li::before { content: '— '; color: var(--accent); }

/* فورم الحجز */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
  padding: 20px;
}
.field { margin-block-end: 16px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-block-end: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-button);
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-sf);
}

/* الدفع أونلاين (محاكاة) */
.pay-sim {
  border: 1px dashed var(--line);
  border-radius: var(--r-panel);
  padding: 16px;
  margin-block: 16px;
  background: var(--bg);
}
.pay-sim .sim-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  background: var(--locked-sf);
  color: var(--locked);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  margin-block-end: 10px;
}

/* الموقع */
.map-link { display: block; border-radius: var(--r-panel); overflow: hidden; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.map-link img { width: 100%; height: auto; }

/* الفوتر */
.site-footer {
  border-block-start: 1px solid var(--line);
  margin-block-start: 24px;
  padding-block: 24px 32px;
  color: var(--ink-soft);
  font-size: 14px;
}
.site-footer .cols { display: grid; gap: 16px; }
.reset-link {
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ============================================================
   العناصر المقفولة (العنبري)
   ============================================================ */
.lock-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 14px 0;
}
.lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--locked);
  color: var(--locked);
  background: var(--locked-sf);
  font-size: 14px;
  font-weight: 600;
  transition: transform 120ms ease;
}
.lock-chip:hover { transform: scale(1.03); }
.lock-chip svg { flex-shrink: 0; }
.locked { position: relative; opacity: .75; }
.locked .lock-mini {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 6px;
  color: var(--locked);
}

/* ============================================================
   الشيت السفلي للمزايا المقفولة
   ============================================================ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .4);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 90;
  background: var(--surface);
  border-start-start-radius: 20px;
  border-start-end-radius: 20px;
  box-shadow: var(--shadow-2);
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  max-width: 680px;
  margin-inline: auto;
  transform: translateY(100%);
  transition: transform 200ms ease;
}
.sheet.open { transform: translateY(0); }
.sheet .grabber {
  width: 40px; height: 4px;
  background: var(--line);
  border-radius: var(--r-pill);
  margin: 0 auto 16px;
}
.sheet h3 { margin-block-end: 8px; }
.sheet p { color: var(--ink-soft); margin-block-end: 20px; font-size: 14px; }
.sheet .sheet-actions { display: grid; gap: 10px; }
.sheet .sheet-close {
  min-height: 44px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ============================================================
   شريط العميل المحتمل — أسفل الشاشة
   ============================================================ */
.lead-bar {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 70;
  background: var(--ink);
  color: #fff;
  min-height: var(--leads-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  font-size: 14px;
  flex-wrap: wrap;
  text-align: center;
}
.lead-bar .lead-cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 8px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(15, 118, 110, .45);
}
.lead-bar .lead-cta:hover { background: var(--accent-dk); text-decoration: none; }

/* ============================================================
   لوحة التحكم
   ============================================================ */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 16px;
}
.panel-head .back { font-size: 14px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-block-end: 20px;
}
.summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-block-start: 3px solid var(--accent);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
  padding: 14px 10px;
  text-align: center;
}
.summary-item b { display: block; font-size: 26px; font-weight: 600; color: var(--accent); line-height: 1.3; }
.summary-item span { font-size: 13px; color: var(--ink-soft); }

/* تبويبات اللوحة */
.tabs {
  display: flex;
  gap: 4px;
  border-block-end: 1px solid var(--line);
  margin-block-end: 20px;
  overflow-x: auto;
}
.tab {
  min-height: 44px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  border-block-end: 3px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab[aria-selected="true"] { color: var(--accent); border-block-end-color: var(--accent); }
.tab .tab-lock { color: var(--locked); }

/* تبويبات الدكاترة */
.doctor-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-block-end: 16px;
}
.doctor-tab {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.doctor-tab[aria-pressed="true"] {
  background: var(--accent-sf);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* صفوف المواعيد */
.appt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.appt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
  transition: background 300ms ease, border-color 300ms ease;
}
.appt-row.sent { background: var(--accent-sf); border-color: #A7F3D0; }
.appt-time { font-weight: 600; font-size: 16px; white-space: nowrap; min-width: 52px; }
.appt-info { flex: 1; min-width: 0; }
.appt-name { font-weight: 600; font-size: 14px; }
.appt-meta { font-size: 13px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.visit-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 1px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.visit-pill.first { background: var(--accent-sf); border-color: #A7F3D0; color: var(--accent); }

.remind-btn {
  min-height: 44px;
  min-width: 96px;
  padding: 8px 14px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 200ms ease;
}
.remind-btn.sent {
  background: transparent;
  color: var(--accent);
  border: 1px solid #A7F3D0;
  cursor: default;
  flex-direction: column;
  gap: 0;
  line-height: 1.4;
}
.remind-btn.sent small { font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.remind-btn .check { display: none; }
.remind-btn.sent .check { display: inline-block; }
.remind-btn .check path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}
.remind-btn.just-sent .check path { animation: draw 400ms ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.remind-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-block-end: 14px;
  flex-wrap: wrap;
}

/* جدول المرضى */
.search-box { margin-block-end: 14px; position: relative; }
.search-box input { padding-inline-start: 40px; }
.search-box svg {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
}
.patients-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.patients-table th {
  text-align: start;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 8px 10px;
  border-block-end: 1px solid var(--line);
}
.patients-table td { padding: 10px; border-block-end: 1px solid var(--line); }
.patients-table tr:last-child td { border-block-end: 0; }
.patients-table td.num { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.empty-note { text-align: center; color: var(--ink-soft); padding: 24px 0; font-size: 14px; }

/* القوالب */
.tpl-grid { display: grid; gap: 20px; }
.tpl-preview {
  background: var(--accent-sf);
  border: 1px solid #A7F3D0;
  border-radius: var(--r-panel);
  padding: 14px 16px;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.8;
}
.tpl-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-block: 0 6px; }

/* التقارير */
.report-block { margin-block-end: 28px; }
.report-block h3 { font-size: 16px; margin-block-end: 4px; }
.report-block .report-sub { font-size: 13px; color: var(--ink-soft); margin-block-end: 14px; }
.noshow { display: flex; gap: 12px; }
.noshow .ns {
  flex: 1;
  border-radius: var(--r-panel);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
}
.noshow .ns b { display: block; font-size: 24px; font-weight: 600; }
.noshow .ns.before b { color: var(--locked); }
.noshow .ns.after { background: var(--accent-sf); border-color: #A7F3D0; }
.noshow .ns.after b { color: var(--accent); }
.noshow .ns span { font-size: 13px; color: var(--ink-soft); }
.hours-strip { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-block-start: 8px; }
.hours-strip .hb {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.hours-strip .hb i {
  display: block;
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  opacity: .35;
}
.hours-strip .hb.peak i { opacity: 1; }
.hours-strip .hb span { font-size: 11px; color: var(--ink-soft); }

/* مبدّل الصلاحيات */
.role-switch {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}
.role-switch button {
  min-height: 40px;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.role-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* تسجيل الدخول */
.login-card { max-width: 420px; margin: 40px auto; }
.login-hint {
  background: var(--accent-sf);
  border: 1px solid #A7F3D0;
  border-radius: var(--r-panel);
  padding: 12px 16px;
  font-size: 14px;
  margin-block-end: 20px;
}

/* بوابة القفل الكاملة */
.gate { text-align: center; padding: 48px 20px; }
.gate .gate-icon { color: var(--locked); margin-block-end: 16px; }
.gate p { color: var(--ink-soft); margin: 8px auto 24px; }

/* aria-live للإعلانات */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   الشاشات الأكبر
   ============================================================ */
@media (min-width: 720px) {
  section { padding-block: 40px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr 1fr; }
  .tpl-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ============================================================
   تقليل الحركة
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .remind-btn.just-sent .check path { animation: none; stroke-dashoffset: 0; }
}
