/* ═══ التصميم الجديد (تجريبي) — يُحمَّل فوق app.css لمن فعّله ═══
   كل شيء هنا إضافي: لا يُحذف صنف قائم ولا يتغير أي مسار عمل. */

:root {
  --copper: #b08d57;
  --copper-soft: #f7f1e8;
  --primary-dark: #0e161f;
  --st-ready: #1e8449; --st-dirty: #b7950b; --st-cleaning: #2471a3;
  --st-inspect: #8e44ad; --st-oos: #b03a2e; --st-dueout: #c2661a;
  --tap: 44px;
  --topbar-h: 64px;   /* ارتفاع الشريط الثابت — يعتمد عليه العمود الجانبي */
}

/* ═══ وضوح حقول الإدخال — يسري على كل صفحات النظام ═══
   المشكلة: حدّ الحقل #dde3e8 يعطي تبايناً 1.29:1 والمعيار (WCAG 1.4.11) يوجب 3:1،
   فالمربع شبه غير مرئي. والنص الثانوي كان 3.43:1 والمطلوب 4.5:1. */
:root {
  --field-border: #8592a1;   /* تباين 3.17:1 على أبيض ✅ */
  --muted: #66727f;          /* تباين 4.91:1 على أبيض ✅ */
}
input, select, textarea {
  border: 1px solid var(--field-border);
  background: #fff;
}
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: #6b7a8b; }
input:focus, select:focus, textarea:focus {
  border-color: var(--copper); outline: none;
  box-shadow: 0 0 0 3px rgba(176, 141, 87, .22);
}
input:disabled, select:disabled { background: #f2f4f6; color: var(--muted); }
input::placeholder { color: #8a95a2; }   /* واضح لكنه لا يُخلط بالنص المكتوب */

/* حدود دنيا تمنع انسحاق الحقول — min-width يتغلب على max-width المكتوب داخل الصفحات
   حسب مواصفة CSS، فتتسع الحقول الضيقة بلا تعديل أي صفحة. */
input[type="number"] { min-width: 96px; }      /* يتسع للرقم بعد سهمَي الزيادة والنقصان */
input[type="date"], input[type="month"] { min-width: 158px; }
input[type="time"] { min-width: 118px; }
input[type="text"], input[type="tel"], input[type="search"], input[type="password"], select { min-width: 118px; }

/* النماذج الأفقية تلتف بدل أن تضغط، والعنوان يلتصق بحقله لا بجاره */
.form-inline { flex-wrap: wrap; gap: 16px; }
.form-inline label { font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.form-inline label + input, .form-inline label + select { margin-inline-start: -9px; }
.form-inline input, .form-inline select { flex: 1 1 auto; }
/* ═══ ومربّعُ الاختيار مربّعٌ لا حقل ═══ (بلاغ أحمد المصوَّر 2026-10-04)
   القاعدةُ فوقه تُمدّد كلَّ `input` ليملأ سطرَه — ومربّعُ الاختيار `input`
   فيأخذها: يصير **صندوقاً أبيضَ عريضاً** ينفصل عن كلمته فتبدو معلَّقةً
   بلا شيء. وهو كذلك في كلِّ شريط فلاتر فيه مربّعُ اختيار، لا في شاشةٍ
   واحدة. فيُستثنى هو وأخوه الدائريّ من التمدّد. */
.form-inline input[type="checkbox"], .form-inline input[type="radio"] {
  flex: 0 0 auto; width: auto; min-width: 0; }

/* مقاسات موحّدة بدل الأعراض المكتوبة يدوياً داخل الصفحات */
.w-num { max-width: 120px; }
.w-sm  { max-width: 155px; }
.w-md  { max-width: 215px; }
.w-lg  { max-width: 320px; }

/* ── الخط العربي المستضاف ذاتياً ── */
@font-face {
  font-family: 'AlqasrArabic';
  src: url('/fonts/arabic.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
}
body { font-family: 'AlqasrArabic', 'Segoe UI', Tahoma, Arial, sans-serif; }
td, th, .num, .timer, .rcard-num, input, select { font-variant-numeric: tabular-nums; }

/* ── الشريط العلوي: أغمق ليفصل «ديكور النظام» عن «بيانات الغرف» + ثابت عند التمرير ── */
.topbar { background: var(--primary-dark); gap: 8px;
  position: sticky; top: 0; z-index: 300; box-shadow: 0 2px 10px rgba(0,0,0,.28); }
/* الروابط الداخلية (#) لا تختفي خلف الشريط الثابت */
html { scroll-padding-top: calc(var(--topbar-h) + 8px); }
.topbar nav { gap: 8px; }
.topbar nav a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 8px 12px; }
.topbar nav a.active { background: rgba(255,255,255,.14); box-shadow: inset 0 -3px 0 var(--copper); }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

/* ═══ شريط القوائم المنسدلة ═══ */
.menubar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.menutop { color: #fff; text-decoration: none; padding: 10px 14px; border-radius: 8px;
  min-height: var(--tap); display: inline-flex; align-items: center; font-weight: 600; }
.menutop:hover, .menu > summary:hover { background: rgba(255,255,255,.12); }
.menutop.active { background: rgba(255,255,255,.16); box-shadow: inset 0 -3px 0 var(--copper); }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; color: #fff; padding: 10px 14px;
  min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; font-weight: 600; user-select: none; white-space: nowrap; }
.menu > summary::-webkit-details-marker, .menu > summary::marker { display: none; content: ''; }
.menu[open] > summary { background: var(--copper); color: #fff; }
.menu.active > summary { box-shadow: inset 0 -3px 0 var(--copper); background: rgba(255,255,255,.14); }
.menu.active[open] > summary { background: var(--copper); }

.menu-panel { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 200;
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.22); padding: 8px; min-width: 250px;
  display: flex; flex-direction: column; gap: 2px; animation: menuIn .12s ease-out; }
.menu-panel-end { inset-inline-start: auto; inset-inline-end: 0; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-panel a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text); min-height: 42px; font-size: .95em; white-space: nowrap; }
.menu-panel a:hover { background: var(--copper-soft); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
/* ═══ القائمةُ لا تتجاوز أسفل الشاشة ═══ (بلاغ أحمد 2026-09-17)
   الشريطُ ثابتٌ في الأعلى فلا يكشف تمريرُ الصفحة ما تحت الحافّة. فإن طالت
   قائمةٌ عن الشاشة يضبط foot.ejs ارتفاعَها بالمساحة الباقية ويُفعّل تمريرَها.
   والتمريرُ يقصّ ما يخرج جانباً — فالقوائمُ الفرعيّةُ تنسدل تحت بندها حينها
   كما على الجوال، بدل أن تُقصّ. */
.menu-panel.menu-tall { overflow-y: auto; overscroll-behavior: contain; }
.menu-panel.menu-tall .submenu-panel { position: static; box-shadow: none; border: 0;
  border-inline-start: 2px solid var(--copper); border-radius: 0; margin: 2px 14px 4px 0;
  padding: 2px 0; min-width: 0; animation: none; }
/* عمودان على الشاشة العريضة — وعمودٌ واحدٌ على الجوال */
.menu-col { display: flex; flex-direction: column; gap: 2px; min-width: 240px; }
@media (min-width: 761px) {
  .menu-panel.menu-2col { display: grid; grid-template-columns: repeat(2, auto); column-gap: 8px; align-items: start; }
  .menu-panel.menu-2col > .menu-col + .menu-col { border-inline-start: 1px solid var(--border); padding-inline-start: 8px; }
}
.menu-panel form { margin: 4px; }

/* جرسا الاستقبال: التنبيهات والحجوزات المبدئية */
.menu-bell > summary { font-size: 1.15em; padding-inline: 8px; white-space: nowrap; }
/* الشارة **بجانب** الأيقونة لا فوقها: الموضع المطلق كان يضعها على حافة الزر
   فتبدو ملتصقة بالأيقونة المجاورة، ولا يُعرف لأيّهما هي. */
/* ═══ حارسٌ واحدٌ لصنفِ عطلٍ بأكمله ═══ (بلاغُ أحمد 2026-08-26: «ما بينزل»)
   `[hidden]` من أنماط المتصفّح تساوي في الأولوية أيَّ قاعدةٍ من أنماطنا،
   وأنماطُ المؤلف تغلبها. فكلُّ صنفٍ نعطيه `display` صريحاً يُبطل إخفاءه:
   الشيفرةُ تضع السمة والعنصرُ باقٍ يُرى.

   ووقع **خمس مرّاتٍ منفصلة**، وكان يُعالَج في كلِّ مرّةٍ بحارسٍ لصنفه
   وحدَه — فيبقى البابُ مفتوحاً لصنفٍ سادس. وقد كُتب التحذيرُ في أربعة
   مواضع وما منع السادسة (وهي عمودُ طلبات النزلاء).

   وفحصُ اليوم كشف **سبعةَ مواضعَ قائمةً** لم يُبلَّغ عنها: مجموعُ الحجز
   يظهر فارغاً قبل إدخال التواريخ، وسطرُ السبب في تعديل المجموعة، وزرُّ
   «ارفعها» قبل اختيار صورة، وشريطُ الحفظ في الجرد…

   فقاعدةٌ واحدةٌ عامّة تُنهيه إلى الأبد. وفُحص قبلها أنّ **كلّ** إظهارٍ في
   القوالب يمرّ بخاصّية `hidden` ولا أحدَ يُظهر بـ`style.display` — فلا
   عنصرَ يعلق مخفيّاً بهذه القاعدة. */
[hidden] { display: none !important; }

/* [hidden] من أنماط المتصفح لها نفس الأولوية، وأنماط المؤلف تغلبها —
   فبلا هذا السطر تظهر الشارة بالرقم صفر بدل أن تختفي. */
.bell-count[hidden] { display: none; }
.bell-count { display: inline-block; min-width: 18px; height: 18px; margin-inline-start: 3px;
  padding: 0 5px; border-radius: 9px; background: var(--st-dueout, #b4552a); color: #fff;
  font-size: .56em; font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle; }
.bell-count-blue { background: var(--primary); }
.bell-panel { min-width: 330px; max-width: 440px; max-height: 70vh; overflow-y: auto; }
.bell-panel a { white-space: normal; line-height: 1.55; font-size: .88em; }
.bell-panel .muted { display: block; font-size: .84em; }
.bell-empty { display: block; padding: 10px 12px; color: var(--muted); font-size: .88em; }
.bell-mute { background: none; border: 0; color: #9fb0c0; font-size: 1em; cursor: pointer;
  padding: 0 6px; line-height: 1; }
.bell-mute:hover { color: #fff; }
.bell-mute.is-muted { color: #6b7885; }
/* رجّة قصيرة عند وصول حجز — لمن ينظر للشاشة بلا صوت */
@keyframes bellRing { 0%,100% { transform: none; } 20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
.bell-ring > summary { animation: bellRing .7s ease-in-out 3; transform-origin: 50% 20%; }
@media (prefers-reduced-motion: reduce) { .bell-ring > summary { animation: none; } }

/* قائمة المستخدم */
.menu-user > summary { flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.3;
  border-inline-start: 1px solid rgba(255,255,255,.18); }
.menu-user .whoami-name { color: #fff; font-weight: 700; font-size: .96em; }
.menu-user .whoami-role { color: #9fb0c0; font-size: .74em; }
.menu-user[open] > summary .whoami-role { color: #f0e6d8; }

@media (max-width: 760px) {
  /* كان position:fixed مع top:calc(100% + 6px) الموروث. والنسبة مع fixed
     تُحسب من ارتفاع **الشاشة** لا من الزرّ، فتُرسم اللوحة أسفل الشاشة كلها
     ولا تُرى: يضغط المستخدم على القائمة فلا يحدث شيء ظاهرياً — وهي مفتوحة.
     نُبقيها absolute ملتصقة بزرّها، ونحدّ عرضها بدل تمديدها. */
  .menu-panel { position: absolute; min-width: 0; width: max-content;
    max-width: min(88vw, 340px); max-height: 70vh; overflow-y: auto; }
  .bell-panel { min-width: 0; max-width: min(88vw, 360px); }
  .menu-user .whoami-role { display: none; }
}

/* ── فصل روابط التنقل عن أزرار الأوامر ── */
.page-head a.btn:not(.btn-primary):not(.btn-danger) {
  background: transparent; color: var(--primary); border: 1px solid var(--border); }
/* شريط أدوات الشاشة: بحث + تاريخ فقط (التنقّل صار في القائمة العلوية) */
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-tools input[type="search"], .page-tools input[type="date"] { min-height: var(--tap); }

/* ── الخريطة: عرض كامل للغرف، والعدّادات شريط أفقي فوقها ── */
.container { max-width: 1760px; }

.map-layout { display: block; }   /* كان عمودين؛ العمود الجانبي أُلغي 2026-08-05 */
.map-main { min-width: 0; }

/* البطاقات الجانبية للتنبيهات */
.side-title { margin: 0 0 8px; font-size: .95em; }
.side-alerts { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow-y: auto; }
.side-alert { display: block; background: #fdf6e0; border: 1px solid var(--warn); border-inline-start: 4px solid var(--st-dueout);
  border-radius: 8px; padding: 8px 10px; font-size: .82em; color: var(--text); text-decoration: none; line-height: 1.5; }
.side-alert:hover { background: #faeec9; }
.side-legend { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.lg { font-size: .72em; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border); }
.lg-free { background: #fff; } .lg-occ { background: var(--primary); color: #fff; }
.lg-res { border: 1px dashed var(--copper); } .lg-out { background: var(--st-dueout); color: #fff; }

/* العدّادات والدليل في صف العنوان بمحاذاة البحث والتاريخ.
   مُدمجة أفقياً (الرقم بجانب الكلمة لا فوقها) لأن الصف يحمل ثمانية عناصر
   إضافة للبحث والتاريخ — والمقاس العمودي كان يكسره سطرين. */
.head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.map-stats { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.side-legend { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0; }

.sst { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 9px;
  padding: 7px 9px; display: flex; flex-direction: column; line-height: 1.25; }
/* داخل صف العنوان: الرقم بجانب الكلمة — يوفّر نحو 40% من العرض */
.map-stats .sst { flex-direction: row; align-items: baseline; gap: 5px;
  padding: 4px 10px; white-space: nowrap; }
.map-stats .sst b { font-size: 1.15em; }
.sst b { font-size: 1.45em; color: var(--primary); }
.sst span { font-size: .72em; color: var(--muted); }
.sst-warn { background: #fdf6e0; border-color: var(--warn); }
.sst-warn b { color: var(--st-dueout); }

/* العدّاد هو الدليل: لون الصندوق = لون البطاقة في الخريطة.
   الأرقام والكلمات تُلوَّن معاً لأن .sst b و .sst span تُثبّتان لوناً بالاسم. */
.sst-free { background: #fff; }
.sst-occ  { background: var(--primary); border-color: var(--primary); }
.sst-occ b, .sst-occ span { color: #fff; }
.sst-res  { background: #fff; border: 1px dashed var(--copper); }
.sst-res b { color: var(--copper); }
.sst-out  { background: var(--st-dueout); border-color: var(--st-dueout); }
.sst-out b, .sst-out span { color: #fff; }
.sst-gap { margin-inline-start: 10px; }   /* «غير جاهزة» بُعد آخر — تُفصل بمسافة */

/* ── شبكة الغرف: أبعادها تُحسب بالجافاسكربت لتملأ الشاشة تماماً بلا تمرير ──
   المتغيرات أدناه قيم احتياطية إن تعطّل السكربت. */
.map-main { --rc-w: 130px; --rc-h: 78px; --rc-gap: 6px; --rc-num: 1.35em; }
.map-main h2 { margin: 6px 0 3px; font-size: .8em; color: var(--muted); }
.map-main .room-grid {
  grid-template-columns: repeat(auto-fill, minmax(var(--rc-w), 1fr));
  gap: var(--rc-gap); margin-bottom: var(--rc-gap); }
.map-main .rcard { min-height: var(--rc-h); overflow: hidden; }
.map-main .rcard-top { padding: 4px 6px 0; gap: 3px; }
.map-main .rcard-num { font-size: var(--rc-num); }
.map-main .rcard-suite, .map-main .rcard-flag { font-size: .62em; }
.map-main .rcard-guest { padding: 0 6px 2px; font-size: .68em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-main .rcard-bed { padding: 0 6px 3px; font-size: .62em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-main .rcard-strip { height: 6px; }
.map-main .rcard-strip::after { font-size: 7px; top: -2px; inset-inline-end: 4px; }
.map-main .page-head { margin-bottom: 6px; }

/* عند الضغط الشديد تُخفى الأسطر الثانوية ليبقى الرقم والحالة مقروءين */
.map-main.nohead h2 { display: none; }
.map-main.nohead .room-grid { margin-bottom: 6px; }
.map-main.tight .rcard-bed { display: none; }
.map-main.tighter .rcard-guest { font-size: .62em; }


@media (max-height: 800px) {
  .sst { padding: 5px 8px; }
  .sst b { font-size: 1.25em; }
}
/* شاشة أضيق: الصف ينزل سطراً منظّماً بدل أن يتبعثر — page-tools تلفّ أصلاً */
@media (max-width: 1400px) {
  .map-stats .sst span { font-size: .68em; }
  .map-stats .sst { padding: 4px 7px; }
}
@media (max-width: 1100px) {
  .map-stats, .side-legend { flex-basis: 100%; }
}

/* ═══ شاشة الحجز: شريط التنقّل بعدّاد الحجز ═══ */
.booknav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; }
.bn { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 6px 14px;
  border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--primary);
  text-decoration: none; font-weight: 600; white-space: nowrap; }
.bn:hover { background: var(--copper-soft); border-color: var(--copper); }
.bn-off { opacity: .38; pointer-events: none; }
.bn-new { background: var(--copper); border-color: var(--copper); color: #fff; margin-inline-start: auto; }
.bn-new:hover { background: #9c7a46; }
.bn-mid { flex: 1; text-align: center; font-size: .95em; }
.bn-mid b { font-size: 1.1em; }

/* ═══ نموذج الحجز: عمودان — النموذج يميناً ومعلومات الغرفة يساراً ═══ */
.book-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.book-main { min-width: 0; }
.book-side { min-width: 0; }
.book-side .note { font-size: .85em; padding: 8px 10px; }
.book-side .side-title { font-size: .9em; margin: 4px 0 6px; }
.tbl-slim { font-size: .82em; }
.tbl-slim th, .tbl-slim td { padding: 5px 7px; }

/* حقلان في سطر واحد بدل سطرين — يقصّر النموذج للنصف */
.book-main .fpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: end; }
.book-main .fcell { min-width: 0; }
.book-main .form label { margin-top: 8px; font-size: .88em; }
.book-main .form > label:first-of-type { margin-top: 0; }
.book-main .form input, .book-main .form select { margin-top: 2px; }
.book-main .session-actions { margin-top: 14px; }

@media (max-width: 1200px) {
  .book-layout { grid-template-columns: 1fr; }
  .book-main .fpair { grid-template-columns: 1fr; }
}

/* ═══ شاشة القبض: الرصيد أولاً ثم سند القبض ═══ */
.due-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-radius: 12px; padding: 12px 18px; margin-bottom: 14px; border: 1px solid var(--border); background: #fff; }
.due-open { background: #fdecea; border-color: var(--danger); }
.due-clear { background: #eafaf1; border-color: var(--ok); }
.due-main { display: flex; align-items: baseline; gap: 10px; }
.due-lbl { font-size: .9em; color: var(--muted); }
.due-num { font-size: 2.6em; font-weight: 800; line-height: 1; }
.due-open .due-num { color: var(--danger); }
.due-clear .due-num { color: var(--ok); }
.due-cur { font-size: .95em; color: var(--muted); }
.due-side { display: flex; align-items: center; gap: 16px; font-size: .9em; flex-wrap: wrap; }
.due-side b { font-size: 1.15em; }
.due-chip { background: var(--danger); color: #fff; border-radius: 20px; padding: 1px 9px; font-size: .82em; margin-inline-start: 6px; }

.pay-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.pay-main { order: -1; min-width: 0; }   /* سند القبض يميناً وهو الأهم */
.pay-side { min-width: 0; }
.pay-side .form { padding: 0; }
.pay-side h2 { margin: 12px 0 6px; }
.pay-side .form-inline { gap: 5px; }
.pay-side .form-inline input, .pay-side .form-inline select { max-width: 100% !important; flex: 1 1 90px; }

/* نموذج القبض بارز: حقل المبلغ كبير وزر واضح */
.pay-form { background: #fff; border: 1px solid var(--copper); border-radius: 12px; padding: 14px; gap: 8px; }
.pay-form #pay-amount { max-width: 150px !important; font-size: 1.5em; font-weight: 700; min-height: 52px; }
.pay-form .btn-primary { min-height: 52px; padding: 0 22px; font-size: 1.05em; }

@media (max-width: 1200px) { .pay-layout { grid-template-columns: 1fr; } }

/* ── الحالات: لون + أيقونة (دعم عمى الألوان) + إصلاح سماكة الشريط ── */
.rcard-strip { height: 9px; position: relative; }
.strip-ready { background: var(--st-ready); height: 9px; }
.strip-needs_cleaning { background: var(--st-dirty); }
.strip-cleaning { background: var(--st-cleaning); }
.strip-pending_inspection { background: var(--st-inspect); }
.rcard-strip::after { position: absolute; inset-inline-end: 6px; top: -1px; font-size: 9px; color: #fff; font-weight: 700; }
.strip-ready::after { content: '✓ جاهزة'; }
.strip-needs_cleaning::after { content: '✦ تنظيف'; }
.strip-cleaning::after { content: '⟳ جارٍ'; }
.strip-pending_inspection::after { content: '◎ تفتيش'; }
.strip-out_of_service::after { content: '✕ خارج الخدمة'; }

/* «تغادر اليوم» برتقالي مستقل — النحاسي يعود للفخامة فقط (جناح/ملكية) */
.rcard-dueout::before { background: var(--st-dueout); height: 6px; }
.rcard-dueout .rcard-flag { color: var(--st-dueout); }

/* ── لمس مريح ── */
.btn { min-height: var(--tap); }
.btn-sm { min-height: 36px; }
.btn-punch { min-height: 56px; }
input, select { min-height: var(--tap); }

/* ═══ نافذة الحجز فوق الخريطة ═══
   البنية عمود مرن: الرأس ثابت والجسم يمرّر — بلا اعتماد على sticky. */
.book-dlg { border: none; border-radius: 14px; padding: 0;
  width: 900px; max-width: 94vw; max-height: 88vh; background: #fff;
  overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); color: var(--text);
  margin: auto; }
/* مغلقة ⇒ مخفية تماماً (لا تظهر أسفل الصفحة)، ومفتوحة ⇒ عمود مرن */
.book-dlg:not([open]) { display: none; }
.book-dlg[open] { display: flex; flex-direction: column; }
.book-dlg::backdrop { background: rgba(14,22,31,.55); }
.dlg-head { flex: 0 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; background: var(--primary-dark); color: #fff;
  padding: 10px 16px; }
.dlg-head b { font-size: 1.05em; color: #fff; }
#dlg-body { flex: 1 1 auto; padding: 14px 16px 18px; overflow-y: auto; min-height: 120px; }
#dlg-body .form { border: none; padding: 0; max-width: 100%; }
#dlg-body .fpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: end; }
/* منتقي الغرفة في شاشة الحجز */
.room-pick-row { padding: 6px 0; gap: 10px; }
#room-pick { font-weight: 600; }
.room-pick-info { white-space: nowrap; }

/* شريط العدّاد داخل النافذة */
.pn-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.pn-nav .bn { font-size: .9em; }
.pn-nav .bn-mid { flex: 1; text-align: center; font-size: .9em; }

/* تبويبات اللوحة */
.pn-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.pn-tab { border: none; background: transparent; cursor: pointer; font: inherit; color: var(--muted);
  padding: 9px 14px; border-radius: 8px 8px 0 0; min-height: var(--tap);
  border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 600; }
.pn-tab:hover { background: var(--copper-soft); color: var(--text); }
.pn-tab.on { color: var(--text); border-bottom-color: var(--copper); background: var(--copper-soft); }
.pn-pane .info-table th { width: 34%; font-size: .86em; color: var(--muted); }
.pn-pane h2, .pn-pane h3 { font-size: .95em; margin: 12px 0 6px; }
.pn-pane .form { max-width: 100%; padding: 10px; }
.pn-pane table { margin-bottom: 10px; }

.night-rule { background: var(--copper-soft); border: 1px solid var(--copper);
  border-radius: 8px; padding: 7px 10px; margin: 8px 0; font-size: .85em; }
.late-out { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 700px) { #dlg-body .fpair { grid-template-columns: 1fr; } }

/* ═══ شاشة التوكيل: تمييز الغرف الموكَّلة ═══ */
.rooms-pick .room-chk { position: relative; min-width: 108px; }
.rc-tag { display: block; font-size: .68em; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.rc-busy { background: #fdf6e0; border-color: var(--copper); }
.rc-busy .rc-tag { color: #8a6d3b; }
.rc-full { opacity: .5; }
.rc-open { background: #eafaf1; border-color: var(--ok); }      /* فُتحت للمشاركة */
.rc-open .rc-tag { color: var(--ok); }
.share-toggle { background: var(--copper-soft); border: 1px solid var(--copper);
  border-radius: 8px; padding: 9px 12px; margin: 10px 0; display: block; }
.rooms-pick input:disabled + span, .rooms-pick label:has(input:disabled) { cursor: not-allowed; }

/* ═══ لوحة الإشراف المضغوطة — نفس مبدأ الخريطة مع مراعاة أزرار البطاقة ═══
   ═══ والمقاسُ كلُّه في متغيّرات ═══ (إصلاح بلاغ أحمد المصوَّر 2026-09-30)
   لأنّ له ثلاثةَ أحوالٍ لا حالين: شاشةٌ كبيرةٌ بفأرة (مضغوط) · جهازٌ يُلمس
   بالإصبع (مريح) · وفرضٌ يدويٌّ من الموظّف. فلو كُتبت القيمُ في القواعد
   لَتكرّرت ثلاثاً وافترقت عند أوّل تعديل — وبالمتغيّرات تُكتب القاعدةُ
   مرّةً ويُبدَّل الرقمُ وحدَه. */
.hk-main { --rc-w: 120px; --rc-h: 110px; --rc-gap: 6px; --rc-num: 17px;
  --rc-pad: 5px 6px; --rc-btn: 30px; --rc-sub: .68em; --rc-sub2: .66em;
  --rc-bedform: none; }
.hk-main h3 { margin: 6px 0 3px; font-size: .8em; color: var(--muted); }
.hk-main .room-grid {
  grid-template-columns: repeat(auto-fill, minmax(var(--rc-w), 1fr));
  gap: var(--rc-gap); margin-bottom: var(--rc-gap); }
.hk-main .room { min-height: var(--rc-h); padding: var(--rc-pad); border-width: 2px;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; overflow: hidden; }
.hk-main .room-num { font-size: var(--rc-num); line-height: 1.15; }
.hk-main .room-st { font-size: var(--rc-sub); }
.hk-main .room-bed { font-size: var(--rc-sub2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hk-main .room-cleaner { font-size: var(--rc-sub2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hk-main .room-note-sm { font-size: .62em; }
/* قائمة الأسرّة تُخفى على الشاشة الكبيرة (متاحة من جدول الطلبات وصفحة الغرفة) */
.hk-main .bed-form { display: var(--rc-bedform); }
.hk-main .room-actions { margin-top: auto; gap: 3px; }
.hk-main .room-actions .btn { min-height: var(--rc-btn); padding: 2px 6px; font-size: .82em; flex: 1; }
.hk-main.tight .room-st { display: none; }
.hk-main.tighter .room-bed, .hk-main.tighter .room-note-sm { display: none; }
.hk-main.nohead h3 { display: none; }
.hk-stats { grid-template-columns: 1fr 1fr; }
.hk-stats .sst:nth-child(5) { grid-column: 1 / -1; }

/* ═══ ما يُلمس بالإصبع يأخذ مقاسَ الإصبع ═══ (بلاغ أحمد المصوَّر 2026-09-30)
   كان الشرطُ **عرضاً** (≤1100)، وتابلتُ الإشراف العشريُّ يقول 1280 أفقيّاً —
   فوقع خارجَ القاعدة وأخذ تخطيطَ الشاشة الكبيرة: خطٌّ 0.66 وأزرارٌ 30 نقطة،
   وهي مقاساتُ فأرةٍ لا مقاساتُ إصبع. والعرضُ لا يدلُّ على اللمس: تابلتٌ
   عريضٌ يُلمس وشاشةُ لابتوبٍ ضيّقةٌ لا تُلمس.
   فصار الشرطُ **اللمسَ نفسَه**: `hover: none` (لا مؤشّرَ يحوم) مع
   `pointer: coarse` (إصبعٌ لا سهم) — أي جهازٌ لمسيٌّ بلا فأرة مهما اتّسع.
   ولابتوبُ الاستقبال بشاشةٍ لمسيّةٍ لا يدخلها لأنّ معه فأرةً تحوم
   (وقد أكّد أحمد 2026-09-30 أن لا شاشاتِ لمسٍ في الاستقبال أصلاً).
   والعرضُ الضيّقُ يبقى شرطاً ثانياً بـ«أو» — فالجوّالُ لا يُترك. */
@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  .hk-main { --rc-h: 0; --rc-pad: 10px; --rc-btn: var(--tap);
    --rc-num: 1.1em; --rc-sub: .8em; --rc-sub2: .8em; --rc-bedform: block; }
  /* والعدّاداتُ تُقرأ وقوفاً من مسافة الذراع لا جلوساً على مكتب */
  .map-stats .sst { padding: 7px 12px; }
  .map-stats .sst b { font-size: 1.35em; }
  .map-stats .sst span { font-size: .85em; }
  /* والمسمّى الوظيفيُّ الطويل هو ما يدفع القائمةَ إلى سطرٍ ثانٍ — والاسمُ يكفي */
  .whoami-role { display: none; }
  .hk-alerts .hka { font-size: 1em; padding: 8px 12px; }
}

/* ═══ وفرضٌ يدويٌّ للطوارئ ═══ (خيار أحمد 2026-09-30)
   إن أخطأ الفحصُ التلقائيُّ مع جهازٍ غريبٍ يوماً، يفتحه المشرفُ بضغطةٍ
   ولا ينتظر أحداً. ويُحفظ على الجهاز نفسِه فلا يُفرض على زملائه. */
html.ui-big .hk-main { --rc-h: 0; --rc-pad: 10px; --rc-btn: var(--tap);
  --rc-num: 1.1em; --rc-sub: .8em; --rc-sub2: .8em; --rc-bedform: block; }
html.ui-big .map-stats .sst { padding: 7px 12px; }
html.ui-big .map-stats .sst b { font-size: 1.35em; }
html.ui-big .map-stats .sst span { font-size: .85em; }
html.ui-big .whoami-role { display: none; }
html.ui-big .hk-alerts .hka { font-size: 1em; padding: 8px 12px; }

/* ═══ صفحة الحجز: ثلاثة أعمدة — من هو / ماذا حجز / ماذا أفعل ═══ */
.bk-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: start; margin-bottom: 12px; }
.bk-col { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.bk-h { margin: 0 0 8px; font-size: .92em; padding-bottom: 6px; border-bottom: 2px solid var(--copper); }
.bk-col h3:not(.bk-h) { margin: 12px 0 5px; font-size: .85em; color: var(--muted); }
.bk-col h2 { margin: 12px 0 5px; font-size: .9em; }
.bk-col table { margin-bottom: 8px; border: none; }
.bk-col .info-table th { width: 38%; font-size: .84em; color: var(--muted); font-weight: 600; }
.bk-col .info-table td { font-size: .9em; }
.bk-col th, .bk-col td { padding: 5px 6px; }
.bk-col .form { padding: 8px; margin-bottom: 8px; }
.bk-col .form-inline { padding: 6px 0; gap: 8px; }
.bk-col .note, .bk-col .alert { font-size: .82em; padding: 7px 9px; }
.bk-col .muted { font-size: .84em; }

/* عمود الإجراءات: الأزرار تحت بعضها بعرض كامل ليسهل ضغطها */
.bk-actions .session-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.bk-actions .session-actions > a, .bk-actions .session-actions form { width: 100%; }
.bk-actions .btn-punch { width: 100%; justify-content: center; text-align: center; }
.bk-actions .checkin-form { flex-direction: column; align-items: stretch; }
.bk-actions .checkin-form input { max-width: 100% !important; }
.bk-actions .btn-danger { width: 100%; }
.bk-actions input, .bk-actions select { max-width: 100% !important; }

@media (max-width: 1400px) { .bk-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1000px) { .bk-cols { grid-template-columns: 1fr; } }

/* ═══ الملاحظات والتصحيح ═══ */
.room-note { background: #fdf6e0; border-color: var(--copper); font-size: .88em; }
.rcard-note { cursor: help; }
.room-note-sm { font-size: .72em; color: var(--st-dueout); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.edit-box > summary { background: var(--copper-soft); border-color: var(--copper); }
.edit-box .form { border-color: var(--copper); }
.checkin-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cin-lbl { margin-top: 10px; }

/* ═══ سجل الإصدارات في «حول النظام» — عمود بجانب البطاقة ═══ */
.about-layout { display: grid; grid-template-columns: 420px 1fr; gap: 20px;
  align-items: start; max-width: 1200px; margin: 4vh auto 24px; }
.about-layout .login-box { margin: 0; max-width: 100%; }
.ver-box { margin: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  max-height: calc(100vh - var(--topbar-h) - 90px); overflow-y: auto; }

@media (max-width: 1000px) {
  .about-layout { grid-template-columns: 1fr; max-width: 560px; }
  .ver-box { max-height: none; }
}
.ver-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ver-head h2 { margin: 0; font-size: 1.02em; }
.ver-title { margin: 12px 0; padding-bottom: 8px; border-bottom: 2px solid var(--copper); font-size: 1.05em; }
.ver-group { margin-bottom: 12px; border-inline-start: 4px solid var(--border);
  padding: 6px 12px; border-radius: 6px; background: #fafbfc; }
.ver-group h3 { margin: 0 0 5px; font-size: .9em; }
.ver-group ul { margin: 0; padding-inline-start: 20px; }
.ver-group li { font-size: .9em; line-height: 1.75; }
.vg-add { border-inline-start-color: var(--ok); background: #f3fbf6; }
.vg-change { border-inline-start-color: var(--copper); background: #fdf9f3; }
.vg-fix { border-inline-start-color: var(--st-dueout); background: #fdf6ef; }

/* رقم النسخة في التذييل */
.app-ver { display: inline-block; margin-inline-start: 10px; padding: 2px 10px; border-radius: 20px;
  background: rgba(176, 141, 87, .16); border: 1px solid var(--copper); font-size: .88em; }

.rcard-tent { color: var(--warn, #b7950b); font-weight: 700; }

/* إكمال الحجز المبدئي عند التسكين */
.complete-box { background: #fdf6e0; border: 1px solid var(--warn); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 8px; width: 100%; }
.complete-box .form-inline { padding: 6px 0 2px; gap: 8px; }
.complete-box .muted { font-size: .82em; }
/* تنبيه مهلة منتهية: يبقى حتى يتصرّف الموظف — يطلب قراراً لا إخباراً */
.promise-live { border-inline-start: 5px solid var(--st-dueout); }
.promise-live div { padding: 2px 0; }

/* سطر «سيُسجَّل باسم…» أعلى نموذج الحجز */
.by-note { background: var(--copper-soft); border: 1px solid var(--copper); border-radius: 8px;
  padding: 6px 10px; margin-bottom: 10px; font-size: .86em; }

/* ── مفتاح التصميم ── */
.ui-switch { background: var(--copper-soft); border: 1px solid var(--copper); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ═══ التصحيح المالي داخل نافذة التعديل ═══ */
.bn-edit { background: var(--copper-soft); border-color: var(--copper); }
.fin-box { margin-top: 14px; border: 2px solid var(--st-dueout); border-radius: 12px;
  padding: 12px 14px; background: #fdf6ef; }
.fin-box h3 { margin: 0 0 4px; font-size: .98em; }
.fin-stay { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.fin-stay:first-of-type { border-top: none; }
.fin-stay .form-inline { padding: 5px 0; gap: 8px; }

/* ── خانة المجموع المالي في نماذج الحجز وإضافة الغرفة ──
   الغرض: ألّا يُقبض ثمن ليلة واحدة سهواً في حجز عدة ليالٍ. */
.sum-box {
  display: inline-flex; align-items: baseline; gap: .4rem;
  padding: .35rem .7rem; border-radius: 8px;
  background: var(--ok-bg, #e8f5ec); border: 1px solid var(--ok, #2e7d4f);
}
.sum-box .sum-lbl { font-size: .85rem; color: var(--muted); }
.sum-box .sum-num { font-size: 1.15rem; font-weight: 700; color: var(--ok, #2e7d4f); }
.sum-box .sum-cur { font-size: .85rem; }

/* ── بوابة التسكين: الزر «مائي» خارج يوم الحجز ──
   معطّل بصرياً ووظيفياً، والسبب والمخرج المشروع بجانبه. */
.btn.btn-locked,
.btn.btn-locked:hover {
  opacity: .38;
  filter: grayscale(1);
  cursor: not-allowed;
  box-shadow: none;
}
.gate-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin: .5rem 0; padding: .5rem .75rem;
  border-radius: 8px;
  background: var(--warn-bg, #fdf6e3);
  border: 1px solid var(--warn, #b7950b);
}
.gate-note .gate-msg { font-size: .92rem; }

/* ── شريط الفلترة: يتلوّن حين يكون أي فلتر مفعّلاً ── */
/* ═══ شريطُ المرشِّحات ═══ (بلاغ أحمد 2026-08-25)
   «ما بدي تكون فوق بعض وكل واحد بسطر — خليهم كلهم بسطر واحد بجانب بعض».

   والسبب: `.filters` كان **صنفاً بلا قاعدةٍ في التصميم إطلاقاً**، والقاعدةُ
   العامّة `input, select { width: 100% }` تتمدّد بكل حقلٍ سطراً كاملاً —
   فتصير الشاشةُ عموداً من الصناديق. وسبعُ شاشاتٍ تستعمله: السندات ·
   المالي · النزيل · قبل الإطلاق · صرفُ المطبخ · طلبُ الصرف · وهذا التقرير.

   فصفٌّ واحدٌ يلتفّ عند الضيق، وكلُّ حقلٍ بعرضِ ما يحتاج لا بعرض الشاشة. */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .55rem .8rem;
  border: 1px solid var(--line, #e2e7e5); border-radius: 10px;
  padding: .6rem .8rem; margin: .6rem 0;
}
.filters > label {
  display: flex; flex-direction: column; gap: .2rem;
  font-size: .82rem; color: var(--muted, #66727f); white-space: nowrap;
}
/* العرضُ بحسب الحاجة — وتغلبه أصنافُ w-* حين تُكتب */
.filters input, .filters select { width: auto; min-width: 8.5rem; padding: .45rem .6rem; }
.filters input[type="date"] { min-width: 9.5rem; }
.filters input[type="search"] { min-width: 14rem; }
.filters .btn { padding: .5rem 1.1rem; }
/* والنصُّ الحرّ (وسمٌ ثابتٌ أو ملاحظة) يحاذي الحقولَ لا يعلوها */
.filters > b, .filters > span { align-self: center; font-size: .88rem; }

@media (max-width: 640px) {
  .filters > label { flex: 1 1 9rem; }
  .filters input, .filters select { width: 100%; min-width: 0; }
}

/* ═══ العملُ المطلوب ═══ (جلسةُ أحمد 2026-08-25) بُعدٌ ثالثٌ على اللوحة:
   ما النظافةُ ولا الإشغال، بل **ما يُعمل في هذه الغرفة اليوم**. */
.hkc-need {
  display: block; font-size: .68rem; font-weight: 600; margin-top: 2px;
  padding: 1px 5px; border-radius: 7px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.hkc-need.need-checkout { background: #fdf0e6; color: var(--st-dueout, #b4552a); }
.hkc-need.need-daily    { background: #eef3f7; color: #4a6b86; }
.sst.need-checkout b { color: var(--st-dueout, #b4552a); }
.sst.need-checkout.is-on { background: var(--st-dueout, #b4552a); border-color: var(--st-dueout, #b4552a); color: #fff; }
.sst.need-checkout.is-on b { color: #fff; }
.sst.need-daily.is-on { background: #4a6b86; border-color: #4a6b86; color: #fff; }
.sst.need-daily.is-on b { color: #fff; }
.hka-need { background: #fdf0e6; border-color: var(--st-dueout, #b4552a); }

/* ═══ «تمّ» لا تُكتب بلون الخطأ ═══ (بلاغ أحمد المصوَّر 2026-10-04)
   كتبتُ في الشاشات الجديدة `alert alert-ok` و`alert-bad` — **والصنفان
   غيرُ معرَّفَين أصلاً**، فسقطا إلى `.alert` وهو أحمرُ دائماً. فرسالةُ
   نجاحٍ في ثماني شاشاتٍ تقول «تمّ» بلون العطل، ومن يراها يظنّ عملَه فشل.
   والقديمُ يستعمل `.note` للنجاح — فيأخذ `alert-ok` لونَه نفسَه. */
.alert-ok { background: #eafaf1; color: var(--ok, #1e8449); border-color: #a9dfbf; }
.alert-bad { background: #fdedec; color: var(--danger, #c0392b); border-color: #f5b7b1; }

.filter-bar {
  border: 1px solid var(--line, #e2e7e5); border-radius: 10px;
  padding: .6rem .8rem; margin: .6rem 0;
}
.filter-bar.filter-on { border-color: var(--warn, #b7950b); background: var(--warn-bg, #fdf6e3); }
.filter-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin: .3rem 0 .8rem; font-size: .93rem;
}
.chip-x { text-decoration: none; }
.chip-x:hover { filter: brightness(.94); }

/* صفوف الأصناف: شبكة ثابتة تعطي محاذاة الجدول مع بقاء التوسّع بلا جافاسكربت */
.item-row { border-bottom: 1px solid var(--line, #e2e7e5); }
.item-row > summary {
  display: grid; align-items: center; gap: .6rem; padding: .45rem .6rem; cursor: pointer;
  grid-template-columns: minmax(12rem, 1fr) 5rem 10rem 9rem 6rem 8rem;
}
.item-row > summary::-webkit-details-marker { display: none; }
.item-row[open] > summary { background: var(--surface-2, #f6f8f7); font-weight: 600; }
.item-head {
  display: grid; gap: .6rem; padding: .4rem .6rem; font-weight: 700; font-size: .88rem;
  grid-template-columns: minmax(12rem, 1fr) 5rem 10rem 9rem 6rem 8rem;
  border-bottom: 2px solid var(--line, #e2e7e5);
}
.item-body { padding: .6rem 1rem 1rem; background: var(--surface-2, #f8faf9); }
@media (max-width: 900px) {
  .item-row > summary, .item-head { grid-template-columns: 1fr auto; }
  .item-head { display: none; }
}

/* ═══ شاشة الأرصدة: شريط حفظ لاصق · صف معدَّل · تسوية مطويّة ═══ */
.save-bar { position: sticky; bottom: 0; z-index: 50; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; background: var(--copper-soft);
  border: 1px solid var(--copper); border-radius: var(--r-md);
  padding: 8px 14px; margin-top: 10px; box-shadow: 0 -6px 18px rgba(0,0,0,.08); }
.row-dirty td { background: var(--warn-bg); }
.adj-box > summary { list-style: none; cursor: pointer; display: inline-flex; }
.adj-box > summary::-webkit-details-marker { display: none; }
.adj-in { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
.hidden-form { display: none; }
.min-in { max-width: 90px; }

/* شريط تصفية الأصناف فوق قوائم الطلبات */
.item-filter { margin-bottom: 10px; }
.item-filter .form-inline { gap: 8px; }

/* وميض العنصر الذي عاد إليه المستخدم بعد الإضافة أو الحفظ */
@keyframes anchorFlash { 0%,100% { background: transparent; } 30% { background: #fdf6e0; } }
.anchor-flash td { animation: anchorFlash 2s ease-out; }
@media (prefers-reduced-motion: reduce) { .anchor-flash td { animation: none; } }

/* رقم مدين في جدول — يُلتقط بالعين بين أعمدة كثيرة */
.txt-danger { color: var(--st-dueout, #b03a2e); }

/* ═══ قوائم الإجراءات داخل صفوف الجداول ═══
   أربعة أزرار في كل سطر تُزاحم الشاشة، والخطر منها (تعطيل/حذف) لا يُراد
   على بُعد نقرة عابرة. */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.row-menu > summary::-webkit-details-marker, .row-menu > summary::marker { display: none; content: ''; }
.row-menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 120;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 4px;
  min-width: 172px; }
.row-menu-panel form { margin: 0; }
.row-menu-panel .btn { width: 100%; justify-content: flex-start; text-align: start; }

/* فاصل القسم في جدول الموظفين */
.dept-sep th { background: var(--copper-soft, #f6efe4); text-align: start;
  font-size: .95em; padding: 7px 10px; }
.chk { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.txt-ok { color: var(--ok, #1e7f4f); }

/* ═══ دليل ألوان الغرف (مخطط أحمد 2026-08-09) ═══
   أحمر مشغولة · أخضر مغادِرة · زهري مبدئي · أصفر نظافة ·
   بنفسجي بانتظار الفحص · برتقالي صيانة · أبيض فارغة.
   يُلفّ في .mapc-v2 ليبقى القديم قابلاً للعودة بزرّ واحد — المخطط يقلب
   معنى الأخضر (كان «فارغة») وهذا أخطر ما فيه. */
/* اللون كامل مشبع لا باهت (قرار أحمد): البطاقة كلّها بلون حالتها،
   فتُقرأ الشاشة من بعيد ومن طرف العين. */
.mapc-v2 .rst-busy    { background: #c0392b; border-color: #96281b; }
.mapc-v2 .rst-dueout  { background: #1e8449; border-color: #14663a; }
.mapc-v2 .rst-tent    { background: #d81b60; border-color: #ad1457; }
.mapc-v2 .rst-ooo     { background: #d35400; border-color: #a04000; }
.mapc-v2 .rst-inspect { background: #8e44ad; border-color: #6c3483; }
.mapc-v2 .rst-dirty   { background: #f1c40f; border-color: #c9a20b; }
.mapc-v2 .rst-free    { background: #fff;    border-color: #ccd4db; }

/* الخطّ يتبع اللون: أبيض على الداكن، وداكن على الأصفر والأبيض —
   والأبيض على الأصفر لا يُقرأ. */
.mapc-v2 .rst-busy, .mapc-v2 .rst-dueout, .mapc-v2 .rst-tent,
.mapc-v2 .rst-ooo, .mapc-v2 .rst-inspect { color: #fff; }
.mapc-v2 .rst-busy .rcard-guest, .mapc-v2 .rst-dueout .rcard-guest,
.mapc-v2 .rst-tent .rcard-guest, .mapc-v2 .rst-ooo .rcard-guest,
.mapc-v2 .rst-inspect .rcard-guest,
.mapc-v2 .rst-busy .rcard-bed, .mapc-v2 .rst-dueout .rcard-bed,
.mapc-v2 .rst-tent .rcard-bed, .mapc-v2 .rst-ooo .rcard-bed,
.mapc-v2 .rst-busy .muted, .mapc-v2 .rst-dueout .muted,
.mapc-v2 .rst-tent .muted, .mapc-v2 .rst-ooo .muted,
.mapc-v2 .rst-inspect .muted, .mapc-v2 .rst-inspect .rcard-bed,
/* الأوسمة بيضاء على **كل** بطاقة ملوّنة — كانت القاعدة تذكر ثلاثاً وتنسى
   «صيانة» و«بانتظار الفحص»، فيبقى وسمها نُحاسياً على برتقالي (1.35:1)
   وعلى بنفسجي (1.90:1) — موجودٌ في الصفحة وغيرُ مرئي للعين. */
.mapc-v2 .rst-busy .rcard-flag, .mapc-v2 .rst-dueout .rcard-flag,
.mapc-v2 .rst-tent .rcard-flag, .mapc-v2 .rst-ooo .rcard-flag,
.mapc-v2 .rst-inspect .rcard-flag { color: rgba(255,255,255,.9); }
/* «← السرير المطلوب» كان يفرض برتقاليّه على كل بطاقة: 1.17:1 على المغادِرة.
   وهو تحديداً ما يجب أن يراه الإشراف قبل وصول النزيل. */
.mapc-v2 .rst-busy .bed-need, .mapc-v2 .rst-dueout .bed-need,
.mapc-v2 .rst-tent .bed-need, .mapc-v2 .rst-ooo .bed-need,
.mapc-v2 .rst-inspect .bed-need { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.mapc-v2 .rst-dirty .bed-need { color: #7a2e00; }
.mapc-v2 .rst-dirty, .mapc-v2 .rst-dirty .rcard-guest,
.mapc-v2 .rst-dirty .rcard-bed, .mapc-v2 .rst-dirty .muted { color: #4a3c00; }
/* رقم الغرفة الأبرز دائماً */
.mapc-v2 .rcard-num { color: inherit; }
.mapc-v2 .rcard-dueout::before { background: #14663a; }
/* ═══ الشريط السفلي (حالة النظافة) ═══
   كان يبهت إلى 0.55 لئلا يزاحم لون البطاقة — لكن «جاهزة» أخضر #1e8449
   وبطاقة «مغادِرة» أخضر #1e8449 نفسه: أخضرُ على أخضر = 1.00:1، فيختفي
   الشريط تماماً على الغرف المغادرة — وهي وحدها ما يهمّ الإشراف اليوم.
   فصار له فاصلٌ أبيض يحدّه، و«جاهزة» تفتح لونها فوق الأخضر الداكن. */
.mapc-v2 .rcard-strip { border-top: 2px solid rgba(255,255,255,.72); }
.mapc-v2 .rst-busy .rcard-strip, .mapc-v2 .rst-dueout .rcard-strip,
.mapc-v2 .rst-tent .rcard-strip { opacity: .82; }
.mapc-v2 .rst-dueout .strip-ready { background: #7ee2a8; }

/* وسما البطاقة الوردية: مهلةٌ انقضت، وورقٌ ناقص — كلاهما بُعد آخر لا لون */
.rcard-late { background: rgba(0,0,0,.28); border-radius: 6px; padding: 0 5px; }
.rcard-nodoc { opacity: .92; }

/* العدّاد = الدليل = الفلتر */
.map-stats .sst { cursor: pointer; border-width: 2px; }
.sst.is-on { outline: 3px solid var(--copper); outline-offset: 1px; }
.lg-busy    { background: #c0392b; border-color: #96281b; }
.lg-dueout  { background: #1e8449; border-color: #14663a; }
.lg-tent    { background: #d81b60; border-color: #ad1457; }
.lg-ooo     { background: #d35400; border-color: #a04000; }
.lg-inspect { background: #8e44ad; border-color: #6c3483; }
.lg-dirty   { background: #f1c40f; border-color: #c9a20b; }
.lg-free    { background: #fff;    border-color: #ccd4db; }
.lg-busy b, .lg-busy span, .lg-dueout b, .lg-dueout span,
.lg-tent b, .lg-tent span, .lg-ooo b, .lg-ooo span,
.lg-inspect b, .lg-inspect span { color: #fff; }
.lg-dirty b, .lg-dirty span { color: #4a3c00; }
.sst.is-zero { opacity: .38; cursor: default; }

/* ⚠️ الإخفاء بصنف لا بـ[hidden]: البطاقة display:flex والشبكة display:grid
   في أنماطنا، وهي تغلب [hidden] من أنماط المتصفح — فكان الفلتر يُنفَّذ
   ولا يختفي شيء على الشاشة. */
.rcard.is-off, .room-grid.is-off, .floor-head.is-off, .floor-row.is-off { display: none !important; }

/* ═══ شريط الطابق ═══
   كان سطراً رمادياً فوق الصف يضيع بين البطاقات، ومع التمرير لا يُعرف
   أيُّ طابق يُرى. صار عموداً يمينَ صفّه، ملتصقاً فيبقى ظاهراً ما دام
   صفُّه على الشاشة. */
.floor-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.floor-row > .room-grid { flex: 1 1 auto; margin-bottom: 0; }
.floor-tag { flex: 0 0 66px; align-self: stretch; position: sticky;
  top: calc(var(--topbar-h, 56px) + 10px);
  background: var(--primary-dark); color: #fff; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 10px 4px; min-height: 84px; text-align: center; }
.floor-tag b { font-size: .95em; line-height: 1.25; }
.map-main .floor-tag { min-height: var(--rc-h); }
/* البطاقة كبرت: الاسم والأسرّة يكبران معها فلا تبقى مساحة بيضاء داخلها */
.map-main .rcard-guest { font-size: .74em; }
.map-main .rcard-bed { font-size: .68em; }
.map-main .rcard { justify-content: space-between; }
.floor-tag span { font-size: .72em; color: #b9c4cf; white-space: nowrap; }

@media (max-width: 760px) {
  /* على الجوال العمود يبتلع عرض بطاقة — يصير شريطاً أفقياً فوق الصف */
  .floor-row { flex-direction: column; gap: 6px; }
  .floor-tag { flex: 0 0 auto; align-self: stretch; position: static;
    flex-direction: row; gap: 8px; min-height: 0; padding: 6px 12px; justify-content: flex-start; }
}
.sst-all    { background: var(--primary); border-color: var(--primary); }
.sst-all b, .sst-all span { color: #fff; }

/* ═══ بحث النزيل السابق ═══ */
#guest-dlg { max-width: 560px; width: 92vw; }
#gs-list { margin-top: 10px; max-height: 52vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; }
.gs-item { display: flex; flex-direction: column; gap: 2px; text-align: start;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font: inherit; width: 100%; }
.gs-item:hover { background: var(--copper-soft, #f6efe4); border-color: var(--copper); }
.gs-item b { font-size: 1.02em; }
.gs-item .muted { font-size: .84em; }
.gs-here { color: #c0392b; font-weight: 700; font-size: .84em; }

/* زرّ صغير ملاصق لحقله — لا تائه في صف النموذج */
.fld-btn { display: inline-flex; align-items: stretch; gap: 0; }
.fld-btn > input { border-start-end-radius: 0; border-end-end-radius: 0; }
.icon-btn { min-height: var(--tap); min-width: 44px; padding: 0 10px;
  border: 1px solid var(--border); background: #f4f6f8; cursor: pointer;
  border-radius: 8px; font-size: 1.05em; line-height: 1; }
.fld-btn > .icon-btn { border-start-start-radius: 0; border-end-start-radius: 0;
  border-inline-start: 0; }
.icon-btn:hover { background: var(--copper-soft, #f6efe4); border-color: var(--copper); }

/* ═══ شبكة تأشير غرف المجموعة ═══
   بألوان الخريطة نفسها فتُقرأ بعينٍ واحدة، وبلا سعر معلن: للمجموعة سعر
   متفق واحد، وعرضهما معاً يزرع سؤال «أيّهما المعتمد؟». */
.pickgrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pickcard { display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px; border: 2px solid var(--border); border-radius: 10px;
  cursor: pointer; background: #fff; text-align: center; user-select: none; }
.pickcard b { font-size: 1.1em; }
.pickcard span { font-size: .62em; opacity: .85; line-height: 1.2; }
.pickcard input { margin: 0; width: 18px; height: 18px; }
.pickcard.is-busy { opacity: .5; cursor: not-allowed; filter: grayscale(1); }
.pickcard:has(input:checked) { outline: 3px solid var(--copper); outline-offset: 1px; }
.pickcard.rst-busy    { background: #fdecea; border-color: #c0392b; }
.pickcard.rst-dirty   { background: #fdf3c9; border-color: #b7950b; }
.pickcard.rst-inspect { background: #f0e4fa; border-color: #8e44ad; }
.pickcard.rst-ooo     { background: #fde3cf; border-color: #d35400; }
.pickcard.rst-free    { background: #fff;    border-color: #ccd4db; }
#grp-pick .floor-row { margin-bottom: 10px; }
#grp-pick .floor-tag { flex: 0 0 74px; min-height: 0; position: static; }
/* بداية غرفة جديدة في جدول أسماء المجموعة */
#names-table tr.room-start td { border-top: 2px solid var(--copper); }

/* المرافقون في نموذج الحجز */
.comp-fold { margin: 8px 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.comp-fold > summary { cursor: pointer; font-weight: 700; }
.comp-body { margin-top: 8px; }
.comp-row { border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 6px; }
.w-xs { width: 76px; }

/* اقتراح الجهات والمنسّقين */
.sug-wrap { position: relative; display: inline-block; }
.sug-list { position: absolute; top: calc(100% + 3px); inset-inline-start: 0; z-index: 150;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 5px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18); min-width: 320px; max-height: 46vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px; }
/* ⚠️ الثالثة من نوعها: `display:flex` من أنماطنا يغلب [hidden] من أنماط
   المتصفح، فكان `box.hidden = true` يُنفَّذ **ولا تختفي القائمة**. تبقى بعد
   الاختيار فوق النموذج تحجب «الجهة الدافعة» و«+ ملف جديد».
   (سبقتها شارة الجرس وفلتر خريطة الغرف — والعلاج واحد.) */
.sug-list[hidden] { display: none !important; }
.sug-item { display: flex; flex-direction: column; gap: 1px; text-align: start; width: 100%;
  padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; background: none;
  cursor: pointer; font: inherit; }
.sug-item:hover { background: var(--copper-soft, #f6efe4); border-color: var(--copper); }
.sug-item .muted { font-size: .82em; }
.sug-new { font-size: .74em; color: var(--st-dueout, #b4552a); }
/* عنوان مجموعة داخل قائمة منسدلة */
.menu-head { display: block; padding: 4px 12px 2px; font-size: .74em; font-weight: 700;
  color: var(--muted); letter-spacing: .02em; }
/* طلب ترتيب سرير تأخّر: وصل النزيل ولم يُرتَّب */
.row-late td { background: #fdecea; }
.row-late td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
/* مدة تنظيف غير معقولة */
.dur-odd { color: #b7950b; font-weight: 700; }

/* ═══ طاولة العمل في الرئيسية ═══ */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px; margin-bottom: 18px; }
.todo-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 2px solid var(--border); border-radius: 12px; background: #fff;
  text-decoration: none; color: var(--text); min-height: 66px; }
.todo-card:hover { border-color: var(--copper); background: var(--copper-soft, #f6efe4); }
.todo-card b { font-size: 1.7em; line-height: 1; min-width: 42px; text-align: center; }
.todo-card span { font-size: .92em; line-height: 1.35; }
.todo-warn { background: #fdecea; border-color: #c0392b; }
.todo-warn b { color: #c0392b; }
.todo-card.go { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.todo-card.go:hover { background: var(--copper); border-color: var(--copper); }

/* ═══ نوافذ التنقّل ═══ الخلفية باقية كما هي، والطبقات تتراكم */
.nav-dlg { border: none; border-radius: 14px; padding: 0; width: min(1180px, 96vw);
  max-height: 92vh; background: var(--bg, #f7f8fa); color: var(--text);
  box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.nav-dlg:not([open]) { display: none; }
.nav-dlg[open] { display: flex; flex-direction: column; }
.nav-dlg::backdrop { background: rgba(14,22,31,.5); }
.nav-dlg .dlg-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; background: var(--primary-dark); border-radius: 14px 14px 0 0; }
.nav-dlg .dlg-head b { color: #fff; font-size: 1.05em; }
.nav-tools { display: flex; gap: 6px; align-items: center; }
.nav-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 18px; }
.nav-body > h2:first-child { margin-top: 0; }
/* الطبقة الثانية والثالثة أضيق قليلاً — فيُرى ما تحتها */
.nav-dlg + .nav-dlg { width: min(1080px, 92vw); }
.nav-dlg + .nav-dlg + .nav-dlg { width: min(960px, 88vw); }
/* كانت تُخفي **كل** نافذة عند الطباعة فيُطبع ما تحتها — والمستند غالباً
   داخل النافذة. فصارت تُخفي المغلقة والمصغَّرة وحدها. (بلاغ أحمد 2026-08-16) */
@media print {
  .nav-dlg:not([open]), .nav-dlg.is-min, .nav-dlg::backdrop { display: none !important; }
}

/* ═══ أزرار النافذة ═══ تصغير · تكبير · إغلاق */
.win-btn { min-width: 40px; height: 30px; border: 0; background: transparent; color: #cfd8e0;
  font-size: 1em; line-height: 1; cursor: pointer; border-radius: 6px; padding: 0 8px; }
.win-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.win-x:hover { background: #c0392b; color: #fff; }
.nav-dlg.is-max { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
.nav-dlg.is-max .dlg-head { border-radius: 0; }

/* شريط المصغَّرات — يظهر فقط حين يكون فيه شيء */
#nav-taskbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 9999;
  display: none; gap: 8px; padding: 6px 10px; background: var(--primary-dark);
  box-shadow: 0 -2px 12px rgba(0,0,0,.28); }
#nav-taskbar.has-items { display: flex; flex-wrap: wrap; }
.nav-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  padding: 6px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
  background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .86em; cursor: pointer; }
.nav-chip:hover { background: var(--copper); border-color: var(--copper); }
.nav-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chip .chip-x { font-style: normal; opacity: .7; padding: 0 2px; }
.nav-chip .chip-x:hover { opacity: 1; color: #ffd9d3; }
@media print { #nav-taskbar { display: none !important; } }

/* ═══ كشف عهدة الوردية ═══ (قرار أحمد 2026-08-10)
   سندُ تسليم يوقّعه المُسلِّم والمُستلِم — فالشاشة والورقة واحدة، ويُطبع
   إجبارياً عند كل إغلاق. */
.print-doc .info-table { max-width: 100%; }
.print-doc h3 { margin: 18px 0 6px; font-size: 1.02em; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.calc-table { max-width: 460px; }
.calc-table .num-cell { text-align: left; font-variant-numeric: tabular-nums; width: 42%; }
.row-sum td { background: #f7f1e8; font-weight: 700; }
.row-bad td { background: #fdedec; }
.row-bad td:first-child { border-right: 3px solid var(--danger); }
.sign-table { width: 100%; margin-top: 26px; table-layout: fixed; }
.sign-table td { border: 1px solid var(--border); padding: 14px; vertical-align: top; font-size: .92em; }
.print-foot { margin-top: 14px; text-align: center; font-size: .78em; }
@media print {
  nav.menubar, .page-head, .filter-bar, .alert .no-print { display: none !important; }
  .print-doc h3 { break-after: avoid; }
  .print-doc table { break-inside: auto; }
  .print-doc tr { break-inside: avoid; }
  .sign-table { break-inside: avoid; }
}

/* ═══ لوحة الإشراف — بلغة شاشة الاستقبال ═══ (قرار أحمد 2026-08-11)
   البطاقة كلّها بلون حالتها لا حدٌّ ملوّن وجوفٌ أبيض: تُقرأ الشاشة من بعيد.
   والألوان هي ألوان النظام نفسها (--st-*) المستعملة في شريط النظافة أسفل
   بطاقات الاستقبال — فلغة الألوان واحدة في الشاشتين. */
.hk-alerts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.hka { display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-inline-start: 4px solid var(--muted);
  border-radius: 10px; padding: 7px 12px; font-size: .88em; color: var(--text); }
.hka:hover { background: var(--copper-soft); }
.hka-warn { background: #fdf6e0; border-color: var(--warn); border-inline-start-color: var(--st-dueout); }
.hka-bad { background: #fdedec; border-color: var(--danger); border-inline-start-color: var(--danger); font-weight: 700; }
.hka-ok { border-inline-start-color: var(--st-ready); color: var(--muted); }

/* الغرف يميناً والعمودان يساراً — وفي RTL يكفي ترتيب العنصرين */
.hk-layout { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.hk-rooms { flex: 1 1 auto; min-width: 0; }
.hk-cols { flex: 0 0 300px; display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: calc(var(--topbar-h, 56px) + 10px); }
.hk-col { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.hk-col-head { margin: 0; padding: 9px 12px; background: var(--primary-dark); color: #fff;
  font-size: .92em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hk-col-n { background: rgba(255,255,255,.16); border-radius: 8px; padding: 1px 8px; font-size: .82em; }
.hk-col-body { max-height: 40vh; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.hk-task { border: 1px solid var(--border); border-inline-start: 4px solid var(--border);
  border-radius: 9px; padding: 7px 9px; font-size: .84em; background: #fff; }
.hk-task.is-late { background: #fdedec; border-inline-start-color: var(--danger); }
.hk-task.is-today { background: #fdf6e0; border-inline-start-color: var(--warn); }
.hk-task.is-old { border-inline-start-color: var(--st-dueout); }
.hk-task-top { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.hk-task-top b { font-size: 1.15em; }
.hk-task-sub { color: var(--muted); font-size: .92em; margin: 3px 0 6px; line-height: 1.5; }
.hk-chip { background: var(--copper-soft); border: 1px solid var(--copper); border-radius: 7px;
  padding: 0 6px; font-size: .82em; }
.hk-task-act { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.hk-task-act input[type="text"] { flex: 1 1 70px; min-width: 70px; font-size: .92em; padding: 4px 7px; }
.hk-task-act .w-num { max-width: 62px; min-width: 62px; padding: 4px 6px; }

/* ═══ بطاقة الغرفة ═══ بحجم بطاقة الاستقبال: الأزرار انتقلت إلى اللوحة */
.hk-rooms .room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 7px; margin-bottom: 0; }
.hkcard { display: flex; flex-direction: column; align-items: stretch; gap: 1px;
  border: 2px solid transparent; border-radius: 11px; padding: 7px 8px; min-height: 78px;
  font: inherit; text-align: start; cursor: pointer; color: #fff; }
.hkcard:disabled { cursor: default; }
.hkcard:hover:not(:disabled) { filter: brightness(1.08); }
.hkcard:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
.hkc-num { font-size: 1.32em; font-weight: 800; line-height: 1.1; }
.hkc-note { font-style: normal; font-size: .6em; vertical-align: super; }
.hkc-st { font-size: .72em; opacity: .95; }
.hkc-bed, .hkc-emp { font-size: .68em; opacity: .88; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.hk-ready            { background: #1e8449; border-color: #14663a; }
.hk-needs_cleaning   { background: #f1c40f; border-color: #c9a20b; color: #4a3c00; }
.hk-cleaning         { background: #2471a3; border-color: #1a5276; }
.hk-pending_inspection { background: #8e44ad; border-color: #6c3483; }
.hk-out_of_service   { background: #d35400; border-color: #a04000; }
/* الصفر في الدليل باهت ولا يُضغط — ولا يُخفى: الدليل يُعلّم اللون */
.sst.hk-needs_cleaning b, .sst.hk-needs_cleaning span { color: #4a3c00; }
.sst.hk-ready b, .sst.hk-ready span, .sst.hk-cleaning b, .sst.hk-cleaning span,
.sst.hk-pending_inspection b, .sst.hk-pending_inspection span,
.sst.hk-out_of_service b, .sst.hk-out_of_service span { color: #fff; }
.hkcard.is-off { display: none !important; }

/* لوحة الغرفة */
.hk-dlg { max-width: 460px; width: 92vw; }
.hk-dlg-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.hk-dlg-row { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.hk-dlg-row label { font-weight: 600; }

/* ═══ ويُطوى العمودُ الجانبيُّ على اللمس أيضاً ═══
   (بلاغ أحمد المصوَّر 2026-09-30: «انقطع الجانبُ الأيمن»)
   `.hk-cols` عرضُها **300 نقطة لا تتقلّص** (`flex: 0 0 300px`)، وكان
   يُطوى تحت الغرف في الشاشات ≤900 — وتابلتُ الإشراف فوقها. فلمّا كبرت
   البطاقاتُ للمس لم يبقَ للغرف ما يكفي، فاتّسعت الصفحةُ عن الشاشة
   وانقطع طرفُها. والشرطُ هنا مثلُ أخيه: عرضٌ ضيّق **أو** جهازٌ يُلمس. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  /* العمودان تحت الغرف على الجوال — الغرف أولاً فهي الشاشة */
  .hk-layout { flex-direction: column; }
  .hk-cols { flex: 1 1 auto; width: 100%; position: static;
    flex-direction: row; flex-wrap: wrap; }
  .hk-col { flex: 1 1 260px; }
  .hk-col-body { max-height: 46vh; }
}

/* ═══ حقل بحثٍ يُعرف أنه بحث ═══ (طلب أحمد 2026-08-11)
   حقل «اسم الجهة» كان يبحث ولا شيء يقول ذلك، فيكتبه الموظف من الصفر
   ولا ينتظر الاقتراح — فيتشعّب الاسم الواحد إلى ثلاثة وتتفرّق ذمّته. */
.srch-wrap { position: relative; display: inline-flex; align-items: center; }
.srch-wrap .srch-in { padding-inline-start: 32px; }
.srch-ico { position: absolute; inset-inline-start: 9px; font-size: .95em;
  pointer-events: none; opacity: .65; line-height: 1; }
.grp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.grp-edit > summary { background: var(--copper-soft); border-color: var(--copper); }
.grp-edit .form { padding: 12px 4px 4px; }

/* ═══ رأس لوحة الإشراف الملتصق + وسم الإشغال ═══ (قرار أحمد 2026-08-11) */
/* ═══ حارسُ العرض ═══ (2026-09-30)
   الشريطُ الملتصقُ والتنبيهاتُ والعدّادات: كلُّها تلفّ أصلاً، لكنّ عنصراً
   واحداً لا يلفّ (اسمٌ طويلٌ بلا فواصل مثلاً) يوسّع الصفحةَ كلَّها فينقطع
   طرفُها. والحدُّ هنا يمنع ذلك بلا أن يُخفي شيئاً. */
.hk-head, .hk-alerts, .hk-layout, .hk-rooms { max-width: 100%; }
.hk-head { position: sticky; top: var(--topbar-h, 56px); z-index: 60;
  background: var(--bg); padding-top: 8px; margin-bottom: 4px;
  box-shadow: 0 8px 10px -8px rgba(0,0,0,.18); }
.hk-head .page-head { margin-bottom: 8px; }
.lg-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
/* أزرار بُعد الإشغال: بلا لون بطاقةٍ حتى لا تُخلط بألوان النظافة */
.occ-dueout { border-color: var(--st-dueout); }
.occ-dueout b { color: var(--st-dueout); }
.occ-busy { border-color: var(--primary); }
.occ-free { border-color: var(--st-ready); }
.occ-free b { color: var(--st-ready); }
/* ═══ تمييز المشغولة ═══ (اقتراح أحمد 2026-08-11)
   كان اسم النزيل أبيضَ كبقية الكلام فيذوب فيه. واقترح لونَ الإشغال من
   الاستقبال — وقستُه: أحمر #c0392b على أخضر #1e8449 = **1.15:1**، وعلى
   الأزرق 1.03:1. أحمرُ على أخضر لا يُقرأ إطلاقاً؛ اللونان متقاربان في
   العتمة وإن تباعدا في اللون، والعين تُميّز العتمة.
   فالأحمر صار **خلفية شارةٍ** لا حبراً: أبيضُ على أحمر = 5.44:1، والشارة
   تحمل خلفيتها فتُقرأ على الأخضر والأصفر والأزرق سواءً.
   ومعها حافّةٌ ملوّنة تُرى من آخر الشاشة قبل قراءة حرف. */
.hkc-occ { font-style: normal; font-size: .72em; vertical-align: super; margin-inline-start: 2px; }
.hkc-guest { align-self: flex-start; max-width: 100%; margin: 1px 0;
  background: #c0392b; color: #fff; border-radius: 7px; padding: 1px 6px;
  font-size: .64em; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
/* المغادرة أثقل عمل على الإشراف — برتقاليّة تُفرَّق عن المشغولة بنظرة */
.hkcard[data-occ="dueout"] .hkc-guest { background: #b4552a; }
/* «لم يصل بعد» بوردي الاستقبال نفسه — لغة ألوان واحدة في الشاشتين */
.hkcard[data-occ="reserved"] .hkc-guest { background: #d81b60; }

.hkcard { position: relative; overflow: hidden; }
.hkcard[data-occ="busy"], .hkcard[data-occ="dueout"], .hkcard[data-occ="reserved"] {
  padding-inline-start: 13px; }
.hkcard[data-occ="busy"]::after, .hkcard[data-occ="dueout"]::after,
.hkcard[data-occ="reserved"]::after {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 6px; }
.hkcard[data-occ="busy"]::after { background: #c0392b; }
.hkcard[data-occ="dueout"]::after { background: #b4552a; }
.hkcard[data-occ="reserved"]::after { background: #d81b60; }

/* شبكة استكمال الأسرّة */
.beds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px; margin-bottom: 16px; }
.bedm { display: flex; align-items: center; gap: 7px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; }
.bedm b { font-size: 1.05em; min-width: 38px; }
.bedm .muted { font-size: .78em; }
.bedm select { flex: 1 1 auto; min-width: 0; }
.bedm.is-set { border-color: var(--st-ready); background: #f2fbf5; }

/* ═══ الغرفة خارج الخدمة ═══ (قرار أحمد 2026-08-11)
   السبب والمدة على البطاقة بلا ضغط — كان المربّع البرتقالي يقول «خارج
   الخدمة» ولا يقول لماذا ولا منذ متى، والغرفة لا تُباع كل تلك المدة. */
.hkc-oos { background: rgba(0,0,0,.34) !important; }
.hkd-oos { background: #fdf6e0; border: 1px solid var(--warn);
  border-inline-start: 4px solid var(--st-dueout); border-radius: 10px; padding: 9px 12px; }
.hkd-oos p { margin: 4px 0 0; line-height: 1.6; }
.hkd-oos-form { display: flex; flex-direction: column; gap: 7px;
  background: #fdedec; border: 1px solid var(--danger); border-radius: 10px; padding: 12px; }
.hkd-oos-form label { font-weight: 600; }
.hkd-oos-form p { margin: 2px 0; font-size: .86em; }
.hkd-oos-form[hidden] { display: none !important; }
.hkd-oos[hidden] { display: none !important; }
/* رأس الصفحة داخل النافذة: عنوانه انتقل لرأس النافذة وبقيت أزراره */
.page-head-innav { margin-bottom: 12px; }

/* ═══ إقرار المسؤولية عند رفض النزيل إعطاء جواله ═══ (صيغة أحمد 2026-08-11)
   يُرى ولا يُضغط سهواً: خلفية تحذير وحدٌّ أحمر وسطرٌ كامل لا خانة بين الحقول. */
.waive-box { display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
  background: #fdf6e0; border: 1px solid var(--warn); border-inline-start: 4px solid var(--danger);
  border-radius: 9px; padding: 7px 10px; margin-bottom: 7px; font-size: .84em; line-height: 1.55; }
.waive-box input { margin-top: 3px; flex: 0 0 auto; width: 17px; height: 17px; }
.waive-box:hover { background: #fbeec8; }
.waive-box input:checked ~ span { font-weight: 700; color: #8a1f14; }
.waive-inline { margin: 0 8px 0 0; max-width: 340px; }

/* منتقي الجنسية: الكتابة تُفتح للأجنبي وحده */
.nat-other[hidden], #bf-nat-other[hidden] { display: none !important; }

/* ═══ شبكة صلاحيات المستودعات ═══ (قرار أحمد 2026-08-11) */
.wh-access-wrap { overflow-x: auto; margin-bottom: 14px; }
.wh-access th { position: sticky; top: 0; background: var(--primary-dark); color: #fff;
  font-size: .78em; white-space: nowrap; }
.wh-access .wh-name { position: sticky; inset-inline-start: 0; background: var(--card);
  min-width: 190px; z-index: 2; }
.wh-sel { min-width: 62px; padding: 3px 4px; text-align: center; }
.wh-sel.has-view { background: #eaf2f8; border-color: var(--primary); }
.wh-sel.has-manage { background: #f2fbf5; border-color: var(--st-ready); font-weight: 700; }

/* ═══ قوائم فرعية تتفرّع جانباً ═══ (قرار أحمد 2026-08-12)
   الإعدادات ستة عشر بنداً تبلغ أسفل الشاشة، والاستقبال ثلاثة عشر — والعين
   تقرأ خمسة دفعةً واحدة ولا تقرأ ستة عشر. والقاعدة: ما يُفتح يومياً يبقى
   ظاهراً، وما يُفتح أسبوعياً أو شهرياً يدخل فرعاً. */
.menu-panel .submenu { position: relative; }
.menu-panel .submenu > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 8px; min-height: 42px; font-size: .95em; white-space: nowrap;
  color: var(--text); user-select: none;
}
.menu-panel .submenu > summary::-webkit-details-marker,
.menu-panel .submenu > summary::marker { display: none; content: ''; }
.menu-panel .submenu > summary:hover,
.menu-panel .submenu[open] > summary { background: var(--copper-soft); }
/* السهم يظهر بالمرور على الحاسوب، ويبقى ظاهراً على اللمس — لا «مرور» هناك */
.sub-arrow { margin-inline-start: auto; opacity: .35; font-size: 1.1em; line-height: 1;
  transition: opacity .12s, transform .12s; }
.menu-panel .submenu > summary:hover .sub-arrow,
.menu-panel .submenu[open] > summary .sub-arrow { opacity: 1; }
.menu-panel .submenu[open] > summary .sub-arrow { transform: translateX(3px); }

/* تخرج يساراً بمحاذاة بندها — inline-end في RTL هو اليسار */
.submenu-panel { position: absolute; top: -6px; inset-inline-end: calc(100% + 4px);
  z-index: 210; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.22); padding: 8px; min-width: 230px;
  display: flex; flex-direction: column; gap: 2px; animation: menuIn .12s ease-out; }
/* عند ضيق الحافة تنقلب يميناً بدل أن تخرج خارج الشاشة */
.submenu-panel.flip { inset-inline-end: auto; inset-inline-start: calc(100% + 4px); }
.submenu-panel a { display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 8px; text-decoration: none; color: var(--text);
  min-height: 40px; font-size: .93em; white-space: nowrap; }
.submenu-panel a:hover { background: var(--copper-soft); }

@media (max-width: 760px) {
  /* على الجوال تنسدل تحت بندها بدل الخروج جانباً — لا مساحة عرضية */
  .submenu-panel { position: static; box-shadow: none; border: 0; border-inline-start: 2px solid var(--copper);
    border-radius: 0; margin: 2px 14px 4px 0; padding: 2px 0; min-width: 0; }
  .menu-panel .submenu[open] > summary .sub-arrow { transform: rotate(-90deg); }
}

/* ═══ باسم من الحجز؟ ═══ (قرار أحمد 2026-08-14)
   سؤالٌ يتقدّم اسم النزيل: الحاجز غير النزيل واقعٌ يومي، وحقلُه كان مدفوناً
   أسفل النموذج فيُكتب اسم المتصل في خانة النزيل ويُولد له سجلٌّ لن ينام. */
.who-books { border: 1px solid var(--line, #dfe4e8); border-radius: 10px;
  padding: 8px 12px 10px; margin: 0 0 10px; background: var(--soft, #fafbfc); }
.who-books legend { padding: 0 6px; font-size: .85em; }
.chk-inline { display: inline-flex; align-items: center; gap: 5px; margin-inline-end: 14px; }
.wb-caller { margin-top: 6px; }

/* ═══ الصفّ المحفوظ يُومض ═══ (بلاغ أحمد 2026-08-14)
   الرسالة الخضراء تُكتب أعلى صفحةٍ طويلة، ومن يقف في أسفلها لا يراها —
   فيسأل «هل حُفظ؟». فالتأكيد يقع عند الصفّ نفسه. */
tr.row-saved > td { background: #eafaf1 !important; }
tr.row-saved { animation: rowsave 2.4s ease-out 1; }
@keyframes rowsave {
  0%   { background: #b8ecd0; }
  60%  { background: #eafaf1; }
  100% { background: transparent; }
}
.row-form { display: none; }

/* ═══ كل نوافذ .book-dlg تمرّر، لا لوحة الحجز وحدها ═══
   (بلاغ أحمد 2026-08-14 — مرّتين، وقصّرتُ في الأولى)
   قواعد التمرير كُتبت لـ`#dlg-body` وهو جسم لوحة الحجز وحدها. وسبعُ نوافذ
   أخرى تحمل `.book-dlg` وجسمها `<form>` لا `#dlg-body`:
     • `overflow: hidden` على النافذة + `max-height: 88vh` ⇒ ما تجاوز الحدّ
       **يُقصّ ولا يُمرَّر** — فزرّ «💾 حفظ» موجودٌ ولا يُرى ولا يُضغط.
     • و`.form { max-width: 480px }` تبقى سارية داخل نافذةٍ عرضها 900 —
       فتنكمش الحقول في نصفها ويبقى النصف الآخر بياضاً.
   فالقاعدة تُعمَّم على أي جسمٍ مباشر داخل النافذة. */
.book-dlg > form,
.book-dlg > .dlg-body,
.book-dlg > div:not(.dlg-head) {
  flex: 1 1 auto; overflow-y: auto; min-height: 0;
}
/* النموذج داخل نافذة يملأ عرضها — حدّ 480 للصفحات لا للنوافذ */
.book-dlg .form { max-width: 100%; border: none; background: transparent; }
/* الحقول المزدوجة جنباً إلى جنب ما دام العرض يسمح — لا سطراً لكل حقل */
.book-dlg .form-inline { flex-wrap: wrap; padding: 0; gap: 10px; align-items: flex-end; }
.book-dlg .form-inline > span { flex: 1 1 220px; min-width: 200px; }
/* وأزرار الحفظ تلتصق بأسفل النافذة: مرئيةٌ دائماً مهما طال النموذج */
.book-dlg .session-actions {
  position: sticky; bottom: 0; z-index: 2;
  background: #fff; border-top: 1px solid var(--border, #e6eaee);
  margin: 12px -16px -14px; padding: 10px 16px;
  display: flex; gap: 10px; flex-wrap: wrap;
}

/* شريط التزام التسليم — أمام العين في كل شاشة حتى يُؤدّى */
.duty-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-inline-start: 5px solid var(--danger, #b03a2e); }
.hv-read { max-height: none; }
.hv-item { display: block; padding: 8px 0; border-bottom: 1px dashed var(--border, #e6eaee); }

/* ═══ الجرس يُقرأ ═══ (بلاغ أحمد 2026-08-15)
   اثنا عشر سطراً متشابهاً بأرقام هواتف متداخلة = جدارٌ لا يُقرأ. فالأسطر
   تُفصل بخطٍّ، ولا يلتصق سطرٌ بسطر، والأرقام لا تنكسر في منتصفها. */
.bell-panel a { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line, #eef1f4);
  overflow-wrap: anywhere; }
.bell-panel a:last-child { border-bottom: none; }
.bell-panel a:hover { background: var(--soft, #f6f8fa); }

/* ═══ طلباتُ النزلاء ═══ (جلسةُ أحمد 2026-08-25)
   قائمةٌ مرقّمة تُقرأ بالإبهام على تابلت الإشراف: رقمُ النداء أوّلاً،
   ثم الغرفةُ والمطلوب، والزرُّ في آخر السطر.
   والصنفُ يُعرَّف هنا لا في القالب — درسُ `.filters`: صنفٌ بلا قاعدةٍ في
   التصميم يبدو صحيحاً في الشيفرة ومكسوراً على الشاشة. */
.greq-list { display: flex; flex-direction: column; gap: 8px; }
.greq { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 10px;
  border-inline-start: 5px solid var(--border); }
.gq-open { border-inline-start-color: var(--warn, #e0b34a); background: #fdf6e0; }
.gq-ack { border-inline-start-color: var(--primary); }
.gq-done { opacity: .72; }
.gq-cancelled { opacity: .6; text-decoration-color: var(--danger); }
/* ما تجاوز مهلته يُرى قبل أن يُقرأ — والنزيلُ ينتظر */
.gq-late { border-inline-start-color: var(--danger); background: #fdedec; }
.gq-n { flex: 0 0 auto; min-width: 2rem; height: 2rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--border); font-weight: 700; }
.gq-open .gq-n { background: var(--warn, #e0b34a); color: #fff; }
.gq-late .gq-n { background: var(--danger); color: #fff; }
.gq-body { flex: 1 1 auto; min-width: 0; }
.gq-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.gq-what { font-weight: 700; color: var(--primary); }
.gq-st { margin-inline-start: auto; font-size: .85em; }
.gq-meta { font-size: .82em; margin-top: 2px; }
.gq-act { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.gq-act form { margin: 0; }
.gq-box { background: var(--card, #fff); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin: 12px 0; }
.gq-track { list-style: none; padding: 0; margin: 10px 0; display: flex;
  flex-direction: column; gap: 4px; font-size: .9em; }
.gq-notes { list-style: none; padding: 0; margin: 8px 0; display: flex;
  flex-direction: column; gap: 6px; }
.gq-notes li { background: var(--card, #fff); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: .9em; }
@media (max-width: 720px) {
  .greq { flex-wrap: wrap; }
  .gq-act { width: 100%; justify-content: flex-end; }
  .gq-st { margin-inline-start: 0; }
}

/* ═══ عمودُ طلبات النزلاء ملتصقاً بالخريطة ═══ (قرار أحمد 2026-08-25)
   «على شمال شاشة خريطة الغرف… يصغّرها للأسفل ويكبّرها لتصبح عمودية».
   ويدفعُ الخريطةَ ولا يطفو فوقها: الطافي يُخفي غرفاً — وقد غطّى في صورة
   أحمد ثلاثةَ طوابق. والتخطيطُ صار صفّاً، فأوّلُ ابنٍ يميناً (الخريطة)
   وثانيه شمالاً (هذا) بلا قلبٍ في الأنماط. */
.map-layout { display: flex; align-items: flex-start; gap: 12px; }
.map-layout > .map-main { flex: 1 1 auto; min-width: 0; }

/* ⚠️ ═══ الخامسةُ من نوعها ═══ (بلاغُ أحمد 2026-08-26: «ما بينزل»)
   `display:flex` من أنماطنا يغلب `[hidden]` من أنماط المتصفّح — فكان زرُّ
   الطيّ يعمل، ويُظهر الشريطَ السفلي، **ولا يختفي العمود**. فيظهران معاً
   ولا شيء «ينزل».
   وهذا المستودعُ يحذّر من الفخّ في أربعة مواضع: شارةُ الجرس، وفلترُ
   الخريطة، وفلترُ اللوحة، وقائمةُ الاقتراحات — وكُتب في اثنين منها «ثالثةٌ
   من نوعها». وقعتُ فيه رغم ذلك، فليكن الحارسُ ملتصقاً بالقاعدة نفسِها. */
.greq-dock { flex: 0 0 272px; width: 272px; align-self: stretch;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card, #fff); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; max-height: calc(100vh - 150px); }
.gd-head { display: flex; align-items: center; gap: 6px; }
.gd-head b { flex: 1 1 auto; font-size: .95em; }
.gd-toggle { border: 1px solid var(--border); background: transparent; color: inherit;
  border-radius: 7px; width: 26px; height: 26px; cursor: pointer; line-height: 1; }
.gd-toggle:hover { background: var(--border); }
.gd-count { font-size: .82em; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  background: var(--border); }
.gd-count.is-hot { background: var(--warn, #e0b34a); color: #fff; }

.gd-new { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 5px; align-items: center; }
.gd-new select, .gd-new input { width: 100%; min-width: 0; padding: .34rem .4rem; font-size: .82em; }
.gd-new .gd-qty { width: 3.1rem; }
.gd-new #gd-other { grid-column: 1 / -1; }
.gd-new .btn { padding: .34rem .55rem; }

.gd-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border); padding-top: 8px; }
.gd-empty { font-size: .85em; text-align: center; padding: 10px 0; }
.gd-row { border: 1px solid var(--border); border-inline-start: 4px solid var(--border);
  border-radius: 8px; padding: 6px 8px; font-size: .84em; }
.gd-row.gq-open { border-inline-start-color: var(--warn, #e0b34a); background: #fdf6e0; }
.gd-row.gq-ack { border-inline-start-color: var(--primary); }
.gd-row.gq-late { border-inline-start-color: var(--danger); background: #fdedec; }
.gd-r1 { display: flex; gap: 5px; align-items: baseline; }
.gd-r2 { font-size: .88em; margin-top: 1px; }
.gd-act { margin-top: 5px; }
.gd-act form { margin: 0; }
.gd-act .btn { width: 100%; padding: .3rem; }
.gd-all { display: block; text-align: center; font-size: .82em; padding-top: 4px;
  border-top: 1px solid var(--border); }

/* ═══ المصغَّرة ═══ شريطٌ رفيعٌ أسفلَ الشاشة يحمل العددَ وحدَه: يُعرف أن
   هناك شيئاً بلا أن يأخذ العمودُ مكاناً من الخريطة.

   ═══ و`left` صراحةً لا `inset-inline-start` ═══ (بلاغُ أحمد المصوَّر)
   المنطقيةُ تنقلب مع اتجاه الصفحة، وصفحاتُنا من اليمين لليسار — فوضعتْ
   الشريطَ **يميناً** وهو مطلوبٌ شمالاً. والمصغَّرةُ هي المكبَّرةُ نفسُها
   وقد انكمشت، فلتنكمشْ في مكانها: العمودُ شمالاً فالشريطُ شمالاً.
   وهذا موضعٌ فيزيائيٌّ لا منطقيّ — فيُكتب فيزيائياً ولا ينقلب بظهر الغيب. */
.gd-bar { position: fixed; inset-block-end: 34px; left: 14px; right: auto; z-index: 40;
  border: 1px solid var(--border); background: var(--card, #fff); color: inherit;
  border-radius: 20px; padding: .38rem 1rem; font-size: .85em; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.14); }
.gd-bar:hover { filter: brightness(.96); }
.gd-bar.is-hot { background: var(--warn, #e0b34a); color: #fff; border-color: transparent; }
.gd-up { opacity: .7; }

/* ═══ ومتى يترك مكانَه شمالاً؟ ═══ (بلاغُ أحمد المصوَّر 2026-08-26)
   كان الحدُّ 1100 بكسل — فمن شاشتُه دونَها رأى العمودَ **تحت الخريطة**
   لا على شمالها، وسطرُه يبدأ من اليمين كأنّه ذهب يميناً. وليست العلّةُ في
   يمينٍ ويسار: العمودُ نزل أصلاً.

   والحدُّ نُقل إلى 900: بينهما (900—1280) يضيق العمودُ إلى 232 ولا ينزل —
   ففي 1080 بكسل تبقى للخريطة ثمانُمئةٍ وأربعون، وهي تكفيها.
   ودونَ 900 ينزل حقّاً: تلك شاشةُ جوالٍ لا تحتمل عمودين. */
@media (max-width: 1280px) {
  .greq-dock { flex-basis: 232px; width: 232px; }
  .gd-new { grid-template-columns: 1fr 1fr auto; }
  .gd-new .btn { grid-column: 3; }
}
@media (max-width: 900px) {
  .map-layout { flex-direction: column; }
  .greq-dock { flex: 1 1 auto; width: 100%; max-height: none; }
  /* ونزولُه يجعل الشريطَ المصغَّر بلا معنى — العمودُ نفسُه صار سطراً */
  .gd-bar { inset-block-end: 12px; }
}

/* ═══ صندوقُ الردّ على طلبات النزلاء ═══ (قرار أحمد 2026-08-25)
   يرث شكلَ `.hk-col` — صندوقٌ ثالثٌ في عمودٍ قائمٍ لا عمودٌ رابع. */
.greq-hk .hk-col-head { background: var(--copper, #8a6a3b); }
.greq-hk.has-open .hk-col-head { background: var(--warn, #e0b34a); color: #111; }
.ghk-tools { display: flex; align-items: center; gap: 5px; }
.ghk-btn { border: 0; background: rgba(255,255,255,.18); color: inherit; cursor: pointer;
  border-radius: 7px; width: 24px; height: 24px; line-height: 1; font-size: .95em; }
.ghk-btn:hover { background: rgba(255,255,255,.32); }
.greq-hk.is-folded .hk-col-body { display: none; }
.greq-hk .hk-col-n.is-hot { background: var(--danger); color: #fff; }
.ghk-task .hk-task-act .btn { width: 100%; }
/* وشاشةُ العامل تابلتٌ في ممرّ — الصندوقُ فيها بعرض الصفحة لا عمودٌ جانبي */
.greq-hk-wrap { margin: 0 0 16px; }
.greq-hk-wrap .greq-hk { max-width: 560px; }
.greq-hk-wrap .hk-col-body { max-height: 46vh; }

/* رابطُ الحساب الكامل في شريط تبويبات اللوحة — تبويبٌ في شكله، رابطٌ في عمله */
.pn-tab-link { text-decoration: none; margin-inline-start: auto; opacity: .85; }
.pn-tab-link:hover { opacity: 1; }

/* ═══ روابطُ المستندات في الكشوف ═══ (قرار أحمد 2026-08-31)
   رقمُ السند يفتح سندَه. وعلى الشاشة رابطٌ يُرى، **وفي الطباعة نصٌّ عاديّ**:
   كشفُ العهدة ورقةٌ تُوقَّع، ولونٌ وخطٌّ تحته يشوّشانها بلا فائدة — فالورقةُ
   المطبوعةُ تبقى كما كانت حرفاً بحرف. */
.doc-link { text-decoration: none; border-bottom: 1px dotted currentColor; }
.doc-link:hover { border-bottom-style: solid; }
@media print {
  .doc-link { color: inherit !important; border-bottom: 0 !important; text-decoration: none !important; }
}

/* عنوانُ عمودٍ يُرتِّب — رابطٌ بلون العنوان لا بلون الروابط، والسهمُ يقول الاتجاه */
.sort-th { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-th:hover { text-decoration: underline; }
.sort-ar { opacity: .8; font-size: .9em; }
@media print { .sort-th { text-decoration: none !important; } .sort-ar { display: none; } }

/* ═══ نصُّ رسالة المورّد ═══ (بلاغُ أحمد 2026-08-31: «اريد تغيير نوع الخط»)
   كان <pre> — خطٌّ أحاديُّ العرض. ممتازٌ للإنجليزية، رديءٌ للعربية:
   الحروفُ تتباعد ويتشوّه اتّصالها. والأسطرُ تبقى كما هي بـpre-wrap. */
.msg-text { font: inherit; white-space: pre-wrap; line-height: 1.85; margin: 0; }
.msg-edit { margin: 10px 0 4px; }
.msg-edit > summary { cursor: pointer; color: var(--muted, #667); font-size: .92rem; }
.msg-area { width: 100%; font: inherit; line-height: 1.9; padding: 8px 10px; }

/* ═══ شريطُ المجموعة ═══ (قرار أحمد 2026-09-01)
   بديلُ شريط الذمّة على غرفةٍ حسابُها على مجموعة: يقول أين المال، ولا
   يوهم أنّ النزيلَ مدين. ولونٌ محايدٌ لا أحمر — فليست ذمّةً عليه. */
.grp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--panel, #eef4ff); border: 1px solid var(--line, #cbd7ee);
  border-radius: 10px; padding: 9px 13px; margin: 8px 0; font-size: .95rem; }
.grp-tag { font-weight: 700; }
.grp-no { font-weight: 700; text-decoration: none; }
.grp-sep { opacity: .45; }

/* ═══ وسمُ الذمّة على خريطة الغرف ═══ (قرار أحمد 2026-09-01)
   «وضع علامة معينه بلون على الغرف التي دخلت بذمه» — لينتبه الاستقبالُ قبل
   أن يغادر النزيل. وهي وسمٌ على البطاقة لا لونٌ للغرفة: لونُ الغرفة يقول
   حالةَ الإشغال، وخلطُ المعنيين يُفقد اللونَ دلالتَه. */
.room-owes { position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
  background: var(--danger, #c0392b); color: #fff; border-radius: 7px;
  padding: 0 5px; font-size: .68rem; font-weight: 700; line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); }
/* ═══ وسمُ الذمّة ذهبيٌّ لا أحمر ═══ (بلاغ أحمد 2026-09-01)
   بطاقةُ الغرفة المشغولة حمراء، ووسمٌ أحمرُ عليها لا يُرى — وهو ما وقع:
   الوسمُ كان على غرفة 309 ولم يُميَّز. فالذهبيُّ يقطع الأحمرَ بحدٍّ داكن. */
.rcard-owes { background: #ffd23f; color: #4a2c00; font-weight: 800;
  border: 1px solid #8a6100; box-shadow: 0 1px 4px rgba(0,0,0,.35); letter-spacing: .2px; }
.sst-owing { background: #ffd23f; color: #4a2c00; border: 1px solid #8a6100; cursor: default; }
/* وسمُ المجموعة: أزرقُ هادئٌ حين تكون مسدَّدة، وبرتقاليٌّ حين عليها ذمّة —
   ولا يُخلط بالذهبيّ الذي يعني «على هذه الغرفة». (أحمد 2026-09-01) */
.rcard-grp { background: #dbeafe; color: #1e3a8a; border: 1px solid #1e40af; font-weight: 700; }
.rcard-gowes { background: #fb923c; color: #3b1a00; border: 1px solid #7c2d12; font-weight: 800;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sst-gowing { background: #fb923c; color: #3b1a00; border: 1px solid #7c2d12; cursor: default; }
/* رقمُ سجلّ النزيل — عمودٌ ضيّقٌ باهت، يُقرأ ولا يزحم (أحمد 2026-09-04) */
.gid { width: 52px; font-size: .82rem; opacity: .7; user-select: all; }

/* ═══ البطاقةُ المفلترة تقول إنها مفعَّلة ═══ (2026-09-04)
   بطاقاتُ الأعمار صارت روابطَ تفلتر بنقرة — وبلا علامةٍ على المفعَّلة يظنّ
   القارئُ أنه يرى الكلَّ وهو يرى شريحةً. والصنفُ يُعرَّف هنا لا في القالب. */
.card-on { outline: 2px solid var(--primary, #2f6f62); outline-offset: -2px; }
.card-on .num { text-decoration: underline; text-underline-offset: .18em; }

/* ═══ سجلُّ الغرفة بجانب بيانات النزيل ═══ (أمرُ أحمد 2026-09-27)
   «بدّي أستغلّ هاي المساحة» — المساحةُ البيضاءُ يسارَ الجدول صارت سجلّاً.
   والعمودان ينهاران إلى واحدٍ على الشاشة الضيّقة فلا يُقصّ شيء. */
.pn-guest-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .pn-guest-grid { grid-template-columns: 1fr; } }
.room-log { border: 1px solid var(--line, #e2e2e2); border-radius: 10px; padding: 8px 10px; background: var(--card, #fff); }
.room-log-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.room-log-tbl { width: 100%; }
.room-log-tbl td { padding: 4px 6px; font-size: .86em; border-bottom: 1px solid var(--line, #eee); }
.room-log-tbl tr.row-here td { background: var(--hi, #fff7e0); }
.room-log-tbl .nowrap { white-space: nowrap; }
.room-log-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.room-log-nav button[disabled] { opacity: .4; cursor: default; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--link, #0a58ca); cursor: pointer; text-align: start; }
.linkish:hover { text-decoration: underline; }

/* ═══ الدفعاتُ السابقة على سند القبض ═══ (أمرُ أحمد 2026-09-27) */
.rcpt-prev-head { margin: 10px 0 4px; font-size: .95em; }
.rcpt-prev th, .rcpt-prev td { padding: 3px 6px; font-size: .88em; }
.rcpt-prev tr:first-child th { background: var(--soft, #f4f4f4); }
.rcpt-sum { margin-top: 8px; border-top: 2px solid var(--line, #333); }
.rcpt-sum th { width: 55%; }

/* اسمُ اليوم بجانب تاريخه (أمرُ أحمد 2026-09-28) */
.dow-chip { background: var(--soft, #eef2f5); border-radius: 6px; padding: 4px 10px; }

/* ═══ ☰ شريطُ القوائم على الجوّال ═══ (أمرُ أحمد 2026-10-08)
   سطرٌ رفيعٌ ثابت: الاسمُ و☰ والأجراس. والقوائمُ مطويّةٌ حتى يُكبس ☰ فتنسدل
   تحت بعضها بعرض الشاشة، وكلُّ قائمةٍ تُفتح في مكانها لا عائمة. والحاسوبُ كما هو. */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .topbar { padding: 6px 10px; gap: 6px; align-items: center; }
  .topbar .brand { flex: 1; min-width: 0; font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .brand-logo { height: 30px; width: auto; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 4px; order: 2; min-height: 40px; padding: 6px 12px;
    background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px;
    font-weight: 700; font-size: .95em; cursor: pointer; }
  .topbar .menu-bell, .topbar .bell-mute { order: 1; }
  .topbar #topnav, .topbar .menu-user { display: none; }
  /* ⚠️ قاعدةُ app.css «.topbar nav { flex: 1; flex-wrap: wrap }» كانت تجعل القوائمَ تقاسم الاسمَ سطرَه
     بعرضٍ صفريّ، فتنقسم أعمدةً تخرج من الشاشة ويهبط سطرُ الفندق إلى وسطها (صورةُ أحمد 2026-10-08).
     فالقائمةُ المفتوحة سطرٌ كاملٌ لحالها، عمودٌ واحدٌ لا يلتفّ. */
  html.nav-open .topbar { align-items: center; }
  html.nav-open .topbar #topnav { flex: 0 0 100%; flex-wrap: nowrap; min-width: 0; }
  html.nav-open .topbar .menu-user { flex: 0 0 100%; }
  html.nav-open .topbar #topnav .menu { width: 100%; }
  html.nav-open .topbar #topnav { display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    order: 10; width: 100%; max-height: calc(100vh - 120px); overflow-y: auto; padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,.18); }
  html.nav-open .topbar .menu-user { display: block; order: 11; width: 100%; }
  html.nav-open .topbar #topnav .menutop,
  html.nav-open .topbar #topnav .menu > summary,
  html.nav-open .topbar .menu-user > summary { width: 100%; justify-content: flex-start; }
  /* القائمةُ المنسدلة تُفتح في مكانها داخل العمود — لا لوحةً عائمة */
  html.nav-open .topbar #topnav .menu-panel,
  html.nav-open .topbar .menu-user .menu-panel { position: static; width: auto; max-width: none; max-height: none;
    box-shadow: none; margin: 2px 0 6px; }
}

/* ═══ قوائم الجرس على الجوال ═══ (بلاغ أحمد 2026-11-30، 2.6.42 — آيفون)
   كانت تُعلَّق بالجرس فتخرج من يمين الشاشة وتتراكب سطورها. على الجوال: بعرض الشاشة تحت الشريط،
   ومكانها العمودي يضبطه سطرٌ في head.ejs (--bell-top). */
@media (max-width: 640px) {
  .menu-bell .bell-panel, html.rh .menu-bell .bell-panel {
    position: fixed; top: var(--bell-top, 76px); left: 8px; right: 8px; inset-inline: 8px;
    min-width: 0; width: auto; max-width: none; max-height: calc(100dvh - var(--bell-top, 76px) - 16px);
    overflow-y: auto; overscroll-behavior: contain; border-radius: 12px; border-top: 1px solid var(--line, #e2e7e5); }
  .menu-bell .bell-panel a, html.rh .menu-bell .bell-panel a { display: block; white-space: normal; height: auto; min-height: 0;
    line-height: 1.55; overflow-wrap: anywhere; }
}
