/* ================= HotelSync — نظام التصميم ================= */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1c2333;
  --ink-2: #3b4357;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #ebe6dc;
  --line-2: #f3efe6;

  /* كحلي (الأزرار والعناصر الأساسية) + ذهبي (الهوية واللمسات) */
  --brand: #1c2a4a;
  --brand-600: #2a3c63;
  --brand-700: #121b31;
  --brand-50: #eef1f7;
  --brand-100: #dbe2ef;
  --brand-ring: rgba(42, 60, 99, .18);
  --gold: #c9a24d;
  --gold-600: #a67c2e;
  --gold-50: #faf3e2;
  --accent: #a67c2e;
  --accent-50: #f7efdc;

  --side-bg: #141b2d;
  --side-ink: #c3cad9;
  --side-faint: #7c86a0;
  --side-line: rgba(255, 255, 255, .07);

  --ok: #2f7d4f;   --ok-50: #e9f5ee;
  --warn: #b45309; --warn-50: #fdf6e6;
  --bad: #b42318;  --bad-50: #fdecea;
  --info: #2563eb; --info-50: #eff6ff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(28, 35, 51, .04);
  --shadow: 0 1px 2px rgba(28, 35, 51, .04), 0 3px 10px rgba(28, 35, 51, .05);
  --shadow-lg: 0 14px 44px rgba(20, 27, 45, .18), 0 2px 8px rgba(20, 27, 45, .06);
  --font: "Almarai", "Segoe UI", Tahoma, sans-serif;
  --side-w: 256px;
  --top-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 14.5px/1.65 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%;
  font-feature-settings: "tnum" 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
::selection { background: var(--brand-100); }
.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.hidden { display: none !important; }
.mb { margin-bottom: 16px; }
.mb-s { margin-bottom: 8px; }
.start { text-align: start; }
.end { text-align: end; }
.center { text-align: center; }
.nowrap { flex-wrap: nowrap; white-space: nowrap; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--muted); font-size: 13px; }

/* ================= الهيكل ================= */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

/* ---- القائمة الجانبية ---- */
.scrim { display: none; position: fixed; inset: 0; background: rgba(20, 27, 45, .4); z-index: 44; backdrop-filter: blur(2px); }
.side {
  background: var(--side-bg); color: var(--side-ink); border-inline-end: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 12px 12px;
}
.side-head { height: var(--top-h); display: flex; align-items: center; padding: 0 8px; flex: none; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo:hover { color: var(--ink); }
.logo.dark { color: var(--ink); }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none; color: #1c2333;
  background: linear-gradient(135deg, #e9c46a, #b8892f); display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(166, 124, 46, .35);
}
.side .logo { color: #fff; }
.logo-mark .i { width: 17px; height: 17px; stroke-width: 2.2; }
.side-hotel {
  display: flex; align-items: center; gap: 10px; padding: 10px; margin: 4px 0 14px;
  border: 1px solid var(--side-line); border-radius: var(--r); background: rgba(255, 255, 255, .04); color: #fff;
}
.side-hotel .h-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(201, 162, 77, .16); color: var(--gold); display: grid; place-items: center; flex: none; }
.side-hotel b { display: block; font-size: 13.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-hotel small { color: var(--side-faint); font-size: 11.5px; }
.side-hotel > div { min-width: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 9px;
  color: var(--side-ink); font-size: 14px; transition: background .12s, color .12s; position: relative;
}
.nav-btn .i { color: var(--side-faint); transition: color .12s; }
.nav-btn:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-btn:hover .i { color: var(--side-ink); }
.nav-btn.active { background: rgba(201, 162, 77, .14); color: #f1d38a; font-weight: 700; }
.nav-btn.active .i { color: var(--gold); }
.nav-btn.active::before { content: ""; position: absolute; inset-block: 8px; inset-inline-start: -12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
[dir="rtl"] .nav-btn.active::before { border-radius: 3px 0 0 3px; }
.nav-sep { font-size: 11px; font-weight: 700; color: var(--side-faint); padding: 16px 11px 6px; letter-spacing: .04em; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--side-line); }
.side-foot .nav-btn { font-size: 13.5px; }

/* ---- الشريط العلوي ---- */
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 28px;
  background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.topbar .grow { flex: 1; }
.search { position: relative; width: min(380px, 100%); }
.search .i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.search input { width: 100%; padding: 8px 14px; padding-inline-start: 38px; border-radius: 10px; background: var(--line-2); border-color: transparent; }
.search input:focus { background: #fff; }
.search kbd { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 10px; font: 500 11px var(--font); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; background: #fff; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.menu-btn { display: none; }
.live {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 400; color: var(--muted);
  padding: 5px 11px; border-radius: 20px; background: var(--line-2); white-space: nowrap;
}
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live.on { color: var(--ok); background: var(--ok-50); }
.live.on::before { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, .08); } }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 11px; cursor: pointer; font-size: 13px; font-weight: 400; color: var(--ink-2);
}
.lang-btn:hover { background: var(--line-2); }
.avatar-wrap { position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 700; font-size: 14px;
  background: var(--gold-50); color: var(--gold-600); display: grid; place-items: center; box-shadow: inset 0 0 0 1px #ecdcb4;
}
.menu-pop {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 230px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-pop .who { padding: 9px 11px 11px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop .who b { display: block; font-size: 14px; }
.menu-pop .who small { color: var(--muted); }
.menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 11px; border: 0; background: none;
  border-radius: 8px; cursor: pointer; text-align: start; font-size: 13.5px; color: var(--ink-2);
}
.menu-pop button:hover { background: var(--line-2); color: var(--ink); }
.menu-pop button.danger { color: var(--bad); }

.main { padding: 26px 28px 70px; min-width: 0; max-width: 1480px; width: 100%; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 28px; font-weight: 400; font-size: 13.5px; }
.banner:empty { display: none; }
.banner.bad { background: var(--bad); color: #fff; }
.banner.warn { background: var(--warn-50); color: var(--warn); border-bottom: 1px solid #fde68a; }
.banner.brand { background: var(--brand-50); color: var(--brand-700); border-bottom: 1px solid var(--brand-100); }
.banner a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-inline-start: auto; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 23px; font-weight: 700; margin: 0; letter-spacing: -.015em; line-height: 1.3; }
.page-head .titles { flex: 1; min-width: 180px; }
.page-head .titles .sub { margin-top: 2px; }
.page-head > h1 { flex: 1; min-width: 160px; }

/* ================= البطاقات والشبكة ================= */
.card {
  min-width: 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs); padding: 18px 20px;
}
.card h2 { font-size: 15.5px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .i { color: var(--muted); }
.card h2 .sp { flex: 1; }
.alert-card { border-color: #fecaca; background: linear-gradient(180deg, #fff7f7, #fff); margin-bottom: 16px; }
.note-card { border-color: #fde68a; background: #fffcf2; }
.grid { display: grid; gap: 16px; }
.grid.tight { gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- مؤشرات (KPI) ---- */
.kpi { padding: 18px 20px; position: relative; }
.kpi .k-ic {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--brand-50); color: var(--brand);
}
.kpi .k-ic .i { width: 20px; height: 20px; }
.kpi .k-ic.ok { background: var(--ok-50); color: var(--ok); }
.kpi .k-ic.warn { background: var(--warn-50); color: var(--warn); }
.kpi .k-ic.bad { background: var(--bad-50); color: var(--bad); }
.kpi .k-ic.info { background: var(--info-50); color: var(--info); }
.kpi .k-ic.accent { background: var(--accent-50); color: var(--accent); }
.kpi .v { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 3px; }
.kpi.click { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi.click:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-1px); }
.bar { height: 6px; background: var(--line-2); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-600)); border-radius: 6px; }

.greet { margin-bottom: 22px; }
.greet h1 { font-size: 24px; margin: 0; font-weight: 700; letter-spacing: -.015em; }
.greet .sub { font-size: 14px; }

/* ================= الأزرار والحقول ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line);
  background: #fff; padding: 8px 15px; border-radius: 10px; cursor: pointer; white-space: nowrap; color: var(--ink-2);
  font-weight: 400; font-size: 14px; line-height: 1.4; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn .i { width: 17px; height: 17px; }
.btn:hover { border-color: #d5dbe4; background: var(--surface-2); color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(20, 27, 45, .25), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn.gold { background: linear-gradient(135deg, #d4ae5c, #a67c2e); border-color: #a67c2e; color: #fff; }
.btn.gold:hover { background: #956e27; border-color: #956e27; color: #fff; }
.btn.primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-50); border-color: #fecaca; }
.btn.ghost { border-color: transparent; box-shadow: none; background: none; }
.btn.ghost:hover { background: var(--line-2); }
.btn.wa { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.btn.wa:hover { background: #dcfce7; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.sm .i { width: 15px; height: 15px; }
.btn.lg { padding: 12px 22px; font-size: 15.5px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  border: 1px solid #dde2ea; border-radius: 10px; padding: 9px 12px; background: #fff; min-width: 0; color: var(--ink);
  font-size: 14px; transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #cbd3de; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-ring); }
select {
  appearance: none; -webkit-appearance: none; padding-inline-end: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat;
  background-position: left 11px center;
}
[dir="ltr"] select { background-position: right 11px center; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--brand); flex: none; padding: 0; }
input:disabled { background: var(--line-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
.form-grid.three { grid-template-columns: 1fr 1fr 120px; }
.form-grid .full { grid-column: 1 / -1; }
.sec { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.sec .i { color: var(--brand); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label.row { gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13.5px; background: #fff; }
.checks label.row:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); }

/* ================= الجداول ================= */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th {
  text-align: start; font-weight: 400; color: var(--muted); font-size: 12.5px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; transition: background .1s; }
.t tr.click:hover td { background: #fbf9f4; }
.t tr.warn-row td { background: #fffdf5; }
.t td b { font-weight: 700; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-xs); }
.card .table-wrap { border-radius: var(--r); box-shadow: none; }
.card > table.t { margin: -4px 0; }
.empty { color: var(--muted); text-align: center; padding: 30px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; }
.empty-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; color: var(--faint); }
.empty-ic .i { width: 22px; height: 22px; }
.guest-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ini {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--line-2); color: var(--ink-2);
}

/* ================= الشارات ================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 400; padding: 3px 10px;
  border-radius: 20px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; vertical-align: middle; line-height: 1.5;
}
.badge.big { font-size: 13px; padding: 5px 12px; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.bad { background: var(--bad-50); color: var(--bad); }
.badge.brand { background: var(--brand-50); color: var(--brand-700); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ch { font-weight: 700; }
.ch-booking { background: #e8f0fe; color: #003b95; }
.ch-expedia { background: #fef6dc; color: #7a5a00; }
.ch-airbnb { background: #ffecef; color: #d6204e; }
.ch-almosafer { background: #e9f8f1; color: #08704a; }
.ch-gathern { background: #f1ecfd; color: #5b34b1; }
.ch-reception { background: var(--line-2); color: var(--ink-2); }
.ch-direct { background: var(--brand-50); color: var(--brand-700); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 400; transition: all .12s;
}
.chip b { font-weight: 700; color: var(--muted); }
.chip:hover { border-color: #cbd3de; color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on b { color: #cbd5e1; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--line-2); gap: 2px; }
.seg a { padding: 6px 15px; color: var(--ink-2); border-radius: 8px; font-weight: 400; font-size: 13.5px; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ================= حساب الضيف ================= */
.folio { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.frow { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.frow span { color: var(--ink-2); }
.frow.big { border-top: 1px dashed #d5dbe4; margin-top: 6px; padding-top: 11px; font-size: 17px; }
.frow.big span { color: var(--ink); font-weight: 700; }

/* ================= التقويم ================= */
.cal { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
.cal th, .cal td { border-bottom: 1px solid var(--line-2); border-inline-start: 1px solid var(--line-2); text-align: center; padding: 0; }
.cal thead th { background: var(--surface-2); position: sticky; top: 0; z-index: 2; padding: 8px 2px; font-weight: 700; min-width: 66px; border-bottom: 1px solid var(--line); }
.cal thead th.wk { background: #fbf6ec; }
.cal thead th.today { color: var(--brand-700); }
.cal thead th.today::after { content: ""; display: block; height: 3px; width: 26px; margin: 4px auto 0; border-radius: 3px; background: var(--gold); }
.cal thead th .dn { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.cal .rt { text-align: start; padding: 10px 14px; position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 170px; font-weight: 700; border-inline-start: 0; }
.cal thead .rt { z-index: 3; background: var(--surface-2); }
.cal .rt small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.cal tr.cat td { background: var(--surface-2); text-align: start; padding: 7px 14px; font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.cal td { padding: 3px; }
.cell {
  display: block; width: 100%; border: 0; background: none; padding: 7px 2px; cursor: pointer; line-height: 1.3;
  position: relative; border-radius: 8px; transition: transform .1s, box-shadow .1s;
}
.cell:hover { box-shadow: 0 0 0 2px var(--brand-600); z-index: 1; }
.cell .a { display: block; font-size: 15px; font-weight: 700; }
.cell .p { display: block; font-size: 11px; color: var(--muted); }
.cell .ms { position: absolute; top: 3px; inset-inline-end: 5px; font-size: 9.5px; color: var(--warn); font-weight: 700; }
.cell.good { background: #f0faf6; }
.cell.good .a { color: var(--ok); }
.cell.low { background: var(--warn-50); }
.cell.low .a { color: var(--warn); }
.cell.full { background: var(--bad-50); }
.cell.full .a { color: var(--bad); }
.cell.stop { background: repeating-linear-gradient(-45deg, #fde8e8, #fde8e8 5px, #fff 5px, #fff 10px); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; }
.legend .lg-good::before { background: #d1fae5; }
.legend .lg-low::before { background: #fde68a; }
.legend .lg-full::before { background: #fecaca; }
.legend .lg-stop::before { background: repeating-linear-gradient(-45deg, #fecaca, #fecaca 3px, #fff 3px, #fff 6px); border: 1px solid #fecaca; }
.legend .lg-rev::before { background: #d9c18a; }
.legend .lg-occ::before { background: var(--brand); border-radius: 50%; }

/* ================= الرسم البياني ================= */
.chart-wrap { overflow-x: auto; direction: ltr; }
.chart { display: block; }
.bar-rev { fill: #d9c18a; }
.bar-rev:hover { fill: var(--brand-600); }
.line-occ { fill: none; stroke: var(--brand); stroke-width: 2; }
.dot-occ { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.ax { font: 9.5px var(--font); fill: var(--faint); text-anchor: middle; }

/* ================= النظافة ================= */
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.hk {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: start; position: relative;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 12px 13px 12px; cursor: pointer;
  min-height: 104px; transition: box-shadow .15s, transform .15s; overflow: hidden;
}
.hk::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--line); }
.hk:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.hk b { font-size: 20px; line-height: 1.15; font-weight: 700; }
.hk span { font-size: 12px; }
.hk-t { color: var(--muted); }
.hk-s { font-weight: 700; margin-top: 2px; }
.hk-clean::before { background: #10b981; } .hk-clean .hk-s { color: var(--ok); }
.hk-inspected::before { background: var(--brand-600); } .hk-inspected .hk-s { color: var(--brand-700); }
.hk-dirty { background: #fffafa; } .hk-dirty::before { background: var(--bad); } .hk-dirty .hk-s { color: var(--bad); }
.hk-cleaning { background: #fffdf6; } .hk-cleaning::before { background: #f59e0b; } .hk-cleaning .hk-s { color: var(--warn); }
.hk-maint { background: var(--surface-2); opacity: .7; } .hk-maint::before { background: var(--faint); }
.hk-a { color: var(--brand-700); font-weight: 700; }
.hk-g, .hk-n { color: var(--ink-2); }
.hk-pick { padding: 16px; font-weight: 700; font-size: 14.5px; }
.hk-pick.sel { box-shadow: 0 0 0 2px var(--brand-600); border-color: var(--brand-600); }
.hk-pick.hk-dirty { color: var(--bad); } .hk-pick.hk-clean { color: var(--ok); } .hk-pick.hk-cleaning { color: var(--warn); } .hk-pick.hk-inspected { color: var(--brand-700); }
.hk-pick::before { display: none; }

/* ================= الباقات ================= */
.plan { position: relative; }
.plan.current { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 77, .2); }
.plan .price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.feat { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 7px; }
.feat li { display: flex; gap: 8px; align-items: flex-start; }
.feat li::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--gold-50)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a67c2e' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.steps { margin: 0; padding-inline-start: 20px; line-height: 2.1; color: var(--ink-2); }

/* ================= السجل ================= */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.feed-item:last-child { border-bottom: 0; }
.dir { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.dir.out { background: var(--brand-50); color: var(--brand); }
.dir.in { background: var(--ok-50); color: var(--ok); }
.dir.err { background: var(--bad-50); color: var(--bad); }
.feed-item .msg { font-size: 13.5px; overflow-wrap: anywhere; color: var(--ink-2); }
.feed-item .chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.feed-item time { font-size: 12px; color: var(--faint); white-space: nowrap; }

/* ================= النوافذ والدرج ================= */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); display: grid; place-items: center;
  z-index: 50; padding: 20px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 18px; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal.wide { width: min(880px, 100%); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal header h3 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal .body { padding: 20px 22px; }
.modal footer {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96); position: sticky; bottom: 0; z-index: 2;
}
/* الدرج الجانبي لتفاصيل الحجز */
.modal-bg.drawer-bg { place-items: stretch; justify-items: end; padding: 0; }
[dir="rtl"] .modal-bg.drawer-bg { justify-items: start; }
.modal.drawer { width: min(620px, 100%); max-height: none; height: 100vh; border-radius: 0; animation: slide .22s cubic-bezier(.2, .8, .3, 1); display: flex; flex-direction: column; }
.modal.drawer .body { flex: 1; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
[dir="rtl"] .modal.drawer { animation-name: slide-rtl; }
@keyframes slide-rtl { from { transform: translateX(-30px); opacity: 0; } }
.x { background: none; border: 0; cursor: pointer; color: var(--muted); line-height: 1; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 20px; }
.x:hover { background: var(--line-2); color: var(--ink); }
.x .i { width: 18px; height: 18px; }
.x.sm { padding: 2px; font-size: 14px; }
.x.sm .i { width: 14px; height: 14px; }
.opt {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  cursor: pointer; flex-wrap: wrap; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: #cbd3de; }
.opt.sel { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-ring); }
.opt.dis { opacity: .5; cursor: not-allowed; }
.opt .nm { flex: 1; font-weight: 700; min-width: 150px; }
.opt .pr { font-weight: 700; font-size: 15px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.secret {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 12px;
  border-radius: 10px; direction: ltr; text-align: left; user-select: all; word-break: break-all; white-space: pre-wrap; margin: 0; font-size: 12.5px;
}
.note { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.75; }
.note.warn { background: var(--warn-50); border-color: #fde68a; color: #92400e; }
.alert { display: flex; align-items: center; gap: 10px; background: var(--bad-50); color: var(--bad); border: 1px solid #fecaca; border-radius: var(--r); padding: 11px 14px; font-weight: 700; }

/* ---- التنبيهات المنبثقة ---- */
.toast-wrap { position: fixed; bottom: 22px; inset-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 70; max-width: calc(100vw - 44px); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px;
  max-width: 400px; box-shadow: var(--shadow-lg); animation: tin .22s cubic-bezier(.2, .8, .3, 1); font-size: 14px;
}
.toast .i { margin-top: 2px; }
.toast.bad { background: #b91c1c; }
.toast.ok { background: #065f46; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

/* ================= الدخول والتسجيل ================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-side {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 420px at 15% 0%, rgba(201, 162, 77, .28), transparent 60%), linear-gradient(165deg, #0e1424, #1c2a4a 75%, #26365c);
}
.auth-side .logo { color: #fff; }

.auth-side h2 { font-size: 30px; line-height: 1.35; margin: 0 0 12px; font-weight: 700; max-width: 460px; }
.auth-side p { color: rgba(255, 255, 255, .78); margin: 0; max-width: 440px; font-size: 15px; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.auth-points div { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.auth-points .i { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(201, 162, 77, .16); color: #e9c46a; }
.auth-side small { color: rgba(255, 255, 255, .6); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-form { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.015em; }
.auth-form .btn.primary { padding: 11px; font-size: 15px; }
.auth-form.wide-card { width: min(540px, 100%); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: radial-gradient(1000px 500px at 80% -10%, #f1e3bf, transparent), var(--bg); }
.login .card { width: min(420px, 100%); padding: 30px; }
.login .card.wide-card { width: min(560px, 100%); }
.login h1 { margin: 6px 0 2px; font-size: 24px; }

/* ================= الموبايل ================= */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* القائمة تنزلق من جهة البداية: يمين في العربي، شمال في الإنجليزي */
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 45; transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .3, 1); box-shadow: var(--shadow-lg); }
  [dir="rtl"] .side { transform: translateX(100%); }
  .side.open { transform: none !important; }
  .side.open + .scrim { display: block; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; gap: 6px; padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
  .topbar .search { display: none; }
  .topbar .hide-m { display: none; }
  .main { padding: 18px 16px 80px; }
  .banner { padding: 10px 16px; }
  .g3 { grid-template-columns: 1fr; }
  .page-head h1, .greet h1 { font-size: 20px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; font-size: 12.5px; }
  .kpi { padding: 14px; }
  .kpi .k-ic { width: 34px; height: 34px; margin-bottom: 8px; }
  .kpi .v { font-size: 21px; }
  .card { padding: 16px; }
  .modal-bg { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .modal-bg.drawer-bg { align-items: end; }
  .modal.drawer { height: 94vh; border-radius: 20px 20px 0 0; }
  .hk-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .toast-wrap { inset-inline: 12px; bottom: 12px; max-width: none; }
}

@media print {
  .side, .topbar, .banner, .page-head .row, .toast-wrap, .btn, .note, .scrim { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card, .table-wrap { box-shadow: none; border: 0; overflow: visible; }
  body { background: #fff; }
}

/* ================= حركات تجميلية ================= */
/* دخول الصفحة: العناصر تطلع بالتتابع */
.view-in > *, .view-in .grid > * { animation: rise .5s cubic-bezier(.2, .8, .3, 1) both; }
.view-in > *:nth-child(2) { animation-delay: .04s; }
.view-in > *:nth-child(3) { animation-delay: .08s; }
.view-in > *:nth-child(4) { animation-delay: .12s; }
.view-in > *:nth-child(5) { animation-delay: .16s; }
.view-in > *:nth-child(n+6) { animation-delay: .2s; }
.view-in .grid > *:nth-child(2) { animation-delay: .06s; }
.view-in .grid > *:nth-child(3) { animation-delay: .12s; }
.view-in .grid > *:nth-child(4) { animation-delay: .18s; }
.view-in .grid > *:nth-child(n+5) { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.view-in .t tbody tr, .view-in .feed-item, .view-in .hk { animation: rise .45s cubic-bezier(.2, .8, .3, 1) both; }
.view-in .t tbody tr:nth-child(2), .view-in .feed-item:nth-child(2), .view-in .hk:nth-child(2) { animation-delay: .03s; }
.view-in .t tbody tr:nth-child(3), .view-in .feed-item:nth-child(3), .view-in .hk:nth-child(3) { animation-delay: .06s; }
.view-in .t tbody tr:nth-child(4), .view-in .feed-item:nth-child(4), .view-in .hk:nth-child(4) { animation-delay: .09s; }
.view-in .t tbody tr:nth-child(5), .view-in .feed-item:nth-child(5), .view-in .hk:nth-child(5) { animation-delay: .12s; }
.view-in .t tbody tr:nth-child(n+6), .view-in .feed-item:nth-child(n+6), .view-in .hk:nth-child(n+6) { animation-delay: .15s; }
.view-in .cal tbody tr { animation: fade .5s ease both; }
.bar i { transition: width .9s cubic-bezier(.2, .8, .3, 1); }

/* هيكل التحميل اللامع */
.skel { display: flex; flex-direction: column; gap: 16px; }
.sk { border-radius: var(--r-lg); background: linear-gradient(90deg, #efebe2 0%, #f8f5ef 40%, #efebe2 80%); background-size: 300% 100%; animation: shimmer 1.3s infinite linear; }
.sk-title { height: 30px; width: 240px; border-radius: 8px; }
.sk-card { height: 130px; }
.sk-block { height: 280px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* بطاقات تطفو عند المرور */
.card { transition: box-shadow .2s, border-color .2s, transform .2s; }
.kpi:hover, .plan:hover, .lp .card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi .k-ic { transition: transform .3s cubic-bezier(.2, .8, .3, 1); }
.kpi:hover .k-ic { transform: scale(1.08) rotate(-4deg); }

/* أزرار: ضغطة + توهج يتبع الماوس + لمعة على الذهبي */
.btn { position: relative; overflow: hidden; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary::after, .btn.gold::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 60%);
}
.btn.primary:hover::after, .btn.gold:hover::after { opacity: 1; }
.btn.gold::before {
  content: ""; position: absolute; inset-block: 0; width: 40%; left: -60%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent); animation: sheen 3.2s ease-in-out infinite;
}
@keyframes sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.logo-mark { position: relative; overflow: hidden; }
.logo-mark::after {
  content: ""; position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  animation: logoShine 5s ease-in-out infinite;
}
@keyframes logoShine { 0%, 80% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

/* القائمة: أيقونة تتحرك سنة عند المرور */
.nav-btn .i { transition: transform .2s cubic-bezier(.2, .8, .3, 1), color .12s; }
.nav-btn:hover .i { transform: translateX(-2px); }
[dir="ltr"] .nav-btn:hover .i { transform: translateX(2px); }

/* خيارات الغرف والخانات */
.opt { transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.opt:not(.dis):hover { transform: translateY(-1px); }
.cell { transition: transform .12s, box-shadow .12s; }
.cell:hover { transform: scale(1.06); }
.hk:active { transform: scale(.98); }

/* التنبيهات: خروج ناعم */
.toast.out { animation: tout .25s ease forwards; }
@keyframes tout { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.menu-pop:not(.hidden) { animation: pop .16s cubic-bezier(.2, .8, .3, 1); transform-origin: top; }

/* شاشة الدخول: دوائر ذهبية تطفو */
.auth-side > * { position: relative; z-index: 1; }
.auth-copy { animation: rise .7s cubic-bezier(.2, .8, .3, 1) both .1s; }
.auth-points div { animation: rise .6s cubic-bezier(.2, .8, .3, 1) both; }
.auth-points div:nth-child(1) { animation-delay: .3s; } .auth-points div:nth-child(2) { animation-delay: .4s; } .auth-points div:nth-child(3) { animation-delay: .5s; }
.auth-form { animation: rise .6s cubic-bezier(.2, .8, .3, 1) both; }
.orb { position: absolute !important; z-index: 0 !important; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.orb.o1 { width: 340px; height: 340px; top: -90px; inset-inline-end: -80px; background: radial-gradient(circle, rgba(201, 162, 77, .35), transparent 65%); animation: float 12s ease-in-out infinite; }
.orb.o2 { width: 220px; height: 220px; bottom: 60px; inset-inline-start: -60px; background: radial-gradient(circle, rgba(233, 196, 106, .22), transparent 65%); animation: float 15s ease-in-out infinite reverse; }
.orb.o3 { width: 120px; height: 120px; top: 45%; inset-inline-end: 18%; border: 1px solid rgba(233, 196, 106, .25); filter: none; animation: float 10s ease-in-out infinite; }
@keyframes float { 50% { transform: translate(18px, 26px) scale(1.06); } }

/* عناوين الصفحات */
.page-head h1 { animation: none; }
.greet h1 .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1 .4s; }
@keyframes wave { 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40%, 100% { transform: rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.guest-cell b, .guest-cell > div > :first-child { white-space: nowrap; }
.t.list td:first-child { min-width: 190px; }

/* الجداول تتحول لبطاقات لما مساحتها تضيق (حسب عرض البطاقة نفسها مش الشاشة) */
.card, .table-wrap { container-type: inline-size; }
@container (max-width: 680px) {
  table.list thead { display: none; }
  table.list tbody { display: block; }
  table.list tr { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  table.list tbody tr:last-child { border-bottom: 0; }
  table.list td { display: block; border: 0; padding: 0; min-width: 0 !important; }
  table.list td:first-child { flex-basis: 100%; }
  table.list td.end { margin-inline-start: auto; }
  table.list td[colspan] { flex-basis: 100%; }
  .card > table.list tr { padding-inline: 0; }
}

/* ================= اختبار الربط ================= */
.mock-card { border-color: #ecdcb4; background: linear-gradient(180deg, #fffcf4, #fff 60%); }
.t.mini th, .t.mini td { padding: 7px 8px; text-align: center; font-size: 12.5px; }
.t.mini td:first-child, .t.mini th:first-child { text-align: start; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.test-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); margin-bottom: 14px; }
.test-head .i { width: 30px; height: 30px; padding: 5px; border-radius: 50%; color: #fff; }
.test-head.ok { background: var(--ok-50); } .test-head.ok .i { background: var(--ok); }
.test-head.bad { background: var(--bad-50); } .test-head.bad .i { background: var(--bad); }
.test-head b { font-size: 16px; }
.test-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.test-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line-2); animation: rise .4s cubic-bezier(.2, .8, .3, 1) both; }
.test-steps li:last-child { border-bottom: 0; }
.ts-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.ts-ic .i { width: 14px; height: 14px; stroke-width: 3; }
.test-steps li.ok .ts-ic { background: var(--ok-50); color: var(--ok); }
.test-steps li.bad .ts-ic { background: var(--bad-50); color: var(--bad); }
