@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-main: #eef5f9;
  --bg-card: #ffffff;
  --bg-dark: #071b2e;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: #ccfbf1;
  --med-blue: #0284c7;
  --med-blue-soft: #e0f2fe;
  --accent: #0284c7;
  --instapay: #5b21b6;
  --instapay-soft: #f3e8ff;
  --fawry: #d97706;
  --fawry-soft: #fef3c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #0f172a;
  --text-muted: #52657a;
  --border: #d8e4ef;
  --shadow-sm: 0 2px 10px rgba(7, 27, 46, 0.05);
  --shadow-md: 0 8px 24px rgba(7, 27, 46, 0.09);
  --shadow-lg: 0 18px 44px rgba(7, 27, 46, 0.16);
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  /* نقش طبي هادئ بعلامات الصليب الطبي الموجب في الخلفية */
  background-image:
    radial-gradient(circle at 15% 15%, rgba(13, 148, 136, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(2, 132, 199, 0.06) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='52' height='52' viewBox='0 0 52 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 19h4v5h5v4h-5v5h-4v-5h-5v-4h5v-5z' fill='%230d9488' fill-opacity='0.035'/%3E%3C/svg%3E");
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* تقليل الهوامش الجانبية لاستغلال عرض الشاشة بالكامل على الكمبيوتر والموبايل */
.container {
  max-width: 1480px;
  width: 98%;
  margin: 0 auto;
  padding: 0 10px;
}

/* شريط التنقل العلوي المدمج */
.navbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #d0e6f0;
  position: sticky;
  top: 0;
  z-index: 120;
  box-shadow: 0 2px 12px rgba(7, 27, 46, 0.05);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d9488, #0284c7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28);
  flex-shrink: 0;
}

.brand-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--bg-dark);
  line-height: 1.15;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--primary-dark);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.34);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
}

.btn-instapay {
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.26);
}

.btn-fawry {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #f0fdfa;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 12px;
}

/* الواجهة الطبية العلوية مع رسومات رسم القلب والطبيب */
.hero {
  background: linear-gradient(130deg, #061a2e 0%, #0b3547 52%, #0d6e6e 100%);
  color: #fff;
  padding: 20px 0 32px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid #14b8a6;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%235eead4' stroke-opacity='0.07' stroke-width='1.5'%3E%3Ccircle cx='60' cy='60' r='42'/%3E%3Cpath d='M52 60h16M60 52v16'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(110, 231, 183, 0.45);
  color: #a7f3d0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
  animation: pulse 1.8s infinite;
  display: inline-block;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.75); }
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero h1 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero p {
  color: #dbeafe;
  font-size: 14.5px;
  margin-bottom: 14px;
  max-width: 680px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.hero-pill {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

/* خط نبض القلب التفاعلي المتحرك ECG */
.ecg-line-svg {
  width: 100%;
  height: 36px;
  margin-top: 6px;
  opacity: 0.88;
}

.ecg-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: ecgDraw 3.6s linear infinite;
}

@keyframes ecgDraw {
  0% { stroke-dashoffset: 600; opacity: 0.3; }
  45% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -600; opacity: 0.3; }
}

.hero-illustration-box {
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(153, 246, 228, 0.28);
  border-radius: 18px;
  padding: 14px 16px;
  position: relative;
}

.stats-strip-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.stat-mini {
  background: rgba(7, 27, 46, 0.52);
  border-radius: 11px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-mini .num {
  font-size: 19px;
  font-weight: 900;
  color: #5eead4;
  line-height: 1.2;
}

.stat-mini .lbl {
  font-size: 11px;
  color: #e2e8f0;
  font-weight: 600;
}

/* شريط خطوات الكشف الطبي السريع */
.med-steps-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.med-step-item {
  background: #fff;
  border: 1px solid var(--border);
  border-right: 4px solid var(--primary);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.med-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f0fdfa;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* محرك البحث المزدوج (بالاسم + التخصص + الفلاتر) */
.search-hub {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-md);
  margin-top: -18px;
  position: relative;
  z-index: 25;
  border: 1.5px solid #b6e0fe;
}

.search-main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.15fr 0.8fr 0.75fr auto;
  gap: 9px;
  align-items: center;
}

.search-input-wrap {
  position: relative;
}

.search-input-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-dark);
  pointer-events: none;
  font-size: 15px;
}

.search-input-wrap .form-control {
  padding-right: 34px;
  padding-left: 30px;
}

.clear-input-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: #334155;
}

/* القائمة الفورية للاقتراحات السريعة عند البحث باسم الطبيب أو التخصص */
.autocomplete-box {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 290px;
  overflow-y: auto;
  z-index: 90;
  display: none;
}

.autocomplete-item {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.autocomplete-item:hover {
  background: #f0fdfa;
}

/* قسم شبكة التخصصات الطبية الـ 28 */
.specs-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.spec-scroller {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 2px 4px;
  scrollbar-width: thin;
}

.spec-scroller.expanded-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  overflow-x: visible;
  gap: 8px;
}

.spec-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s;
}

.spec-chip:hover, .spec-chip.active {
  background: linear-gradient(135deg, #f0fdfa, #e0f2fe);
  border-color: var(--primary);
  color: #0f766e;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
}

.spec-count-pill {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

/* البطاقات العامة */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--bg-dark);
}

/* شبكة بطاقات الأطباء عالية الكثافة والرسومات الطبية */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin: 12px 0 32px;
}

.doc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}

.doc-card.offline-card {
  border-top-color: var(--med-blue);
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #5eead4;
}

.doc-watermark-svg {
  position: absolute;
  left: -12px;
  top: 24px;
  width: 85px;
  height: 85px;
  opacity: 0.045;
  pointer-events: none;
}

.doc-top {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.doc-avatar {
  width: 66px;
  height: 66px;
  border-radius: 17px;
  background: linear-gradient(145deg, #e0f2fe, #ccfbf1);
  border: 2px solid #5eead4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.14);
}

.doc-avatar .doc-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  display: block;
}

.doc-rating-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #334155;
  font-weight: 800;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
}

.doc-reviews-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11.5px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.doc-reviews-trigger:hover {
  background: #fef08a;
  transform: translateY(-1px);
}

.doc-comment-snippet {
  margin-top: 7px;
  background: linear-gradient(135deg, #fffbeb, #f8fafc);
  border: 1px solid #fde68a;
  border-right: 3px solid #f59e0b;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11.5px;
  color: #334155;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.doc-comment-snippet:hover {
  border-color: #f59e0b;
  background: #fefce8;
}

.subspec-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.subspec-chip {
  background: #f0f9ff;
  color: #0369a1;
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  padding: 5px 11px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.subspec-chip:hover {
  background: #e0f2fe;
  transform: translateY(-1px);
}

.quick-slots-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 5px 0 3px;
  margin-top: 4px;
}

.quick-slot-btn {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.quick-slot-btn:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.adv-filters-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #d8e4ef;
}

@media (max-width: 780px) {
  .adv-filters-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.verified-tick {
  position: absolute;
  bottom: -4px;
  left: -4px;
  background: #0284c7;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.badge-online {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-scheduled {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
}

.badge-instapay {
  background: var(--instapay-soft);
  color: var(--instapay);
}

/* محدد المدد الزمنية المدمج */
.duration-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.dur-pill {
  border: 1.5px solid var(--border);
  background: #f8fafc;
  border-radius: 9px;
  padding: 5px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.dur-pill.active {
  background: #f0fdfa;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.12);
}

.dur-pill .mins {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--bg-dark);
  display: block;
}

.dur-pill .prc {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-dark);
}

/* حقول الإدخال */
.form-group {
  margin-bottom: 11px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #1e293b;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }

/* النوافذ المنبثقة المتجاوبة */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 27, 46, 0.68);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  z-index: 500;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: #fff;
  width: 100%;
  max-width: 690px;
  max-height: 94vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.pay-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.pay-tab {
  padding: 9px 6px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 12.5px;
}

.pay-tab.active-instapay { border-color: var(--instapay); background: var(--instapay-soft); color: var(--instapay); }
.pay-tab.active-card { border-color: var(--accent); background: #e0f2fe; color: #0369a1; }
.pay-tab.active-fawry { border-color: var(--fawry); background: var(--fawry-soft); color: #b45309; }
.pay-tab.active-wallet { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }

.instapay-box {
  background: linear-gradient(145deg, #faf5ff, #f3e8ff);
  border: 1.5px solid #d8b4fe;
  border-radius: 14px;
  padding: 14px;
}

.qr-frame {
  background: #fff;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid #c084fc;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 6px 18px rgba(91, 33, 182, 0.12);
}

/* الجداول */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--border); text-align: right; font-size: 13px; }
th { background: #f8fafc; font-weight: 800; color: #334155; }

/* الإشعارات */
.toast-container {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.toast {
  pointer-events: auto;
  background: #071b2e;
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 13.5px;
  border-right: 4px solid #14b8a6;
  max-width: 380px;
}

/* بطاقات التخصصات الطبية الموحدة الأنيقة بدون أي تكرار (صورة واحدة معبرة ونظيفة لكل تخصص) */
.unified-specs-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.unified-spec-card {
  background: #ffffff;
  border: 1.5px solid #e2ecf5;
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(7, 27, 46, 0.03);
}

.unified-spec-card:hover {
  transform: translateY(-2px);
  border-color: #14b8a6;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.12);
}

.unified-spec-card.active {
  background: linear-gradient(145deg, #f0fdfa, #e0f2fe);
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.16);
}

.unified-spec-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #d8e4ef;
  box-shadow: 0 3px 10px rgba(7, 27, 46, 0.08);
  flex-shrink: 0;
}

.unified-spec-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--bg-dark);
  line-height: 1.3;
}

.hero-clinic-photo {
  width: 100%;
  height: 162px;
  object-fit: cover;
  border-radius: 13px;
  border: 1.5px solid rgba(94, 234, 212, 0.45);
  display: block;
  margin-bottom: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

/* ضبط التجاوب الدقيق للشاشات المتوسطة والموبايل */
@media (max-width: 1040px) {
  .unified-specs-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .search-main-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 680px) {
  .container {
    width: 100%;
    padding: 0 8px;
  }
  .nav-inner {
    padding: 6px 0;
    gap: 6px;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  .brand-title {
    font-size: 16.5px;
  }
  .brand-sub {
    font-size: 10.5px;
  }
  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }
  .nav-links .btn {
    flex: 1;
    padding: 6px 6px;
    font-size: 11.5px;
  }
  .hero {
    padding: 14px 0 24px;
  }
  .hero h1 {
    font-size: 20px;
  }
  .hero p {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .stats-strip-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .med-steps-bar {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .unified-specs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
  .unified-spec-img {
    width: 48px;
    height: 48px;
  }
  .search-hub {
    padding: 10px;
    margin-top: -14px;
  }
  .search-main-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .spec-scroller.expanded-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .doctors-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .duration-selector {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .dur-pill .mins, .dur-pill .prc {
    font-size: 10.5px;
  }
  .grid-2, .grid-3, .grid-4, .pay-tabs {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 4px;
    align-items: flex-end;
  }
  .modal-box {
    padding: 14px;
    border-radius: 16px 16px 10px 10px;
    max-height: 95vh;
  }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #0f172a !important; }
  .modal-backdrop { position: static !important; background: #fff !important; padding: 0 !important; overflow: visible !important; }
  .modal-backdrop:not(.open) { display: none !important; }
  .modal-box { box-shadow: none !important; max-height: none !important; max-width: 100% !important; padding: 0 !important; overflow: visible !important; }
}

/* ==================== منظومة مؤشرات التحميل الذكية والتقدم المرئي ==================== */
.hkm-top-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  z-index: 10000;
  background: rgba(13, 148, 136, 0.16);
  overflow: hidden;
  display: none;
}

.hkm-top-progress.active {
  display: block;
}

.hkm-top-progress::after {
  content: '';
  display: block;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #0284c7, #10b981);
  border-radius: 999px;
  animation: hkmSlideBar 1.05s infinite ease-in-out;
}

@keyframes hkmSlideBar {
  0% { transform: translateX(110%); }
  100% { transform: translateX(-280%); }
}

.hkm-loading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 26, 46, 0.46);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hkm-loading-backdrop.open {
  display: flex;
}

.hkm-loading-card {
  background: #ffffff;
  border: 2px solid #99f6e4;
  border-radius: 20px;
  padding: 22px 26px;
  max-width: 390px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 45px rgba(6, 26, 46, 0.28);
  animation: hkmPopIn 0.18s ease-out;
}

@keyframes hkmPopIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hkm-pulse-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid #ccfbf1;
  border-top-color: #0d9488;
  border-right-color: #0284c7;
  animation: hkmSpin 0.75s linear infinite;
}

@keyframes hkmSpin {
  to { transform: rotate(360deg); }
}

.hkm-btn-spin {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.4px solid rgba(255, 255, 255, 0.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: hkmSpin 0.7s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
}

.btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
  cursor: wait;
}

/* تنسيق طباعة الروشتة الإلكترونية من بوابة المريض */
@media print {
  body:has(#rxPrintModal.open) > *:not(#rxPrintModal) {
    display: none !important;
  }
  #rxPrintModal.open {
    position: static !important;
    display: block !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  #rxPrintModal.open .modal-box {
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
}

/* زر إظهار وإخفاء كلمة المرور داخل جميع حقول الباسورد بالمنصة */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none !important;
}

.hkm-pw-wrap {
  position: relative;
  width: 100%;
  display: block;
}

.hkm-pw-wrap > input.form-control {
  padding-left: 42px !important;
}

.hkm-pw-toggle {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 31px;
  height: 31px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  transition: color 0.15s ease, background 0.15s ease;
}

.hkm-pw-toggle:hover,
.hkm-pw-toggle.is-visible {
  color: #0d9488;
  background: rgba(13, 148, 136, 0.1);
}
