/* ===== خط المجمع (Almarai) مُستضاف محليًا — بلا اعتماد على شبكة خارجية ===== */
@font-face { font-family: 'Almarai'; font-style: normal; font-weight: 300; font-display: swap; src: url('/assets/fonts/Almarai-Light.woff2') format('woff2'); }
@font-face { font-family: 'Almarai'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/Almarai-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Almarai'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/Almarai-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Almarai'; font-style: normal; font-weight: 800; font-display: swap; src: url('/assets/fonts/Almarai-ExtraBold.woff2') format('woff2'); }

/* ===== نظام تصميم مجمع وادي جدة للابتكار (WJIH) =====
   الألوان والخط مستخرجة من هوية wjihub.com الرسمية */
:root {
  --navy-900: #151b3d;    /* الكحلي الغامق */
  --navy-800: #1e2650;    /* الكحلي الأساسي */
  --navy-600: #2e3a6e;
  --navy-100: #e8ebf4;
  --blue-300: #9dc6dc;    /* الأزرق الفاتح */
  --blue-500: #078bb9;
  --blue-50: #eef6fa;
  /* بديل غير أحمر: كهرماني/ذهبي للحالات التحذيرية (مشغول/إنهاء) */
  --maroon-700: #8a5a12;  /* كهرماني غامق */
  --maroon-500: #b7791f;  /* كهرماني */
  --maroon-50: #faf1e0;
  --sand-300: #d6baae;    /* الورديّ الترابي */
  --sand-100: #eae4e0;
  --taupe: #a9826c;
  --ink: #0f172a;
  --gray-600: #5a6480;
  --gray-400: #9CA3AF;
  --gray-200: #e5e4ea;
  --bg: #f4f5f8;
  --card: #ffffff;
  --radius: 24px 8px 24px 28px; /* شكل البتلة: أعلى اليمين شبه حاد */
  --shadow: 0 6px 24px rgba(30, 38, 80, 0.08);
  --font: 'Almarai', 'IBM Plex Sans Arabic', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* زخرفة جانبية خافتة (غصن بأوراق بتلة) في الفراغات يمين ويسار المحتوى — تظهر على شاشة اللابتوب العريضة فقط */
body.room-bg::before,
body.room-bg::after {
  content: "";
  position: fixed;
  top: 0; bottom: 0;
  width: 0;                       /* مخفية افتراضيًا — لا فراغ على الشاشات الصغيرة */
  background: url('/assets/side-decor.svg?v=2') no-repeat center;
  background-size: contain;
  opacity: .06;
  pointer-events: none;
  z-index: -1;
}
body.room-bg::before { left: 0; }
body.room-bg::after  { right: 0; transform: scaleX(-1); }   /* الجانب الآخر مرآة */

/* تظهر فقط عندما يوجد فراغ جانبي حقيقي بجانب المحتوى (≈ عرض لابتوب فأكثر) */
@media (min-width: 1240px) {
  body.room-bg::before,
  body.room-bg::after { width: calc((100vw - 1080px) / 2); }
}

/* ===== نافذة التأكيد (حجز/إلغاء): بسيطة ونظيفة — بطاقة تظهر بانسيابية + علامة صح تُرسم ===== */
.wj-celebrate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(13,17,36,0); opacity: 0; transition: opacity .3s ease, background .3s ease; }
.wj-celebrate.show { opacity: 1; background: rgba(13,17,36,.5); }
.wj-cele-card { background: #fff; border-radius: 22px 8px 22px 24px;
  padding: 32px 30px 24px; width: min(380px, calc(100vw - 40px)); text-align: center;
  box-shadow: 0 24px 70px rgba(13,17,36,.32);
  opacity: 0; transform: translateY(12px) scale(.96); transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.3,1.2); }
.wj-celebrate.show .wj-cele-card { opacity: 1; transform: none; }
.wj-cele-card h3 { margin: 8px 0 6px; font-size: 22px; font-weight: 800; color: var(--navy-800); }
.wj-cele-detail { color: var(--gray-600); font-size: 15px; line-height: 1.8; margin-bottom: 20px; }
.wj-cele-detail p { margin: 2px 0; }
/* علامة الصح (حجز) — حلقة ثم صح يُرسمان، مع نبضة نجاح خفيفة */
.wj-cele-icon { position: relative; width: 104px; height: 104px; margin: 0 auto 6px; }
.wj-cele-icon svg { width: 100%; height: 100%; overflow: visible; }
.wj-cele-icon .ring { fill: none; stroke: var(--c); stroke-width: 6; opacity: .28; stroke-dasharray: 283; stroke-dashoffset: 283; }
.wj-cele-icon .mark { fill: none; stroke: var(--c); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 130; stroke-dashoffset: 130; }
.wj-celebrate.show .wj-cele-icon .ring { animation: wj-draw .5s ease-out .15s forwards; }
.wj-celebrate.show .wj-cele-icon .mark { animation: wj-draw .45s ease-out .42s forwards; }
.wj-cele-icon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--c); opacity: 0; }
.wj-celebrate.show .wj-cele-icon::after { animation: wj-pulse .8s ease-out .55s; }
@keyframes wj-draw { to { stroke-dashoffset: 0; } }
@keyframes wj-pulse { 0% { transform: scale(.72); opacity: .55; } 100% { transform: scale(1.45); opacity: 0; } }
/* أيقونة مخصّصة داخل الكرت (مثل الساعة الرملية للحجز المسبق) */
.wj-cele-custom { display: flex; justify-content: center; align-items: flex-end; height: 92px; margin: 0 auto 6px; }
.wj-cele-custom .hg { width: 62px; height: auto; }
/* أيقونة الوداع (إلغاء) — يد بألوان الهوية داخل حلقة، تلوّح */
.wj-cele-wave { width: 104px; height: 104px; margin: 0 auto 6px; }
.wj-cele-wave svg { width: 100%; height: 100%; overflow: visible; }
.wj-cele-wave .ring { fill: none; stroke: var(--blue-300); stroke-width: 6; opacity: .5; stroke-dasharray: 283; stroke-dashoffset: 283; }
.wj-cele-wave .hand { fill: var(--navy-800); transform-box: fill-box; transform-origin: 50% 92%; }
.wj-celebrate.show .wj-cele-wave .ring { animation: wj-draw .5s ease-out .15s forwards; }
.wj-celebrate.show .wj-cele-wave .hand { animation: wj-wave 1s ease-in-out .35s 2; }
@keyframes wj-wave { 0%,100% { transform: rotate(0); } 25% { transform: rotate(20deg); } 50% { transform: rotate(-12deg); } 75% { transform: rotate(16deg); } }
@media (prefers-reduced-motion: reduce) {
  .wj-cele-card { opacity: 1; transform: none; transition: none; }
  .wj-cele-icon .ring, .wj-cele-icon .mark, .wj-cele-wave .ring { stroke-dashoffset: 0; animation: none; }
  .wj-cele-icon::after, .wj-cele-wave .hand { animation: none; }
}

/* ===== الجولة التعريفية ===== */
.tour-root { position: fixed; inset: 0; z-index: 9998; }
/* الإضاءة بنفس فلسفة أزرار الموقع (بتلة) + تعتيم أغمق لما حولها */
.tour-spot { position: fixed; border-radius: 16px 5px 16px 18px; border: 2px solid var(--blue-300);
  box-shadow: 0 0 0 9999px rgba(13,17,36,.82); transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease; pointer-events: none; }
.tour-pop { position: fixed; z-index: 9999; width: min(330px, calc(100vw - 28px));
  background: #fff; color: var(--navy-800); border-radius: 16px 5px 16px 18px;
  padding: 16px 18px; box-shadow: 0 20px 55px rgba(15,20,40,.32); }
.tour-pop .tour-progress { font-size: 12px; font-weight: 800; color: var(--blue-500); direction: ltr; text-align: start; }
.tour-pop h4 { margin: 6px 0 6px; font-size: 17px; font-weight: 800; }
.tour-pop p { margin: 0 0 14px; font-size: 14px; line-height: 1.8; color: var(--gray-600); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-nav { display: flex; gap: 8px; }
.tour-skip { background: none; border: none; font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--gray-500); cursor: pointer; padding: 6px 2px; text-decoration: underline; }
.tour-skip:hover { color: var(--gray-600); }
/* زر إعادة الجولة العائم */
#tour-fab { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; z-index: 9000;
  width: 46px; height: 46px; border-radius: 50% 50% 50% 12px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy-800); color: #fff;
  box-shadow: 0 8px 22px rgba(30,38,80,.35); transition: transform .15s, background .2s; }
#tour-fab svg { display: block; }
#tour-fab:hover { transform: translateY(-2px) rotate(-4deg); background: #2e3a6e; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

.container { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }
.container.wide { max-width: 1040px; }

/* ===== الترويسة: كحلي بنمط الوادي ===== */
.site-header {
  background:
    url('/assets/wadi-pattern.png') left -30px center / auto 130% no-repeat,
    linear-gradient(120deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-600) 100%);
  color: #fff;
  padding: 16px 0 18px;
  border-bottom: 4px solid var(--blue-300);
}
/* عند الإنجليزية: انقل نمط الترويسة للجهة المقابلة ليبقى النص واضحًا */
html[dir="ltr"] .site-header {
  background:
    url('/assets/wadi-pattern.png') right -30px center / auto 130% no-repeat,
    linear-gradient(120deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-600) 100%);
}
.site-header .container { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 42px; width: auto; flex-shrink: 0; display: block; }
.brand-text { min-width: 0; flex: 1; }
.brand-text h1 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: .2px; line-height: 1.25; }
.brand-text p { margin: 0; font-size: 12.5px; color: var(--blue-300); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* أزرار الناف بار: قالب أبيض صلب بنص كحلي */
.header-link {
  color: var(--navy-800); text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px 4px 12px 14px;
  padding: 7px 13px; box-shadow: 0 2px 8px rgba(21,27,61,.12); transition: transform .12s, box-shadow .2s;
}
.header-link:hover { color: var(--navy-800); box-shadow: 0 4px 14px rgba(21,27,61,.2); transform: translateY(-1px); }
.header-link.strong { font-weight: 800; font-size: 14px; }
.header-link svg { display: block; flex-shrink: 0; color: var(--navy-800); }
/* فاصل رأسي بين الشعار/العنوان والرابط */
.header-sep { width: 1px; height: 30px; background: rgba(157,198,220,.3); flex-shrink: 0; }
.lang-btn {
  font-family: inherit; font-weight: 800;
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; color: var(--navy-800);
  border: 1px solid var(--gray-200); border-radius: 12px 4px 12px 14px;
  padding: 7px 12px; cursor: pointer; transition: transform .12s, box-shadow .2s; line-height: 1; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(21,27,61,.12);
}
.lang-btn:hover { box-shadow: 0 4px 14px rgba(21,27,61,.2); transform: translateY(-1px); }
.lang-btn .lang-code { font-size: 13px; }
.lang-btn svg { display: block; color: var(--navy-800); }

/* ===== الترويسة على الجوال ===== */
@media (max-width: 600px) {
  .site-header { padding: 12px 0; }
  .site-header .container { gap: 10px; }
  .brand-logo { height: 32px; }
  .brand-text h1 { font-size: 13.5px; line-height: 1.2; }
  .brand-text p { font-size: 10.5px; }
  .header-actions { gap: 8px; }
  .header-sep { display: none; }
  /* الرابط يصير أيقونة فقط لتوفير المساحة (يبقى أبيض صلب) */
  .header-link .label { display: none; }
  .header-link { padding: 8px 10px; }
  .lang-btn { padding: 8px 10px; }
}

main { flex: 1; padding: 24px 0 48px; }

.site-footer {
  border-top: 1px solid var(--gray-200);
  padding: 18px 0;
  color: var(--gray-400);
  font-size: 12.5px;
  text-align: center;
  background: #fff;
}

/* ===== البطاقات: بشطفة أعلى اليمين (هوية WJIH) ===== */
.card {
  background: var(--card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  position: relative;
}
.card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: var(--navy-800); }
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: var(--navy-800); }
.muted { color: var(--gray-600); font-size: 13.5px; }
.tiny { font-size: 12px; color: var(--gray-400); }

/* ===== صور القاعات ===== */
.hall-img {
  margin: -22px -22px 16px;
  position: relative; z-index: 1;
  border-radius: 24px 8px 0 0;
  overflow: hidden;
  height: 170px;
  background:
    url('/assets/wadi-pattern.png') center / 60% no-repeat,
    linear-gradient(120deg, var(--navy-800), var(--navy-600));
}
.hall-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== شارات الحالة ===== */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 18px 6px 18px 18px;
  font-weight: 700; font-size: 15px;
}
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.status-pill.free { background: var(--blue-50); color: var(--blue-500); }
.status-pill.free .dot { background: var(--blue-500); animation: pulse 2s infinite; }
/* «مشغولة» بالعنابي لوضوح أعلى */
.status-pill.busy { background: #f6e7ea; color: #8c1d2a; }
.status-pill.busy .dot { background: #8c1d2a; }
.status-pill.soon { background: var(--sand-100); color: var(--taupe); }
.status-pill.soon .dot { background: var(--taupe); }
@keyframes pulse { 50% { opacity: .35; } }

/* ===== العد التنازلي الدائري ===== */
.countdown-wrap { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.ring { position: relative; width: 128px; height: 128px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--navy-100); stroke-width: 9; }
.ring .bar { fill: none; stroke: var(--blue-500); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .5s; }
.ring.warn .bar { stroke: var(--taupe); }
.ring.late .bar { stroke: var(--maroon-500); }
.ring .ring-center {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.ring .time { font-size: 24px; font-weight: 800; color: var(--navy-800); direction: ltr; }
.ring .lbl { font-size: 11px; color: var(--gray-400); margin-top: -6px; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15.5px; font-weight: 700;
  border: 0; border-radius: 14px 5px 14px 16px; padding: 13px 22px;
  cursor: pointer; transition: transform .06s, box-shadow .2s, background .2s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-600); }
.btn-sand { background: var(--blue-500); color: #fff; }
.btn-sand:hover:not(:disabled) { background: #056a8e; }
.btn-outline { background: #fff; color: var(--navy-800); border: 1.5px solid var(--navy-800); }
.btn-danger { background: var(--maroon-50); color: var(--maroon-700); border: 1.5px solid #e6d2a8; }
.btn-block { width: 100%; }
.btn-lg { font-size: 17px; padding: 16px 24px; }
.btn-sm { font-size: 13px; padding: 8px 14px; border-radius: 10px 4px 10px 12px; }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions-row .btn { flex: 1; min-width: 130px; }

.mini-label {
  display: block; margin-top: 14px; font-size: 12px; font-weight: 700;
  color: var(--gray-600); letter-spacing: .3px;
}

/* ===== رقائق الاختيار (المدة / الأيام) ===== */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.chip {
  font-family: inherit; font-size: 14px; font-weight: 700;
  border: 1.5px solid var(--gray-200); background: #fff; color: var(--ink);
  border-radius: 22px 7px 22px 22px; padding: 9px 18px; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.chip:hover:not(:disabled) { border-color: var(--blue-300); }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip .sub { display: block; font-size: 11px; font-weight: 400; color: inherit; opacity: .75; }

/* ملخص الوقت المختار (واضح على الجوال) */
/* ملخص الوقت المختار — خفيف ومريح (أزرق فاتح ونص كحلي) */
.sel-summary {
  margin-top: 12px; background: var(--blue-50); color: var(--navy-800); font-weight: 700;
  border: 1px solid var(--blue-300); border-radius: 12px 4px 12px 14px;
  padding: 10px 14px; font-size: 14px; text-align: center;
}
/* الوقت: الرقم يسار و«م/ص» يمين دائمًا (حاويتان flex) */
.wj-time { display: inline-flex; direction: ltr; gap: 3px; align-items: baseline; font-variant-numeric: tabular-nums; }
.sel-summary .wj-time { font-weight: 800; font-size: 16px; color: var(--blue-500); }
.sel-summary .ss-until { color: var(--gray-600); font-weight: 700; }
.sel-summary .ss-until .wj-time { color: var(--navy-800); }
/* زر التأكيد — أصغر ومتوسّط، بلون المجمع الكحلي (مختلف عن الملخص) */
.confirm-wrap { text-align: center; margin-top: 16px; }
.confirm-wrap .btn { min-width: 210px; padding: 12px 30px; }

/* لمس الجوال: بلا وميض رمادي، ونقر فوري */
.slot, .chip, .btn, .lang-btn, .header-link { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ===== شبكة الخانات الزمنية ===== */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 12px; }
.slot {
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 13px 4px; border-radius: 10px 4px 10px 12px; text-align: center;
  border: 1.5px solid var(--gray-200); background: #fff; color: var(--navy-800);
  cursor: pointer; direction: ltr; font-variant-numeric: tabular-nums;
  transition: transform .1s, background .12s, border-color .12s; user-select: none;
}
.slot:active:not(:disabled) { transform: scale(.94); }
.slot:hover:not(:disabled) { border-color: var(--blue-500); background: var(--blue-50); }
.slot.taken { background: var(--sand-100); color: var(--gray-400); border-color: transparent; cursor: not-allowed; text-decoration: line-through; }
.slot.past { opacity: .35; cursor: not-allowed; }
/* وقت لدى الجهة فيه حجز بقاعة أخرى */
.slot.mine-busy { background: var(--sand-100); color: var(--taupe); border: 1.5px dashed var(--sand-300); text-decoration: none; }
.slot.inrange { background: var(--blue-500); color: #fff !important; border-color: var(--blue-500); text-decoration: none; }
/* الخانة المختارة: تعبئة كحلية واضحة جدًا + علامة صح */
.slot.selected {
  background: var(--navy-800); color: #fff !important; border-color: var(--navy-800);
  font-weight: 800; text-decoration: none; transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(30,38,80,.35); position: relative; z-index: 1;
}
.slot.selected::after { content: '✓'; position: absolute; top: 2px; inset-inline-start: 5px; font-size: 11px; }
/* عند تمرير الماوس على الخانة المختارة: أزرق فاتح واضح مع نص مقروء */
.slot.selected:hover:not(:disabled) {
  background: var(--blue-50); border-color: var(--blue-500);
  color: var(--navy-800) !important; box-shadow: 0 4px 14px rgba(7,139,185,.22);
}
.slot:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
/* مسافة أوضح فوق زر الحجز اليومي */
#daily-btn { margin-top: 20px; }
.slot-grid.readonly .slot { cursor: default; }
.slot-grid.readonly .slot:not(.taken):not(.past) { border-color: var(--blue-300); color: var(--blue-500); }

/* ===== الخط الزمني لليوم ===== */
.timeline { margin-top: 14px; }
.timeline-bar {
  position: relative; height: 34px; border-radius: 10px;
  background: var(--blue-50); overflow: hidden; direction: ltr;
}
.timeline-seg {
  position: absolute; top: 0; bottom: 0;
  background: var(--sand-300); opacity: .95;
  border-inline: 1px solid #fff;
}
.timeline-seg.mine { background: var(--navy-600); }
.timeline-seg.done { opacity: .4; }
.past-item { opacity: .55; }
.timeline-now { position: absolute; top: -3px; bottom: -3px; width: 2.5px; background: var(--maroon-500); }
.timeline-labels { display: flex; justify-content: space-between; direction: ltr; font-size: 11px; color: var(--gray-400); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ===== النماذج ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--navy-800); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font-family: inherit; font-size: 15px;
  border: 1.5px solid var(--gray-200); border-radius: 12px 5px 12px 14px;
  padding: 12px 14px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(7,139,185,.13); }

/* ===== النوافذ المنبثقة ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(21,27,61,.55);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 24px 8px 24px 28px; padding: 26px 22px;
  width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(21,27,61,.35);
  animation: slideUp .25s ease;
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
.modal h3 { margin: 0 0 8px; font-size: 19px; font-weight: 800; color: var(--navy-800); }

/* ===== رمز PIN ===== */
.pin-display {
  display: flex; gap: 10px; justify-content: center; margin: 18px 0; direction: ltr;
}
.pin-display span {
  width: 52px; height: 62px; display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: var(--navy-800);
  background: var(--blue-50); border: 2px dashed var(--blue-300); border-radius: 14px 5px 14px 16px;
}
.pin-input { direction: ltr; text-align: center; letter-spacing: 12px; font-size: 24px !important; font-weight: 800; }

/* ===== التنبيهات: هادئة بخط جانبي ===== */
.alert {
  border-radius: 12px 5px 12px 14px; padding: 10px 14px; font-size: 13.5px; margin: 12px 0;
  line-height: 1.7; border-inline-start: 3px solid transparent;
}
.alert.error { background: var(--maroon-50); color: var(--maroon-500); border-color: var(--maroon-500); }
.alert.ok { background: var(--blue-50); color: #0b6e91; border-color: var(--blue-500); }
.alert.info { background: var(--sand-100); color: #6d5546; border-color: var(--sand-300); }

/* ===== بطاقات الرئيسية ===== */
.halls-grid { display: grid; gap: 16px; }
@media (min-width: 620px) { .halls-grid { grid-template-columns: 1fr 1fr; } }
.hall-card { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .2s; overflow: hidden; }
.hall-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(30,38,80,.16); }
.hall-card .top { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 8px; }
.hall-card .cap { font-size: 12.5px; color: var(--gray-400); }
.hall-card .go { margin-top: 14px; color: var(--maroon-500); font-weight: 700; font-size: 14px; }

.hero {
  background: linear-gradient(120deg, var(--navy-900), var(--navy-800) 60%, var(--navy-600));
  border-radius: var(--radius); color: #fff; padding: 30px 24px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
/* نمط الوادي كطبقة مستقلة قابلة للقلب حسب اتجاه اللغة */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('/assets/wadi-pattern.png') left -20px bottom -18px / auto 115% no-repeat;
  transition: transform .5s ease;
}
/* عند الإنجليزية (LTR): قلب حول المحور العمودي فينزاح النمط للجهة المقابلة ويظهر النص */
html[dir="ltr"] .hero::before { transform: scaleX(-1); }
.hero::after {
  content: ''; position: absolute; inset-inline-start: -50px; top: -70px; z-index: 0;
  width: 240px; height: 240px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(157,198,220,.28), transparent 70%);
}
.hero h2, .hero p { position: relative; z-index: 1; }
.hero h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }

/* ===== بطاقة الإحصائيات + الرسم البياني ===== */
.stats-card { background: linear-gradient(160deg, #fff 60%, var(--blue-50)); }
.stats-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.stats-head h3 { margin: 0; }
.stats-kpis { display: flex; gap: 18px; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.kpi-num { font-size: 26px; font-weight: 800; color: var(--navy-800); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-lbl { font-size: 11.5px; color: var(--gray-600); margin-top: 2px; }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-val { font-size: 11px; font-weight: 700; color: var(--gray-600); font-variant-numeric: tabular-nums; height: 14px; }
.bar-track { flex: 1; width: 100%; max-width: 40px; display: flex; align-items: flex-end; background: rgba(30,38,80,.04); border-radius: 8px 3px 8px 8px; }
.bar-fill {
  width: 100%; min-height: 3px;
  background: linear-gradient(to top, var(--navy-800), var(--blue-500));
  border-radius: 8px 3px 0 0; transition: height .6s cubic-bezier(.2,.8,.2,1);
}
.bar-fill.today { background: linear-gradient(to top, var(--maroon-700), var(--maroon-500)); }
.bar-lbl { font-size: 11px; color: var(--gray-400); }
.hero p { margin: 0; color: var(--blue-300); font-size: 14px; }

/* ===== جداول الإدارة ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; color: var(--navy-800); font-size: 12.5px; border-bottom: 2px solid var(--gray-200); padding: 8px 10px; white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.confirmed { background: var(--blue-50); color: var(--blue-500); }
.badge.completed { background: #eef2f7; color: var(--gray-600); }
.badge.cancelled { background: var(--maroon-50); color: var(--maroon-500); }
.badge.no_show { background: var(--sand-100); color: var(--taupe); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px 6px 16px 18px; padding: 14px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--navy-800); }
.stat .lbl { font-size: 12px; color: var(--gray-600); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translate(50%, 20px);
  background: var(--navy-800); color: #fff; font-size: 14px; font-weight: 700;
  padding: 12px 22px; border-radius: 18px 6px 18px 18px; box-shadow: 0 10px 30px rgba(21,27,61,.35);
  opacity: 0; transition: all .35s ease; z-index: 80; max-width: 90vw; text-align: center;
}
html[dir="ltr"] .toast { transform: translate(-50%, 20px); }
.toast.show { opacity: 1; transform: translate(50%, 0); }
html[dir="ltr"] .toast.show { transform: translate(-50%, 0); }
.toast.toast-error { background: var(--maroon-700); }

/* ===== العداد الكبير لحجز الجهاز ===== */
.ring.big { width: 192px; height: 192px; }
.ring.big .time { font-size: 38px; }
.ring.big .lbl { font-size: 13px; }
.mine-timer { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 8px 0 4px; }
.mine-name { margin: 14px 0 0; font-size: 18px; }

/* ===== محفظة الحساب ===== */
.wallet { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; border-radius: 16px 5px 16px 18px; padding: 16px 18px; margin: 12px 0 4px; }
.wallet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wallet-logo { width: 66px; height: 66px; border-radius: 18px 5px 18px 20px; object-fit: contain; background: #fff; padding: 7px; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.wallet-name { font-weight: 800; font-size: 16px; }
.wallet-head .btn-outline { background: transparent; color: var(--blue-300); border-color: rgba(157,198,220,.5); }
.wallet-bal { margin-top: 12px; font-size: 15px; }
.wallet-bal b { font-size: 22px; color: #fff; }
.wallet-bal .muted { color: var(--blue-300); }
.wallet-bar { height: 8px; background: rgba(255,255,255,.15); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.wallet-fill { height: 100%; background: var(--blue-300); border-radius: 999px; transition: width .5s; }
.wallet .tiny { color: var(--blue-300); }
.mine-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.mine-row:last-child { border-bottom: 0; }

/* وصف القسم في لوحة الإدارة */
.section-desc { color: var(--gray-600); font-size: 12.5px; margin: 2px 0 12px; line-height: 1.7; }
/* نقطة حمراء وامضة للطلبات المعلّقة */
.req-dot {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  background: #e0322b; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800;
  vertical-align: middle; margin-inline-start: 6px; box-shadow: 0 0 0 0 rgba(224,50,43,.6);
  animation: req-blink 1.4s ease-in-out infinite;
}
@keyframes req-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,50,43,.55); opacity: 1; }
  50% { box-shadow: 0 0 0 7px rgba(224,50,43,0); opacity: .75; }
}

/* طي/توسيع أقسام لوحة الإدارة */
.card-header { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.card-header h3 { margin: 0; }
.card-header .collapse-arrow { margin-inline-start: auto; color: var(--gray-400); font-size: 16px; transition: transform .2s; flex-shrink: 0; }
.card.collapsed .collapse-arrow { transform: rotate(-90deg); }
.card.collapsed > *:not(.card-header) { display: none; }

/* جداول الإدارة: كل خلية تحت عمودها (لا تداخل) */
.table-wrap table { min-width: 760px; table-layout: fixed; }
.table-wrap th, .table-wrap td { vertical-align: top; overflow-wrap: anywhere; white-space: normal; }

/* شبكة الحسابات في عمودين */
.accounts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .accounts-grid { grid-template-columns: 1fr; } }
/* حاوية الشعار بشكل الشطفة (البتلة) مثل الأزرار، وبحجم أكبر */
.acc-logo { width: 58px; height: 58px; border-radius: 16px 5px 16px 18px; object-fit: contain; padding: 6px;
  flex-shrink: 0; border: 1px solid var(--gray-200); background: #fff; box-shadow: 0 2px 8px rgba(21,27,61,.08); }
/* شعارات SVG على خلفية كحلية لتظهر بوضوح */
.acc-logo.svg-bg, .wallet-logo.svg-bg { background: var(--navy-800); object-fit: contain; }

/* أدوات فرز/تصنيف السجل — قائمة منسدلة مخصّصة بتصميم الموقع */
.log-controls { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 14px; }
.dd-field { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gray-600); font-weight: 700; }
.dropdown { position: relative; }
.dd-btn {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--navy-800);
  border: 1.5px solid var(--gray-200); border-radius: 12px 4px 12px 14px; padding: 8px 14px; background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-width: 150px; justify-content: space-between;
  -webkit-tap-highlight-color: transparent; transition: border-color .15s, box-shadow .2s;
}
.dd-btn:hover { border-color: var(--blue-300); }
.dd-arrow { color: var(--gray-400); font-size: 12px; }
.dd-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 40; min-width: 100%;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px 4px 12px 14px;
  box-shadow: 0 10px 30px rgba(21,27,61,.16); padding: 6px; overflow: hidden;
}
.dd-opt {
  font-size: 13px; font-weight: 600; color: var(--navy-800); padding: 9px 12px; border-radius: 8px 3px 8px 10px;
  cursor: pointer; white-space: nowrap; transition: background .12s;
}
.dd-opt:hover { background: var(--blue-50); }
.dd-opt.sel { background: var(--navy-800); color: #fff; }

/* بطاقات حسابات الإدارة */
.acc-card { border: 1px solid var(--gray-200); border-radius: 14px 4px 14px 16px; padding: 14px; margin-bottom: 0; }
/* تمييز الأقسام الداخلية بلون أزرق فاتح */
.acc-card.dept { background: var(--blue-50); border-color: var(--blue-300); }
.acc-card.suspended { opacity: .6; background: var(--sand-100); }
.acc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acc-bal { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; font-variant-numeric: tabular-nums; }
.acc-bal .wallet-bar { height: 8px; }
/* خانة الساعات المتبقية — واضحة بلا فتح الإعدادات */
.rem-box { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  background: var(--blue-50); border: 1px solid var(--blue-300);
  border-radius: 10px 3px 10px 12px; padding: 7px 12px; }
.rem-box .rem-label { font-size: 11.5px; font-weight: 700; color: var(--gray-600); }
.rem-box .rem-val { font-size: 17px; font-weight: 800; color: var(--navy-800); }
.rem-box .rem-of { font-size: 12px; color: var(--gray-500); }
.rem-box.unlimited .rem-val { color: var(--blue-500); }
.rem-box.low { background: #f6e7ea; border-color: #d9a2ac; }
.rem-box.low .rem-val { color: #8c1d2a; }
/* عدّاد السجل التنازلي */
.log-timer { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; background: var(--blue-50); color: var(--blue-500);
  direction: ltr; font-variant-numeric: tabular-nums; }
.log-timer.soon { background: #fdf0d5; color: #8a5a00; }
.log-timer.ended { background: #eef2f7; color: var(--gray-500); }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.switch { font-size: 12px; cursor: pointer; }

/* إشعار كبير: لديك حجز جارٍ */
.big-notice { text-align: center; padding: 22px 16px 8px; }
.big-notice .bn-icon { line-height: 1; display: flex; justify-content: center; }
/* ساعة رملية متحركة بألوان المجمع */
.hg { transform-origin: 50% 50%; animation: hg-flip 4s ease-in-out infinite; }
@keyframes hg-flip { 0%,18% { transform: rotate(0); } 40%,58% { transform: rotate(180deg); } 80%,100% { transform: rotate(360deg); } }
.hg-top { animation: hg-top 4s ease-in-out infinite; transform-origin: 24px 20px; }
@keyframes hg-top { 0% { opacity: 1; transform: scaleY(1); } 15% { opacity: 1; transform: scaleY(1); } 38% { opacity: .35; transform: scaleY(.35); } 100% { opacity: 1; transform: scaleY(1); } }
.hg-bot { animation: hg-bot 4s ease-in-out infinite; transform-origin: 24px 53px; }
@keyframes hg-bot { 0% { transform: scaleY(.2); } 15% { transform: scaleY(.3); } 38% { transform: scaleY(1); } 100% { transform: scaleY(1); } }
.hg-drop { animation: hg-drop 1s linear infinite; }
@keyframes hg-drop { 0% { transform: translateY(-2px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
.big-notice .bn-title { font-size: 22px; font-weight: 800; color: var(--navy-800); margin-top: 10px; }
.big-notice .bn-hall { font-size: 16px; color: var(--navy-600); margin-top: 8px; }
.big-notice .bn-sub { color: var(--gray-600); font-size: 14px; line-height: 1.9; margin: 12px auto 20px; max-width: 340px; }

/* إبراز الحقل الناقص عند التنبيه */
.field-invalid { outline: 2px solid var(--maroon-500); outline-offset: 3px; border-radius: 12px; animation: fi-pulse .5s ease 2; }
.field-invalid input { border-color: var(--maroon-500) !important; }
@keyframes fi-pulse { 50% { outline-color: transparent; } }

.hidden { display: none !important; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
