:root {
  --navy: #14244a; --coral: #e85d3f; --yellow: #ffc629; --cream: #fff8ee;
  --ink: #1b2440; --muted: #6b7388; --line: #e8e2d6; --ok: #1f9d61; --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; background: var(--cream); color: var(--ink); line-height: 1.7; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .4em; }
a { color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 0; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--coral); color: #fff; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.yellow { background: var(--yellow); color: var(--navy); }
.btn.navy { background: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn.light { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.danger { background: #fff; color: #c0392b; border: 1px solid #f0c9c3; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }

/* الترويسة */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 248, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--navy); text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand small { display: block; font-weight: 500; font-size: .72rem; letter-spacing: .5px; margin-top: -6px; }

/* الواجهة */
.hero { background: var(--navy); color: #fff; }
.hero img { width: 100%; aspect-ratio: 16/9; max-height: 72vh; object-fit: cover; }
.hero .wrap { padding: 26px 16px 36px; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 800; }
.hero h1 span { color: var(--yellow); }
.hero p { margin: 0 auto 18px; max-width: 620px; opacity: .9; }
.hero .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }

section { padding: 44px 0; }
.title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.title h2 { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.title h2::after { content: ''; display: block; width: 46px; height: 5px; border-radius: 3px; background: var(--coral); margin-top: 6px; }
.muted { color: var(--muted); }

/* الوحدات */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card > img { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--line); }
.card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.2rem; color: var(--navy); margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { background: var(--cream); border-radius: 12px; padding: 8px 10px; }
.price small { display: block; color: var(--muted); font-size: .78rem; }
.price b { font-size: 1.15rem; color: var(--navy); }
.price b i { font-style: normal; font-size: .75rem; font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef1f7; color: var(--navy); width: fit-content; }
.chip.pending { background: #fff3cd; color: #8a6100; }
.chip.confirmed { background: #dcf5e7; color: #14713f; }
.chip.cancelled { background: #fde2de; color: #a93226; }
.chip.paid { background: var(--navy); color: #fff; }

/* المعرض */
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery button { padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--line); }
.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; }
#lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
#lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 12px; }

/* المعلومات */
.info { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h3 { color: var(--navy); }
.panel p { margin: 0 0 10px; white-space: pre-line; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dark { background: var(--navy); color: #fff; }
.dark .title h2 { color: #fff; }
footer { background: var(--navy); color: rgba(255, 255, 255, .7); text-align: center; padding: 22px 16px 34px; font-size: .9rem; }
footer a { color: var(--yellow); }

/* النماذج */
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; color: var(--navy); }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--coral); }
input[type=checkbox], input[type=radio] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--coral); }
.field { margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msg { border-radius: 12px; padding: 10px 12px; font-weight: 700; margin-bottom: 12px; }
.msg.err { background: #fde2de; color: #a93226; }
.msg.ok { background: #dcf5e7; color: #14713f; }
.quote { display: flex; justify-content: space-between; align-items: center; background: var(--cream); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; }
.quote b { font-size: 1.3rem; color: var(--coral); }

/* النوافذ */
dialog.sheet { border: 0; padding: 0; width: min(520px, 100vw); max-width: 100vw; max-height: 92dvh; border-radius: 22px; color: var(--ink); }
dialog::backdrop { background: rgba(20, 36, 74, .6); }
.sheet .head { position: sticky; top: 0; background: #fff; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet .head h3 { margin: 0; color: var(--navy); }
.sheet .content { padding: 18px; }
.x { border: 0; background: var(--cream); width: 38px; height: 38px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.ref { font-size: 1.8rem; font-weight: 800; letter-spacing: 2px; color: var(--navy); direction: ltr; text-align: center; background: var(--cream); border: 2px dashed var(--yellow); border-radius: 14px; padding: 10px; margin: 10px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }

@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; border-radius: 22px 22px 0 0; width: 100vw; }
  section { padding: 32px 0; }
}

/* التقويم والخدمات الإضافية */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-head b { color: var(--navy); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dn { font-size: .68rem; text-align: center; color: var(--muted); font-weight: 700; }
.cal button { aspect-ratio: 1; min-width: 0; padding: 0; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit; font-weight: 700; line-height: 1.15; display: grid; place-content: center; justify-items: center; cursor: pointer; }
.cal button small { font-size: .58rem; font-weight: 500; color: var(--muted); }
.cal button.wk { background: #fff3cf; border-color: #f3dfa0; }
.cal button:disabled { background: #f1efea; color: #b9b6ae; border-color: transparent; cursor: not-allowed; }
.cal button.full { background: #fde2de; color: #b5766e; }
.cal button.full small { color: #b5766e; }
.cal button.sel { background: var(--coral); border-color: var(--coral); color: #fff; }
.cal button.sel small { color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); margin: 8px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); background: #fff; }
.legend .lg-wk { background: #fff3cf; border-color: #f3dfa0; }
.legend .lg-full { background: #fde2de; border-color: #fde2de; }
.legend .lg-sel { background: var(--coral); border-color: var(--coral); }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.msg.note { background: #fff3cd; color: #7a5600; font-weight: 500; font-size: .9rem; }
.extras { display: grid; gap: 8px; margin-bottom: 12px; }
.extra { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 500; }
.extra:has(input:checked) { border-color: var(--coral); background: #fff4f0; }
.extra > span:first-of-type { flex: 1; }
.extra small { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.extra .xp { text-align: left; font-weight: 800; color: var(--navy); white-space: nowrap; }
.extra .xp i, .q-rows i { font-style: normal; font-size: .78rem; font-weight: 500; }
.quote .q-rows { width: 100%; display: grid; gap: 4px; font-weight: 500; }
.quote .q-rows > div { display: flex; justify-content: space-between; gap: 10px; }
.quote .q-total { border-top: 1px dashed #dccfb6; padding-top: 6px; margin-top: 2px; font-weight: 800; }
.chip.review { background: #e4e9ff; color: #2b3c8f; }

/* صور الوحدة والمرافق */
.shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--line); }
.shots::-webkit-scrollbar { display: none; }
.shots img { flex: 0 0 100%; width: 100%; aspect-ratio: 4/3; object-fit: cover; scroll-snap-align: center; cursor: zoom-in; }
.dots { display: flex; justify-content: center; gap: 5px; margin-top: -18px; position: relative; height: 18px; pointer-events: none; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 0 2px rgba(0, 0, 0, .5); }
.amen { display: flex; flex-wrap: wrap; gap: 5px; }
.chip.soft { background: var(--cream); color: var(--ink); font-weight: 500; }
.chip.awaiting { background: #fff3cd; color: #8a6100; }
.cal button.sp { background: #e7f6ee; border-color: #b9e2cb; }
.legend .lg-sp { background: #e7f6ee; border-color: #b9e2cb; }
.q-off { color: var(--ok); } .q-err { color: #a93226; font-weight: 700; }

/* التقييمات */
.stars { color: var(--yellow); letter-spacing: 1px; white-space: nowrap; }
.stars s { color: #d9d4c8; text-decoration: none; }
.hero-rating { display: inline-block; margin-bottom: 14px; color: #fff; text-decoration: none; font-weight: 500; }
.review p { margin: 6px 0; }
.how { margin: 0 0 12px; padding-inline-start: 20px; }
.how li { margin-bottom: 4px; }

/* صفحة متابعة الحجز */
.steps { list-style: none; display: flex; margin: 0 0 14px; padding: 0; }
.steps li { flex: 1; text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); position: relative; }
.steps li::before { content: ''; position: absolute; top: 14px; inset-inline-start: -50%; width: 100%; height: 3px; background: var(--line); }
.steps li:first-child::before { display: none; }
.steps i { position: relative; z-index: 1; display: grid; place-content: center; width: 30px; height: 30px; margin: 0 auto 4px; border-radius: 50%; background: var(--line); color: var(--muted); font-style: normal; }
.steps .done { color: var(--ok); } .steps .done i { background: var(--ok); color: #fff; } .steps .done::before { background: var(--ok); }
.steps .now { color: var(--coral); } .steps .now i { background: var(--coral); color: #fff; } .steps .now::before { background: var(--ok); }
.money { display: grid; gap: 6px; background: var(--cream); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.money > div { display: flex; justify-content: space-between; align-items: center; }
.money .due { border-bottom: 1px dashed #dccfb6; padding-bottom: 8px; font-weight: 800; }
.money .due b { font-size: 1.5rem; color: var(--coral); }
.money i, .kv i { font-style: normal; font-size: .8rem; font-weight: 500; }
.bank { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.bank .kv { margin: 6px 0 10px; }
.rate { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; margin: 6px 0; direction: ltr; }
.rate input { position: absolute; opacity: 0; width: 0; min-height: 0; height: 0; }
.rate label { font-size: 2.2rem; line-height: 1; color: #d9d4c8; cursor: pointer; margin: 0; }
.rate input:checked ~ label { color: var(--yellow); }
.btn.wa { background: #1f9d61; color: #fff; border: 0; min-height: 46px; width: 100%; }
details summary { cursor: pointer; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.nowrap { white-space: nowrap; color: var(--navy); }

/* ---------- لوحة التحكم ---------- */
.moneyline { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 6px; margin: 0 0 10px; }
.moneyline > div { background: var(--cream); border-radius: 10px; padding: 6px 8px; }
.moneyline span { display: block; font-size: .72rem; color: var(--muted); }
.moneyline b { font-size: .92rem; color: var(--navy); white-space: nowrap; }
.moneyline .owe { background: #fff0ec; } .moneyline .owe b { color: var(--coral); }
.stat.hot { border-color: var(--coral); background: #fff4f0; } .stat.hot b { color: var(--coral); }
.bar.sec, h3.sec { margin-top: 30px; }
.sheet .filters { flex-wrap: wrap; overflow: visible; }
.tabs button { font-size: .76rem; }
h3.sec { padding-top: 16px; border-top: 1px solid var(--line); }
.acal button { aspect-ratio: auto; min-height: 58px; align-content: start; padding-top: 5px; }
.acal button.today { border-color: var(--navy); border-width: 2px; }
.acal button.old { color: #b9b6ae; }
.acal button.blk { background: #f1efea; }
.dts { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 2px; }
.dts i, .legend i[class^=d-] { font-style: normal; font-size: .62rem; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-content: center; color: #fff; border: 0; }
.d-confirmed { background: var(--ok) !important; } .d-awaiting { background: #e0a100 !important; } .d-fresh { background: #4a5fd0 !important; }
.dts .d-blk { background: none; font-size: .7rem; }
.barline { position: relative; height: 10px; border-radius: 5px; background: var(--cream); overflow: hidden; margin-top: 6px; }
.barline i { position: absolute; inset-block: 0; inset-inline-start: 0; background: #f3c9be; border-radius: 5px; }
.barline i.got { background: var(--ok); }
.admin { background: #f4f1ea; padding-bottom: 90px; }
.login { max-width: 400px; margin: 10vh auto; padding: 0 16px; text-align: center; }
.login img { height: 90px; margin: 0 auto 10px; }
.login .panel { text-align: right; }
.tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { border: 0; background: none; font: inherit; font-weight: 700; font-size: .82rem; color: var(--muted); padding: 8px 4px 10px; cursor: pointer; display: grid; gap: 2px; justify-items: center; }
.tabs button svg { width: 24px; height: 24px; }
.tabs button.on { color: var(--coral); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.stat span { font-size: .85rem; color: var(--muted); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.filters button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer; color: var(--navy); }
.filters button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.list { display: grid; gap: 10px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.item .hd { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.item h4 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.item .meta { color: var(--muted); font-size: .9rem; margin: 4px 0 10px; }
.item .meta b { color: var(--ink); }
.item .thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: var(--line); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 12px; }
.bar h2 { margin: 0; color: var(--navy); font-size: 1.3rem; }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pics div { position: relative; }
.pics img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 12px; }
.pics button { position: absolute; top: 6px; left: 6px; border: 0; width: 30px; height: 30px; border-radius: 50%; background: rgba(192, 57, 43, .92); color: #fff; cursor: pointer; font-size: 1rem; }
.days { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.days label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 99; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: 90vw; }
.toast.err { background: #c0392b; }

/* حساب العميل وبلاغات الصيانة */
.linkbtn { background: none; border: 0; color: var(--coral); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 4px; }
button.mybook { width: 100%; text-align: start; font: inherit; cursor: pointer; display: block; color: var(--ink); }
.issue { border-top: 1px solid var(--line); padding: 8px 0; margin-top: 8px; }
.issue p { margin: 4px 0; }
.issue-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; cursor: zoom-in; margin: 4px 0; }
.chip.received, .chip.open { background: #e4e9ff; color: #2b3c8f; }
.chip.working, .chip.assigned { background: #fff3cd; color: #8a6100; }
.chip.resolved { background: #dcf5e7; color: #14713f; }
.chip.unresolved { background: #fde2de; color: #a93226; }
.chip.closed { background: #eee; color: #555; }
