:root {
  --ink: #0E1B19;
  --muted: #51635F;
  --line: #D9E2DF;
  --bg: #F3F6F5;
  --card: #ffffff;
  --brand: #0B6B57;
  --brand-ink: #ffffff;
  --ok-bg: #e2f3ea; --ok: #14653f;
  --warn-bg: #FDF0D3; --warn: #6B4800;
  --danger-bg: #FBE3E1; --danger: #8E241D;
  --info-bg: #e4edf8; --info: #1f4f8a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--brand); }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.muted { color: var(--muted); margin: 0 0 .75rem; }
small.muted { display: block; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem;
  padding: .6rem 1rem;
  background: #0B1A18; color: #EAF2F0;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: 1.25rem; text-decoration: none; color: #EAF2F0; }
.nav { display: flex; gap: .15rem; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; order: 3; }
.nav a { padding: .35rem .8rem; border-radius: 999px; text-decoration: none; color: #C9D8D4; white-space: nowrap; min-height: 36px; }
.nav a[aria-current="page"] { background: #12302B; color: #fff; font-weight: 600; }
.logout { margin-inline-start: auto; }
.logout .link { color: #C9D8D4; }
@media (min-width: 760px) { .nav { flex: 1 1 auto; order: 0; } }

.page { max-width: 960px; margin: 0 auto; padding: 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.narrow { max-width: 460px; margin-inline: auto; margin-top: 1.5rem; }
.empty { text-align: center; }

.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }

.btn {
  display: inline-block; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink);
  padding: .65rem 1.25rem; border-radius: 10px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  min-height: 44px;
}
.btn.small { padding: .35rem .9rem; min-height: 36px; font-size: .9rem; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--brand); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.actions { display: flex; gap: .5rem; margin-top: .5rem; }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }

form > div { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=url], input[type=number], input[type=date], input[type=file], input[type=email],
input[type=password], input[type=tel], input[type=search], textarea, select {
  width: 100%; padding: .6rem .75rem; min-height: 44px;
  border: 1px solid #b9c3cc; border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input[type=checkbox] { width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.helptext { display: block; color: var(--muted); font-size: .9rem; }
.errorlist { list-style: none; margin: 0 0 .5rem; padding: .5rem .75rem; background: var(--danger-bg); color: var(--danger); border-radius: 8px; }
.copy { font-size: .85rem; margin-bottom: .5rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg, .alert { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 .5rem; background: var(--info-bg); color: var(--info); }
.msg-success { background: var(--ok-bg); color: var(--ok); }
.msg-error, .alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert h2 { margin: 0 0 .25rem; }
.alert ul { margin: 0; padding-inline-start: 1.25rem; }
.alert a { color: inherit; font-weight: 600; }

.today { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; }
.stat .num { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.stat small { color: var(--muted); }

.units, .list { list-style: none; margin: 0 0 1rem; padding: 0; }
.unit {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; margin-bottom: .5rem; text-decoration: none; color: var(--ink);
}
.unit-name { font-weight: 700; }
.unit .muted { grid-column: 1; margin: 0; }
.unit .tag { grid-column: 2; grid-row: 1 / span 2; }
.list li { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .muted { margin: 0; }

.tag { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-renew, .tag-pending { background: var(--warn-bg); color: var(--warn); }
.tag-missing { background: var(--danger-bg); color: var(--danger); }

.month-nav { display: flex; justify-content: space-between; margin-bottom: .75rem; }
.cal-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cal { border-collapse: collapse; width: max-content; min-width: 100%; }
.cal th, .cal td { border: 1px solid var(--line); text-align: center; }
.cal thead th { font-weight: 600; font-size: .85rem; padding: .25rem; min-width: 36px; }
.cal .dow { display: block; font-size: .65rem; color: var(--muted); font-weight: 400; }
/* position: relative يبقي نص قارئ الشاشة داخل حاوية التمرير فلا تتمدد الصفحة أفقيا. */
.cal td { height: 40px; min-width: 36px; font-weight: 700; position: relative; }
.cal .unit-col { position: sticky; inset-inline-start: 0; background: var(--card); text-align: start; padding: .25rem .75rem; min-width: 110px; max-width: 150px; z-index: 1; font-size: .9rem; }
.cal .is-today { box-shadow: inset 0 0 0 2px #f0a500; }

.s-airbnb { background: #f6b7b0; }
.s-booking { background: #a9c6ef; }
.s-gathern { background: #a8dcc0; }
.s-manual { background: #d9c8ef; }
.s-other { background: #cfd6dc; }
.s-agoda { background: #e6c6ea; }
.s-expedia { background: #f5e3a3; }
.s-vrbo { background: #b9cdf2; }
.s-trip { background: #bfe3ee; }
.s-blocked { background: repeating-linear-gradient(45deg, #d5dade, #d5dade 4px, #f1f3f5 4px, #f1f3f5 8px); }
.s-conflict { background: var(--danger); color: #fff; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding: 0; margin: .75rem 0; font-size: .85rem; }
.legend i { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 4px; margin-inline-end: .35rem; vertical-align: middle; text-align: center; font-style: normal; font-weight: 700; line-height: 1.1rem; font-size: .75rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .page { padding: .75rem; }
  .unit { grid-template-columns: 1fr; }
  .unit .tag { grid-column: 1; grid-row: auto; justify-self: start; margin-top: .25rem; }
}

/* صفحات التشغيل */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpis .stat .num { font-size: 1.6rem; }
.stat a { color: inherit; }
.cell-link { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; line-height: 40px; }
.table-wrap { position: relative; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
table.data { border-collapse: collapse; width: 100%; min-width: 620px; }
table.data th, table.data td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
table.data thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
table.data tfoot td { font-weight: 700; border-bottom: 0; background: var(--bg); }
.num-cell { font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form > div { margin: 0; }
.inline-form input[type=number] { width: 7.5rem; min-height: 36px; padding: .3rem .5rem; }
.inline-form select { min-height: 36px; padding: .3rem .5rem; width: auto; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; }
.list li > .grow { flex: 1 1 12rem; }
textarea { width: 100%; padding: .6rem .75rem; border: 1px solid #b9c3cc; border-radius: 10px; font: inherit; }

/* الاستقبال والأسعار */
select { font: inherit; padding: .4rem .6rem; border: 1px solid var(--line, #D5DEDB); border-radius: 8px; background: #fff; min-height: 40px; }
.tag-pending { background: #EEF2F1; color: #3E4F4B; }

/* الفاتورة */
.invoice-page { background: #F3F6F5; padding: 16px; }
.invoice-bar { max-width: 760px; margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.invoice-page .alert, .invoice-page .messages { max-width: 760px; margin-inline: auto; }
.invoice { max-width: 760px; margin: 0 auto; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 1px 3px rgba(11, 26, 24, .08); }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid #0B1A18; padding-bottom: 16px; }
.invoice-head h1 { margin: 0 0 8px; font-size: 1.5rem; }
.invoice-head p, .invoice-parties p { margin: 2px 0; }
.invoice-qr svg { width: 132px; height: 132px; display: block; }
.invoice-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 20px 0; }
.invoice-parties h2 { font-size: .85rem; color: #5B6B67; margin: 0 0 6px; font-weight: 600; }
.invoice-lines { width: 100%; }
.invoice-lines tfoot th { text-align: start; font-weight: 500; }
.invoice-total th, .invoice-total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid #0B1A18; }
.invoice-paid { margin-top: 16px; color: #5B6B67; }
@media print {
  .no-print { display: none !important; }
  .invoice-page { background: #fff; padding: 0; }
  .invoice { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
}
table.invoice-lines { min-width: 0; width: 100%; table-layout: fixed; }
table.invoice-lines th:last-child, table.invoice-lines td:last-child { width: 34%; text-align: end; }
table.invoice-lines td, table.invoice-lines th { overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters input, .filters select { flex: 1 1 9rem; min-width: 0; }
.inline-form select { padding: .15rem .3rem; font-size: .85rem; }
.date-wrap { display: flex; gap: .5rem; align-items: center; }
.date-wrap input { flex: 1 1 auto; min-width: 0; }
.date-clear { flex: 0 0 auto; background: transparent; border: 1px solid var(--line, #c9d3d0); border-radius: 999px;
  padding: .35rem .9rem; font: inherit; font-size: .9rem; color: inherit; cursor: pointer; }
.date-clear[hidden] { display: none; }
input:user-invalid { border-color: var(--danger); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }

/* صفحات الدخول والتسجيل: باب مضاء في الليل، والنموذج على ورقة بيضاء */
.auth-body { background: #0A1F1B; }
.auth-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-art { position: relative; color: #fff; padding: 1.1rem 1.25rem 0; height: 232px; overflow: hidden; flex: 0 0 auto; }
.auth-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .5rem; color: #fff;
  text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.auth-door { position: absolute; inset-inline: 0; bottom: 0; width: 100%; height: 190px; }
.auth-pitch { display: none; }
.door-light, .door-spill { animation: door-open 1.1s ease-out both; }
.door-spill { animation-delay: .25s; }
@keyframes door-open { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .door-light, .door-spill { animation: none; } }

.auth-panel { position: relative; flex: 1 1 auto; background: #fff; border-radius: 28px 28px 0 0; margin-top: -26px;
  padding: 2rem 1.35rem 1.25rem; display: flex; flex-direction: column; }
.auth { width: 100%; max-width: 420px; margin: 0 auto; }
.auth h1 { font-size: 1.85rem; line-height: 1.3; font-weight: 700; margin: 0 0 .3rem; letter-spacing: 0; }
.auth .lead { color: var(--muted); margin: 0 0 1.6rem; font-size: 1.02rem; }
.auth form > div { margin-bottom: 1.05rem; }
.auth label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; color: var(--ink); }
.auth input[type="text"], .auth input[type="email"], .auth input[type="password"], .auth input[type="tel"],
.auth input[type="number"], .auth select {
  width: 100%; min-height: 54px; padding: .6rem .95rem; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: #F5F8F7; border: 1.5px solid transparent; border-radius: 14px; transition: border-color .15s, background .15s; }
.auth input:hover { border-color: #C9D6D2; }
.auth input:focus-visible, .auth select:focus-visible { outline: none; background: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(53, 214, 173, .28); }
.auth .helptext { display: block; color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.auth .btn { width: 100%; justify-content: center; min-height: 56px; font-size: 1.1rem; font-weight: 600;
  border-radius: 14px; margin-top: .35rem; background: var(--brand); box-shadow: 0 10px 22px -12px rgba(11, 107, 87, .9); }
.auth .btn:hover { background: #08584A; }
.auth .btn:active { transform: translateY(1px); box-shadow: none; }
.auth .btn:focus-visible, .btn-ghost:focus-visible { outline: 3px solid #35D6AD; outline-offset: 3px; }
.btn-ghost { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: .6rem;
  border: 1.5px solid #C9D6D2; border-radius: 14px; color: var(--ink); font-weight: 600; text-decoration: none; background: #fff; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.auth-aside { margin: -.35rem 0 1rem; font-size: .95rem; }
.auth-aside a, .auth-links a:not(.btn-ghost) { color: var(--brand); font-weight: 600; text-underline-offset: 4px; }
.auth-links { margin-top: 1.6rem; display: flex; flex-direction: column; gap: .35rem; color: var(--muted); }
.auth-links > span { font-size: .95rem; }
.auth-links .btn-ghost { margin-top: .25rem; }
.auth-perks { list-style: none; padding: 0; margin: -.6rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.auth-perks li { background: #E9F6F1; color: var(--brand); border-radius: 999px; padding: .2rem .75rem; font-size: .88rem; font-weight: 500; }
.auth .alert { border-radius: 14px; }
.auth-foot { margin-top: auto; padding-top: 2rem; display: flex; gap: 1.25rem; justify-content: center; font-size: .88rem; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--brand); text-decoration: underline; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input, .auth .pw-wrap input { padding-right: 5rem; padding-left: .95rem; width: 100%; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: transparent;
  border: 0; border-radius: 10px; min-height: 44px; padding: 0 .8rem; font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--brand); cursor: pointer; }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); }

@media (min-width: 900px) {
  .auth-shell { flex-direction: row-reverse; }
  .auth-art { flex: 1 1 46%; height: auto; min-height: 100vh; padding: 2rem 2.5rem; display: flex; flex-direction: column; }
  .auth-brand { font-size: 1.4rem; }
  .auth-door { position: static; flex: 1 1 auto; height: auto; min-height: 0; max-height: 52vh; margin: 2rem 0 0; }
  .auth-pitch { display: block; border-top: 1px solid rgba(53, 214, 173, .25); padding-top: 1.75rem; max-width: 30rem; }
  .auth-say { font-size: 1.75rem; line-height: 1.5; font-weight: 600; margin: 0 0 1.1rem; }
  .auth-pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: #B7CFC8; }
  .auth-pitch li { padding-inline-start: 1rem; position: relative; }
  .auth-pitch li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 6px; height: 6px;
    border-radius: 50%; background: #F2C27B; }
  .auth-panel { flex: 1 1 54%; border-radius: 0; margin: 0; padding: 3rem 2rem 1.5rem; justify-content: center; }
  .auth { margin: auto; }
  .auth h1 { font-size: 2.2rem; }
}
.check-row { display: flex; gap: .6rem; align-items: flex-start; }
.check-row label { font-weight: 400; margin: 0; }
.check-row input { flex: 0 0 auto; margin-top: .2rem; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-error { display: block; color: var(--danger); font-size: .9rem; margin-top: .3rem; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.verify-bar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; }
.verify-bar .link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; cursor: pointer; }

/* ============ هوية اللوحة: ليل أخضر، نعناعي، وضوء الباب ============ */
:root {
  --night: #0A1F1B; --night-2: #12302B; --mint: #35D6AD; --lamp: #F2C27B; --lamp-bg: #FFF4DF;
  --bg: #F1F5F3; --line: #E1E8E5; --radius: 20px;
  --shadow: 0 1px 2px rgba(10, 31, 27, .05), 0 14px 28px -22px rgba(10, 31, 27, .45);
}
body.app { background: var(--bg); }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
h1 { font-size: 1.7rem; line-height: 1.35; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }

/* الشريط العلوي */
.topbar { padding: .7rem 1rem; background: var(--night); gap: .75rem; flex-wrap: nowrap; }
.topbar .brand { font-size: 1.3rem; gap: .5rem; }
.account-name { margin-inline-start: auto; color: #A9C4BD; font-size: .9rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-width: 0; }
.avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: var(--night-2); color: var(--mint);
  display: grid; place-items: center; font-weight: 700; text-decoration: none; border: 1.5px solid rgba(53, 214, 173, .35); }

/* عناصر التنقل المشتركة */
.nav-item { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; font: inherit;
  background: none; border: 0; cursor: pointer; }
.nav-item svg { width: 24px; height: 24px; flex: 0 0 auto; }

/* شريط سفلي على الجوال */
.side { display: none; }
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
.tabbar .nav-item { display: none; }
.tabbar .nav-item.is-primary { display: flex; flex-direction: column; gap: .1rem; flex: 1 1 0; min-width: 0; align-items: center;
  padding: .35rem .2rem; border-radius: 14px; color: #6B7F7A; font-size: .74rem; font-weight: 500; min-height: 54px; }
.tabbar .nav-item[aria-current="page"] { color: var(--brand); font-weight: 700; }
.tabbar .nav-item[aria-current="page"] svg { background: #DDF5EC; border-radius: 999px; padding: 3px 14px; width: 52px; height: 30px; }
.tabbar .nav-item svg { padding: 3px 14px; width: 52px; height: 30px; }
body.has-nav .page { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }

/* لوحة "المزيد" */
.sheet { border: 0; padding: .6rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); width: 100%; max-width: 560px;
  margin: auto auto 0; border-radius: 26px 26px 0 0; background: #fff; color: var(--ink); max-height: 86vh; }
.sheet::backdrop { background: rgba(10, 31, 27, .55); }
.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: #D5DEDB; margin: 0 auto .9rem; }
.sheet-title { font-weight: 700; font-size: 1.1rem; margin: 0 0 .9rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.sheet-grid .nav-item { flex-direction: column; gap: .45rem; padding: .95rem .3rem; border-radius: 18px; background: #F3F7F5;
  font-size: .9rem; font-weight: 600; text-align: center; min-height: 86px; justify-content: center; }
.sheet-grid .nav-item svg { color: var(--brand); width: 26px; height: 26px; }
.sheet-grid .nav-item[aria-current="page"] { background: var(--night); color: #fff; }
.sheet-grid .nav-item[aria-current="page"] svg { color: var(--mint); }
.sheet-logout { margin: 1rem 0 0; }
.btn-quiet { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 50px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 600; color: var(--danger); cursor: pointer; }
.btn-quiet svg { width: 22px; height: 22px; }
.sheet-close { position: absolute; inset-inline-end: 1rem; top: 1rem; background: none; border: 0; font: inherit; color: var(--muted);
  cursor: pointer; min-height: 40px; padding: 0 .4rem; }

/* شريط جانبي على الشاشات العريضة */
@media (min-width: 980px) {
  body.has-nav { padding-inline-start: 248px; }
  body.has-nav .topbar, .tabbar { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; inset-block: 0; inset-inline-start: 0; width: 248px;
    background: var(--night); color: #CFE0DB; padding: 1.4rem .9rem 1rem; overflow-y: auto; z-index: 10; }
  .side .brand { font-size: 1.45rem; padding: 0 .6rem; }
  .side-account { margin: .5rem .6rem 1.2rem; color: #8FB0A8; font-size: .9rem; }
  .side-nav { display: flex; flex-direction: column; gap: .15rem; }
  .side .nav-item { width: 100%; padding: .68rem .8rem; border-radius: 14px; color: #CFE0DB; font-weight: 500; }
  .side .nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .side .nav-item[aria-current="page"] { background: var(--night-2); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--lamp); }
  [dir="rtl"] .side .nav-item[aria-current="page"] { box-shadow: inset -3px 0 0 var(--lamp); }
  .side .nav-item[aria-current="page"] svg { color: var(--mint); }
  .side-logout { margin: auto 0 0; padding-top: 1rem; }
  body.has-nav .page { padding: 2rem 2rem 3rem; max-width: 1040px; }
}

/* الصفحة والبطاقات */
.page { padding: 1.1rem 1rem; }
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.25rem; margin-bottom: 1rem; }
.card > h2:first-child, .card .section-head h2 { margin-bottom: .6rem; }
.section-head { align-items: center; margin-bottom: 1rem; }
.section-head h1 { margin: 0; }
.section-head .muted { margin: .15rem 0 0; }
.page-greeting { margin: .25rem 0 1.1rem; }
.page-greeting h1 { margin: 0; }
.page-greeting p { margin: .1rem 0 0; color: var(--muted); }

/* الأزرار */
.btn { border-radius: 14px; min-height: 48px; padding: .7rem 1.3rem; border-width: 1.5px; display: inline-flex; align-items: center;
  justify-content: center; gap: .4rem; transition: background .15s, transform .05s; }
.btn:hover { background: #08584A; border-color: #08584A; }
.btn:active { transform: translateY(1px); }
.btn.small { border-radius: 999px; min-height: 40px; padding: .35rem 1.05rem; font-size: .93rem; }
.btn.ghost { background: #fff; color: var(--brand); border-color: #BFD3CD; }
.btn.ghost:hover { background: #EAF6F1; border-color: var(--brand); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* الحقول والقوائم المنسدلة */
input[type=text], input[type=url], input[type=number], input[type=date], input[type=file], input[type=email],
input[type=password], input[type=tel], input[type=search], textarea, select {
  min-height: 50px; padding: .6rem .9rem; border: 1.5px solid #D3DDD9; border-radius: 14px; background: #fff;
  transition: border-color .15s, box-shadow .15s; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(53, 214, 173, .28); }
select { appearance: none; -webkit-appearance: none; cursor: pointer; font-weight: 500; min-height: 50px;
  padding: .55rem .95rem; padding-inline-end: 2.6rem; border: 1.5px solid #D3DDD9; border-radius: 14px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B6B57' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left .8rem center; }
[dir="ltr"] select, select[dir="ltr"] { background-position: right .8rem center; }
select:hover { border-color: var(--brand); }
.inline-form select { min-height: 42px; padding: .3rem .8rem; padding-inline-end: 2.3rem; font-size: .93rem; border-radius: 999px; }
.inline-form input[type=number] { min-height: 42px; border-radius: 12px; }
label { font-size: .95rem; margin-bottom: .35rem; }
input[type=checkbox] { accent-color: var(--brand); }

/* الأرقام */
.today, .kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.1rem; }
.stat { position: relative; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.05rem 1.05rem;
  gap: .1rem; min-height: 118px; }
.stat .num, .kpis .stat .num { font-size: 2.1rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat > span:not(.num):not(.stat-ico) { color: #3A4F4A; font-weight: 500; }
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .55rem;
  background: #E3F5EE; color: var(--brand); }
.stat-ico svg { width: 22px; height: 22px; }
.stat.is-lamp .stat-ico { background: var(--lamp-bg); color: #8A5A0B; }
.stat.is-night { background: var(--night); color: #fff; }
.stat.is-night > span:not(.num):not(.stat-ico) { color: #B7CFC8; }
.stat.is-night .stat-ico { background: var(--night-2); color: var(--mint); }
.stat.is-zero .num { color: #A7B6B1; }
.stat.is-night.is-zero .num { color: #6F8F87; }
.stat small { margin-top: .2rem; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

/* القوائم داخل البطاقات */
.list li { padding: .85rem 0; gap: .5rem 1rem; }
.list li > .grow { display: flex; flex-direction: column; gap: .05rem; }
.list li strong { font-size: 1.03rem; }
.list a:not(.btn) { text-underline-offset: 4px; }
.empty-line { display: flex; align-items: center; gap: .7rem; color: var(--muted); margin: .2rem 0 0; }
.empty-line svg { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: #F1F5F3; color: #8AA19B; flex: 0 0 auto; }
.unit { border: 0; box-shadow: var(--shadow); border-radius: 18px; padding: 1rem 1.1rem; }
.unit:hover { box-shadow: 0 1px 2px rgba(10, 31, 27, .06), 0 16px 30px -20px rgba(10, 31, 27, .6); }

/* اختيار حالة الوحدة بلمسة واحدة */
.seg { display: inline-flex; background: #EEF3F1; border-radius: 999px; padding: 3px; gap: 2px; margin: 0; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 600; color: #51635F;
  padding: .4rem .85rem; border-radius: 999px; cursor: pointer; min-height: 38px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(10, 31, 27, .18); }
.seg button[aria-pressed="true"][value="ready"] { background: var(--brand); color: #fff; }
.seg button[aria-pressed="true"][value="needs_cleaning"] { background: var(--lamp); color: #4A3000; }
.seg button[aria-pressed="true"][value="maintenance"] { background: var(--danger); color: #fff; }

/* الوسوم والتنبيهات والجداول */
.tag { padding: .2rem .75rem; font-size: .84rem; }
.msg, .alert { border-radius: 16px; padding: .85rem 1.05rem; }
.table-wrap, .cal-wrap { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
table.data thead th { background: #F6F9F8; }
table.data tbody tr:hover { background: #FAFCFB; }
.cal .is-today { box-shadow: inset 0 0 0 2px var(--lamp); }
.filters { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; margin-bottom: 1rem; }

/* ============ التقويم: خط زمني تمتد عليه الإقامات كأشرطة ============ */
.calx-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.calx-month { display: flex; align-items: center; gap: .5rem; }
.calx-month h1 { margin: 0 .35rem; min-width: 9.5ch; text-align: center; font-variant-numeric: tabular-nums; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink);
  box-shadow: var(--shadow); text-decoration: none; }
.icon-btn:hover { background: var(--night); color: var(--mint); }
.icon-btn svg, .btn-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.calx-facts { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.calx-facts li { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: .6rem 1rem; display: flex; align-items: baseline;
  gap: .5rem; flex-wrap: wrap; }
.calx-facts strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.calx-facts span { color: var(--muted); font-size: .92rem; }
.calx-facts .meter { flex-basis: 100%; }
.meter { display: block; height: 5px; border-radius: 999px; background: #E3EBE8; overflow: hidden; min-width: 56px; }
.meter b { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

.calx { --unit: 190px; --day: 40px; --rowh: 58px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-x: auto; overscroll-behavior-x: contain; }
.calx-row { display: grid; grid-template-columns: var(--unit) repeat(var(--days), minmax(var(--day), 1fr));
  min-width: calc(var(--unit) + var(--days) * var(--day)); position: relative; }
.calx-row + .calx-row, .calx-group + .calx-row { border-top: 1px solid #EDF2F0; }
.calx-unit { grid-column: 1; grid-row: 1; position: sticky; inset-inline-start: 0; z-index: 4; background: #fff; padding: .55rem .9rem;
  display: flex; flex-direction: column; justify-content: center; gap: .25rem; min-width: 0; box-shadow: -1px 0 0 #EDF2F0; }
[dir="ltr"] .calx-unit { box-shadow: 1px 0 0 #EDF2F0; }
.calx-unit a { color: var(--ink); font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: .45rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calx-unit a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.calx-unit .occ { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.calx-unit .occ .meter { flex: 1 1 auto; max-width: 84px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--brand); }
.dot-needs_cleaning { background: var(--lamp); }
.dot-maintenance { background: var(--danger); }
.dot-inactive { background: #B6C3BF; }

.calx-head { position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid #E1E8E5; }
.calx-head .calx-unit { color: var(--muted); font-size: .85rem; font-weight: 500; z-index: 7; }
.calx-day { grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem 0 .5rem; }
.calx-day .dow { font-size: .68rem; color: var(--muted); }
.calx-day .num { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 600; font-size: .95rem;
  font-variant-numeric: tabular-nums; }
.calx-day.is-weekend { background: #F7F4EC; }
.calx-day.is-weekend .dow { color: #8A5A0B; }
.calx-day.is-today .num { background: var(--night); color: var(--lamp); }
.calx-day.is-today .dow { color: var(--ink); font-weight: 700; }

.calx-cell { grid-row: 1; min-height: var(--rowh); align-self: stretch; border-inline-start: 1px solid #F0F4F2; position: relative; display: block; }
.calx-cell.is-weekend { background: #FBF9F3; }
.calx-cell.is-today { background: #FFF6E3; box-shadow: inset 2px 0 0 var(--lamp), inset -2px 0 0 var(--lamp); }
.calx-cell.is-free:hover, .calx-cell.is-free:focus-visible { background: #E6F6F0; outline: none; }
.calx-cell.is-free::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand);
  font-size: 1.25rem; font-weight: 600; opacity: 0; transition: opacity .12s; }
.calx-cell.is-free:hover::after, .calx-cell.is-free:focus-visible::after { opacity: 1; }
.calx-cell.is-past.is-free { background-image: linear-gradient(#fff9, #fff9); }
.calx-cell .clash { position: absolute; top: 3px; inset-inline-start: 50%; transform: translateX(50%); z-index: 3; width: 18px; height: 18px;
  border-radius: 50%; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
[dir="ltr"] .calx-cell .clash { transform: translateX(-50%); }

.stay { grid-row: 1; align-self: center; z-index: 2; height: 36px; border-radius: 999px; display: flex; align-items: center; gap: .4rem;
  padding: 0 .35rem 0 .8rem; min-width: 0; color: #10231F; font-size: .86rem; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(10, 31, 27, .18); transition: transform .12s, box-shadow .12s; }
[dir="rtl"] .stay { padding: 0 .8rem 0 .35rem; }
.stay:hover, .stay:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 16px -8px rgba(10, 31, 27, .55); z-index: 3; }
.stay-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; margin-inline-end: auto;
  position: sticky; inset-inline-start: calc(var(--unit) + .7rem); }
.stay-nights { flex: 0 0 auto; min-width: 24px; height: 24px; padding: 0 .35rem; border-radius: 999px; background: rgba(255, 255, 255, .7);
  display: grid; place-items: center; font-size: .76rem; font-variant-numeric: tabular-nums; }
.stay.cut-start { border-start-start-radius: 0; border-end-start-radius: 0; }
.stay.cut-end { border-start-end-radius: 0; border-end-end-radius: 0; }
.stay.is-conflict { outline: 2px solid var(--danger); outline-offset: 1px; height: 26px; align-self: end; margin-bottom: 4px; opacity: .92; }
.stay.is-conflict ~ .stay.is-conflict { align-self: start; margin-top: 22px; margin-bottom: 0; }
.stay.s-airbnb { background: #FFB4A8; }
.stay.s-booking { background: #A9C8F5; }
.stay.s-gathern { background: #9FE0C2; }
.stay.s-manual { background: var(--night); color: #fff; }
.stay.s-manual .stay-nights { background: var(--night-2); color: var(--mint); }
.stay.s-blocked { color: #3F4F4B; box-shadow: none; border: 1.5px dashed #A9B8B3; }
.calx-group { position: sticky; inset-inline-start: 0; padding: .45rem .9rem; background: #F6F9F8; color: var(--muted); font-size: .82rem;
  font-weight: 600; border-top: 1px solid #EDF2F0; min-width: calc(var(--unit) + var(--days) * var(--day)); }
.legend { margin-top: 1rem; align-items: center; }
.legend i { border-radius: 999px; width: 1.6rem; height: .8rem; }
.legend .s-manual { background: var(--night); }
.legend .lg-weekend { background: #F1EAD6; }
.legend-hint { color: var(--muted); flex-basis: 100%; }
@media (min-width: 980px) {
  body.has-nav .page:has(.calx) { max-width: 1500px; }
  .calx { --day: 34px; }
}
@media (max-width: 700px) {
  .calx { --unit: 128px; --day: 46px; --rowh: 64px; }
  .calx-unit { padding: .5rem .65rem; }
  .calx-unit a { white-space: normal; font-size: .92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; }
  .calx-unit a .dot { display: inline-block; margin-inline-end: .35rem; }
  .calx-month h1 { font-size: 1.35rem; min-width: 8ch; }
  .calx-top .btn { width: 100%; }
}
