:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --text: #1f2a2a;
  --muted: #545b5a;
  --border: #dcd9cf;
  --primary: #85661c;
  --primary-ink: #ffffff;
  --primary-soft: #f5eedc;
  --accent: #c39a33;
  --danger: #b4443a;
  --danger-soft: #fbeceb;
  --warn: #9a6a12;
  --warn-soft: #fbf3e2;
  --ok: #2f7a43;
  --ok-soft: #e7f4ea;
  --info-soft: #e9eff7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 30, .06), 0 2px 8px rgba(20, 30, 30, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515; --surface: #1e1e1d; --surface-2: #272725; --text: #ecebe7; --muted: #b4b3ac; --border: #33322f;
    --primary: #d4ac4c; --primary-ink: #1a1408; --primary-soft: #3a3019; --accent: #d4ac4c;
    --danger: #e27d72; --danger-soft: #3a2422; --warn: #e0b25a; --warn-soft: #362d1b; --ok: #6cc584; --ok-soft: #1c3324; --info-soft: #1f2a38;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 16px; line-height: 1.6; padding-bottom: 84px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ===== الترويسة ===== */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .6rem 16px; }
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.brand .logo { width: 34px; height: 33px; display: block; }
.login-logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 1.25rem; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-dark { display: block; } .logo-light { display: none; } }
.topnav { display: none; gap: .25rem; flex: 1; flex-wrap: wrap; }
.topnav a { color: var(--muted); padding: .4rem .7rem; border-radius: 9px; font-size: .95rem; position: relative; }
.topnav a.active, .topnav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.top-actions { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }
.pill-count { background: var(--accent); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .4rem; margin-inline-start: .25rem; }
@media (min-width: 1150px) {
  .topnav { display: flex; }
  .menu { display: none; }
  .bottomnav { display: none !important; }
  body { padding-bottom: 2rem; }
}

/* ===== شريط التنقل السفلي للهاتف ===== */
.bottomnav { position: fixed; bottom: 0; inset-inline: 0; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); z-index: 30; }
.bottomnav a { flex: 1; min-width: 0; text-align: center; font-size: .78rem; color: var(--muted); padding: .25rem 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.bottomnav a.active { color: var(--primary); font-weight: 600; }
.bottomnav .ico { font-size: 1.25rem; line-height: 1; }
.bottomnav a.fab .ico { background: var(--primary); color: var(--primary-ink); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-top: -20px; box-shadow: 0 4px 12px rgba(0,0,0,.18); font-size: 1.6rem; }

main { max-width: 1120px; margin: 0 auto; padding: 1rem 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: .25rem; }

/* ===== البطاقات ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card > h2:first-child, .card > .card-head:first-child { margin-bottom: .75rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 2fr 1fr; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .stats.six { grid-template-columns: repeat(6, 1fr); } .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; display: block; color: var(--text); text-decoration: none !important; }
.stat .label { color: var(--muted); font-size: .9rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; }
.stat.alert { border-color: var(--danger); background: var(--danger-soft); }
.stat.alert .value { color: var(--danger); }
.stat.warn { border-color: var(--warn); background: var(--warn-soft); }
/* رسائل واتساب الجاهزة */
.msg-menu { position: relative; }
.msg-menu > summary { list-style: none; cursor: pointer; }
.msg-menu > summary::-webkit-details-marker { display: none; }
.msg-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: .4rem; display: grid; gap: .15rem; width: min(360px, calc(100vw - 32px)); z-index: 40; }
.msg-panel a { display: grid; gap: .15rem; padding: .55rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.msg-panel a:hover { background: var(--primary-soft); }
.msg-panel .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.template-row + .template-row { border-top: 1px solid var(--border); padding-top: .9rem; margin-top: .9rem; }

/* معرض العقار */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.media-item { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; grid-template-rows: auto 1fr; }
.media-item img, .media-item video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.media-file { display: grid; place-items: center; gap: .3rem; aspect-ratio: 4 / 3; text-align: center; padding: .5rem; color: var(--text); font-size: 2rem; text-decoration: none; }
.media-file .small { font-size: .8rem; word-break: break-all; }
.media-item figcaption { padding: .45rem .55rem; display: grid; gap: .3rem; background: var(--surface); }
.media-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.media-actions form { display: inline; }
.upload-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-2); }
.features { margin: .25rem 0 .75rem; padding-inline-start: 1.2rem; }

/* لوحة المراحل */
.board:not(table) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; min-height: 120px; display: grid; gap: .5rem; align-content: start; }
.board-col.drop { outline: 2px dashed var(--primary); outline-offset: -4px; }
.board-col h2 { font-size: .95rem; display: flex; justify-content: space-between; margin: 0 0 .25rem; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .55rem .65rem; display: grid; gap: .3rem; cursor: grab; }
.board-card.dragging { opacity: .5; }
.board-card.late { border-inline-start: 4px solid var(--danger); }
.board-card select { font-size: .85rem; padding: .2rem .4rem; }
.board-card .meta { font-size: .82rem; }
@media (max-width: 700px) { .board:not(table) { grid-auto-columns: 82vw; } }

/* كشف العمولة والطباعة */
@media print {
  .topbar, .bottomnav, .no-print, .flash-wrap { display: none !important; }
  body { background: #fff; padding: 0; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}

.target-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.progress { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: .25rem; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.progress.done > span { background: var(--ok); }
.progress.behind > span { background: var(--danger); }
.progress.lost > span { background: var(--muted); }
.progress > i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .45; }
.targets-table td { vertical-align: top; }
.best-member { border-color: var(--accent); background: var(--primary-soft); }
.best-member .stat { background: var(--surface); }
.best-member .stats { margin-bottom: .5rem; }
.best-item + .best-item { border-top: 1px solid var(--border); padding-top: .75rem; }
.best-name { display: inline-block; font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }

.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick a { background: var(--primary); color: var(--primary-ink); border-radius: var(--radius); padding: .85rem; text-align: center; font-weight: 600; text-decoration: none; }
.quick a.alt { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }

/* ===== القوائم ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--border); padding: .75rem 0; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.item-title { font-weight: 600; color: var(--text); }
.meta { color: var(--muted); font-size: .92rem; display: flex; gap: .2rem .75rem; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: 1.25rem .5rem; }

.client-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: .6rem; display: grid; gap: .35rem; }
.client-card.overdue { border-inline-start: 4px solid var(--danger); }
.client-card.today { border-inline-start: 4px solid var(--warn); }
.client-card .actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .2rem; }

/* ===== الشارات ===== */
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: .86rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--primary); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.st-new { background: var(--info-soft); color: var(--primary); }
.st-interested, .st-viewing_scheduled, .st-viewed, .st-negotiation { background: var(--primary-soft); color: var(--primary); }
.st-needs_followup { background: var(--warn-soft); color: var(--warn); }
.st-sold { background: var(--ok-soft); color: var(--ok); }
.st-not_interested { background: var(--surface-2); color: var(--muted); }

.due { font-size: .92rem; font-weight: 600; padding: .15rem .55rem; border-radius: 8px; display: inline-flex; gap: .3rem; align-items: center; }
.due.overdue { background: var(--danger-soft); color: var(--danger); }
.due.today { background: var(--warn-soft); color: var(--warn); }
.due.upcoming { background: var(--surface-2); color: var(--muted); font-weight: 400; }

/* ===== الأزرار ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); padding: .55rem 1rem; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; min-height: 42px; }
.btn:disabled { opacity: .65; cursor: progress; }
.btn.secondary { background: var(--surface); color: var(--primary); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.small { padding: .25rem .65rem; min-height: 34px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.wa { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn.call { background: var(--surface); color: var(--primary); }
.btn .spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.linkbtn.danger { color: var(--danger); }

/* ===== النماذج ===== */
form.stack { display: grid; gap: .85rem; }
.field { display: grid; gap: .3rem; }
.field label, .label { font-weight: 600; font-size: .92rem; }
.field .hint, .hint { color: var(--muted); font-size: .88rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; min-height: 44px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
input[type=tel], input[type=email], input[type=url], input.ltr { direction: ltr; text-align: right; }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { font: inherit; max-width: 100%; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: .2rem; flex: none; }
.two { display: grid; gap: .85rem; }
@media (min-width: 600px) { .two { grid-template-columns: 1fr 1fr; } }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: .25rem .75rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip:hover, .chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.filters { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }
.member-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.member-tabs a { padding: .55rem 1rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; font-weight: 600; }
.member-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.member-tabs a.active .pill-count { background: rgba(255, 255, 255, .25); }
.filters .q { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr repeat(4, 1fr) auto; } .filters .q { grid-column: auto; } }
.filters .btn { min-height: 44px; }
.tabs { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: .75rem; padding-bottom: 2px; }
.tabs a { white-space: nowrap; padding: .3rem .8rem; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); font-size: .88rem; background: var(--surface); text-decoration: none; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ===== الرسائل ===== */
.flash-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.flash { margin-top: .75rem; padding: .7rem .9rem; border-radius: 10px; display: flex; justify-content: space-between; gap: .5rem; align-items: center; border: 1px solid; }
.flash.success { background: var(--ok-soft); color: var(--ok); border-color: currentColor; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: currentColor; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: currentColor; }
.flash button { background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: .6rem .9rem; margin: 0 0 1rem; }
.errors ul { margin: 0; padding-inline-start: 1.1rem; }
.notice { background: var(--info-soft); border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.inline-alert { padding: .5rem .75rem; border-radius: 10px; font-size: .9rem; display: none; }
.inline-alert.show { display: block; }
.inline-alert.warn { background: var(--warn-soft); color: var(--warn); }
.inline-alert.ok { background: var(--ok-soft); color: var(--ok); }

/* ===== الملف الشخصي ===== */
.profile-head { display: flex; gap: 1rem; align-items: center; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .9rem; }
dl.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 1.1rem .9rem 0; border-inline-start: 2px solid var(--border); margin-inline-start: .35rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline li.sys::before { border-color: var(--muted); }
.pre { white-space: pre-wrap; }
details.box { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .75rem; background: var(--surface); }
details.box summary { cursor: pointer; font-weight: 600; }
.stars { color: var(--accent); letter-spacing: 2px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 400px; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: isolate; font-size: .88em; background: var(--surface-2); padding: .05rem .35rem; border-radius: 6px; word-break: break-all; }
.steps { padding-inline-start: 1.2rem; margin: 0; }
.steps li { margin-bottom: .4rem; }
.hide { display: none !important; }
label.chip input { position: absolute; opacity: 0; pointer-events: none; }
label.chip:has(input:checked) { border-color: var(--primary); color: var(--primary-ink); background: var(--primary); }
label.chip:has(input:focus-visible) { outline: 3px solid var(--primary-soft); }

/* ===== القائمة الكاملة (هاتف/شاشات متوسطة) ===== */
.menu { position: relative; margin-inline-start: auto; }
.menu > summary { list-style: none; cursor: pointer; border: 1px solid var(--border); border-radius: 10px; padding: .35rem .7rem; font-weight: 600; color: var(--text); background: var(--surface); }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: .4rem; display: grid; min-width: 220px; z-index: 40; }
.menu-panel a { padding: .6rem .75rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu-panel a:hover { background: var(--primary-soft); color: var(--primary); }
.menu + .top-actions { margin-inline-start: .5rem; }
@media (max-width: 600px) { .user-name { display: none; } .brand { font-size: .95rem; } }
@media (min-width: 1150px) { .top-actions { margin-inline-start: auto; } }

/* ===== الإجراء الأبرز ===== */
.hero-action { display: flex; align-items: center; gap: .9rem; background: var(--primary); color: var(--primary-ink); border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: .75rem; text-decoration: none !important; box-shadow: 0 4px 14px rgba(133, 102, 28, .25); }
.hero-action .plus { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.9rem; line-height: 1; flex: none; }
.hero-action strong { display: block; font-size: 1.25rem; }
.hero-action .sub { display: block; font-size: .92rem; opacity: .92; }
.secondary-actions { grid-template-columns: repeat(3, 1fr) !important; }
.secondary-actions a { padding: .6rem .4rem; font-size: .95rem; }
.value-sm { font-size: 1.15rem !important; }
.card-alert { border-color: var(--danger); }
.card-alert h2 { color: var(--danger); }
.list.compact > li { padding: .45rem 0; }
.linkish { cursor: pointer; color: var(--primary); }
.fieldset { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; display: grid; gap: .5rem; }

/* ===== الأداء والرسوم ===== */
.perf-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; }
@media (min-width: 640px) { .perf-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .perf-grid { grid-template-columns: repeat(3, 1fr); } }
.perf-card { border: 1px solid var(--border); border-radius: 12px; padding: .75rem .85rem; background: var(--surface); }
.perf-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.perf-value { font-size: 1.6rem; font-weight: 700; }
.perf-prev { color: var(--muted); font-size: .9rem; margin-bottom: .35rem; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .mark { fill: var(--accent); }
svg.chart .bar:hover .mark { fill: var(--primary); }
svg.chart .baseline { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.spend-card h3 { margin-bottom: .25rem; }
.defs { padding-inline-start: 1.1rem; margin: .5rem 0 0; }
.defs li { margin-bottom: .35rem; }
.perf-filters { grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .perf-filters { grid-template-columns: repeat(5, 1fr) auto; } }

/* ===== الجداول (تتحول لبطاقات على الهاتف) ===== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { text-align: start; padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; font-size: .88rem; }
table.data tfoot td { font-weight: 600; background: var(--surface-2); }
.rank { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.big { font-size: 1.2rem; }
@media (max-width: 760px) {
  table.board thead { display: none; }
  table.board, table.board tbody, table.board tfoot, table.board tr, table.board td { display: block; width: 100%; }
  table.board tr { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .75rem; margin-bottom: .6rem; background: var(--surface); }
  table.board td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: .75rem; }
  table.board td::before { content: attr(data-label); color: var(--muted); font-size: .88rem; }
  table.board td:first-child::before { content: ""; }
}
.badge.cs-awaiting_approval { background: var(--warn-soft); color: var(--warn); }
.badge.cs-approved { background: var(--info-soft); color: var(--primary); }
.badge.cs-payable { background: var(--primary-soft); color: var(--primary); }
.badge.cs-paid { background: var(--ok-soft); color: var(--ok); }
.sync-ok { color: var(--ok); } .sync-bad { color: var(--danger); }
.filters > * { min-width: 0; }
.filters input[type=date] { min-width: 0; width: 100%; }
svg.chart { direction: ltr; unicode-bidi: isolate; }
.grid > * { min-width: 0; }

/* ===== الموقع العام للزوار ===== */
/* هوية فاتحة ثابتة: عاجي ورملي مع ذهبي/نحاسي شعار مكان، مستقلة عن الوضع الداكن للوحة الأعضاء */
body.public {
  --ink: #1f1b14; --ink-2: #4d463a; --ink-3: #6f6758;
  --ivory: #fbf8f2; --sand: #f2ebdd; --sand-2: #e7dcc6; --line: #e4dccb;
  --gold: #85661c; --gold-2: #a8812f; --gold-soft: #f3ead6; --deep: #211d16;
  --wa: #1d8a4c; --ok-ink: #2c6b3f;
  --r-lg: 22px; --r-md: 14px;
  color-scheme: light;
  background: var(--ivory); color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-size: 17px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body.public a { color: inherit; text-decoration: none; }
body.public h1, body.public h2, body.public h3 { color: var(--ink); line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
body.public :focus-visible { outline: 3px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }
.pub-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.pub-main { max-width: none; padding: 0; }
.pub-skip { position: absolute; inset-inline-start: 1rem; top: -60px; background: var(--deep); color: #fff !important; padding: .5rem 1rem; border-radius: 10px; z-index: 50; }
.pub-skip:focus { top: .75rem; }
.pub-eyebrow { display: inline-flex; align-items: center; gap: .6rem; color: var(--gold); font-weight: 600; font-size: .9rem; letter-spacing: .04em; margin-bottom: .75rem; }
.pub-eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.pub-slogan { color: var(--ink); font-weight: 500; letter-spacing: 0; }
.pub-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 600px; margin: 0; }
.pub-muted { color: var(--ink-3); font-weight: 400; font-size: .85em; }
.pub-center { text-align: center; margin-top: 2.5rem; }
.pub-link { color: var(--gold) !important; font-weight: 600; }
.pub-link:hover { text-decoration: underline !important; }

/* أزرار */
.pub-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .75rem 1.6rem; border-radius: 999px; font: inherit; font-weight: 600; font-size: 1rem; border: 1.5px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; white-space: nowrap; }
.pub-btn:hover { transform: translateY(-1px); }
.pub-btn-primary { background: var(--deep); color: #fff !important; }
.pub-btn-primary:hover { background: #000; }
.pub-btn-outline { border-color: var(--ink); color: var(--ink) !important; }
.pub-btn-outline:hover { background: var(--ink); color: #fff !important; }
.pub-btn-ghost { border-color: var(--line); color: var(--ink) !important; background: #fff; }
.pub-btn-ghost:hover { border-color: var(--gold); }
.pub-btn-wa { background: var(--wa); color: #fff !important; }
.pub-btn-wa:hover { background: #17733f; }
.pub-btn-block { width: 100%; }
.pub-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }

/* الشريط العلوي */
.pub-top { position: sticky; top: 0; z-index: 30; background: rgba(251, 248, 242, .9); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.pub-top-in { display: flex; align-items: center; gap: 2rem; min-height: 76px; }
.pub-brand img { height: 50px; width: auto; display: block; }
.pub-nav { display: flex; gap: 2rem; margin-inline-start: auto; }
.pub-nav a { font-weight: 500; color: var(--ink-2); padding: .4rem 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.pub-nav a:hover, .pub-nav a.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.pub-login { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1.25rem; border-radius: 999px; background: var(--gold); color: #fff !important; font-weight: 600; font-size: .95rem; transition: background .2s; white-space: nowrap; }
.pub-login:hover { background: #6e5416; }
.pub-menu { display: none; position: relative; }
.pub-menu summary { list-style: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; cursor: pointer; }
.pub-menu summary::-webkit-details-marker { display: none; }
.pub-menu summary span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.pub-menu[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pub-menu[open] summary span:nth-child(2) { opacity: 0; }
.pub-menu[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.pub-menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 40px)); background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 20px 50px rgba(31, 27, 20, .16); padding: .5rem; display: flex; flex-direction: column; }
.pub-menu-panel a { padding: .85rem 1rem; border-radius: 10px; font-weight: 500; }
.pub-menu-panel a:hover { background: var(--sand); }
.pub-menu-panel .pub-menu-wa { margin-top: .35rem; background: var(--wa); color: #fff !important; text-align: center; font-weight: 600; }

/* الافتتاحية */
.pub-hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); background: radial-gradient(1200px 500px at 85% -10%, var(--gold-soft), transparent 60%), var(--ivory); }
.pub-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.pub-hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); margin: 0 0 1.25rem; font-weight: 700; }
.pub-hero h1 em { font-style: normal; color: var(--gold); }
.pub-stats { display: flex; gap: 3rem; margin: 2.75rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.pub-stats div { display: flex; flex-direction: column-reverse; }
.pub-stats dd { margin: 0; font-size: 2.4rem; font-weight: 700; line-height: 1.1; color: var(--ink); }
.pub-stats dt { color: var(--ink-3); font-size: .92rem; }
.pub-hero-visual { position: relative; display: grid; gap: 14px; aspect-ratio: 5 / 5.2; }
.pub-hero-visual img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-lg); display: block; background: var(--sand); box-shadow: 0 30px 60px -20px rgba(31, 27, 20, .35); }

/* أقسام */
.pub-section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.pub-section-tight { padding-top: 2rem; }
.pub-sand { background: var(--sand); }
.pub-sec-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.pub-sec-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 0; }
.pub-pagehead { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); background: radial-gradient(900px 380px at 90% -20%, var(--gold-soft), transparent 60%), var(--ivory); }
.pub-pagehead h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 0 0 .75rem; }
.pub-empty { text-align: center; padding: 3rem 1.25rem; border: 1.5px dashed var(--sand-2); border-radius: var(--r-lg); color: var(--ink-2); background: #fff; }
.pub-empty p { margin: 0 0 1.25rem; }

/* بطاقات المشاريع */
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem 1.75rem; }
.pub-card-link { display: flex; flex-direction: column; height: 100%; }
.pub-card-img { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--sand); }
.pub-card-img > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.pub-card-link:hover .pub-card-img > img { transform: scale(1.05); }
.pub-card-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--sand), var(--sand-2)); }
.pub-card-ph img { width: 26%; height: auto; opacity: .85; }
.pub-chip { position: absolute; top: 14px; inset-inline-start: 14px; background: rgba(255, 255, 255, .95); color: var(--ok-ink); font-size: .82rem; font-weight: 600; padding: .3rem .8rem; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.pub-card-body { padding: 1.25rem .25rem 0; display: flex; flex-direction: column; flex: 1; }
.pub-card-loc { color: var(--gold); font-size: .88rem; font-weight: 600; }
.pub-card-body h3 { font-size: 1.4rem; margin: .2rem 0 .35rem; transition: color .2s; }
.pub-card-link:hover h3 { color: var(--gold); }
.pub-card-body p { margin: 0 0 1rem; color: var(--ink-2); font-size: .98rem; }
.pub-card-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 0 0 1rem; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pub-card-facts dt { font-size: .78rem; color: var(--ink-3); }
.pub-card-facts dd { margin: 0; font-weight: 600; font-size: .98rem; }
.pub-card-more { margin-top: auto; font-weight: 600; font-size: .95rem; color: var(--ink); }
.pub-card-link:hover .pub-card-more { color: var(--gold); }

/* عن مكان */
.pub-about { display: grid; grid-template-columns: 300px 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.pub-about-mark { aspect-ratio: 1; border-radius: 50%; background: var(--ivory); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1.5px rgba(133, 102, 28, .2); }
.pub-about-mark img { width: 42%; height: auto; }
.pub-about h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 0 0 1rem; }
.pub-prose { white-space: pre-line; color: var(--ink-2); font-size: 1.08rem; line-height: 1.95; max-width: 68ch; }

/* تواصل */
.pub-contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; align-items: center; background: var(--deep); color: #fff; border-radius: 28px; padding: clamp(2rem, 5vw, 3.75rem); }
body.public .pub-contact h2 { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0 0 .5rem; }
.pub-contact p { margin: 0; color: rgba(255, 255, 255, .72); }
.pub-contact .pub-eyebrow { color: #d6b25f; }
.pub-contact-ways { display: grid; gap: .85rem; }
.pub-way { display: flex; align-items: center; gap: 1rem; padding: 1.05rem 1.25rem; border-radius: var(--r-md); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #fff !important; transition: background .2s, border-color .2s; }
a.pub-way:hover { background: rgba(255, 255, 255, .1); border-color: rgba(214, 178, 95, .5); }
.pub-way strong { display: block; font-weight: 600; }
.pub-way small { color: rgba(255, 255, 255, .7); font-size: .92rem; }
.pub-way-ico { flex: none; width: 48px; height: 48px; border-radius: 12px; background: rgba(214, 178, 95, .16); position: relative; }
.pub-way-ico::after { content: ""; position: absolute; inset: 12px; background: #d6b25f; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.pub-ico-wa { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8s-.4-.1-.6.1-.7.8-.8 1-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.3-.4.2-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.1 5.1 0 0 0 1.1 2.7 11.7 11.7 0 0 0 4.5 4c1.7.7 2.3.8 3.2.6a2.7 2.7 0 0 0 1.8-1.2 2.2 2.2 0 0 0 .1-1.3c0-.1-.2-.2-.5-.3z'/%3E%3C/svg%3E"); }
.pub-ico-tel { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.2 11.4 11.4 0 0 0 3.6.6 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1 11.4 11.4 0 0 0 .6 3.6 1 1 0 0 1-.3 1z'/%3E%3C/svg%3E"); }
.pub-ico-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 14.5 9 2.5 2.5 0 0 1 12 11.5z'/%3E%3C/svg%3E"); }

/* صفحة المشاريع: التصفية */
.pub-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 1.5rem; }
.pub-filter label { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 200px; font-size: .88rem; color: var(--ink-3); font-weight: 500; }
.pub-filter select { min-height: 50px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); font: inherit; font-size: 1rem; color: var(--ink); }
.pub-filter .pub-link { align-self: center; }
.pub-count { color: var(--ink-3); margin: 0 0 1.5rem; font-size: .95rem; }

/* صفحة المشروع */
.pub-crumbs { display: flex; flex-wrap: wrap; gap: .5rem; color: var(--ink-3); font-size: .9rem; margin-bottom: 1rem; }
.pub-crumbs a:hover { color: var(--gold); }
.pub-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.5rem 0 0; }
.pub-tags li { padding: .35rem 1rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .9rem; font-weight: 500; }
.pub-tags li.is-ok { background: #eaf3ec; border-color: #cfe4d5; color: var(--ok-ink); }
.pub-photos { display: grid; gap: 10px; border-radius: var(--r-lg); overflow: hidden; margin-top: 1rem; height: clamp(280px, 48vw, 540px); }
.pub-photos a { position: relative; display: block; overflow: hidden; background: var(--sand); }
.pub-photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.pub-photos a:hover img { transform: scale(1.03); }
.pub-photos-1 { grid-template-columns: 1fr; }
.pub-photos-2 { grid-template-columns: 1.5fr 1fr; }
.pub-photos-3 { grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr 1fr; }
.pub-photos-3 .is-main { grid-row: span 2; }
.pub-photos-4 { grid-template-columns: 1.5fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pub-photos-4 .is-main { grid-row: span 2; }
.pub-photos-4 a:last-child { grid-column: span 2; }
.pub-photos-5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pub-photos-5 .is-main { grid-row: span 2; }
.pub-photos-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(31, 27, 20, .55); color: #fff; font-weight: 600; font-size: 1.1rem; }
.pub-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(2rem, 4vw, 3.5rem); padding-top: clamp(2rem, 4vw, 3.5rem); padding-bottom: clamp(3rem, 6vw, 5rem); align-items: start; }
.pub-block { margin-bottom: 3rem; }
.pub-block h2 { font-size: 1.6rem; margin: 0 0 1.25rem; }
.pub-videos { display: grid; gap: 1rem; }
.pub-videos video { width: 100%; border-radius: var(--r-md); background: #000; aspect-ratio: 16 / 9; }
.pub-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pub-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--sand); }
.pub-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.pub-unit { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem; transition: border-color .2s, box-shadow .2s; }
.pub-unit:hover { border-color: var(--sand-2); box-shadow: 0 12px 30px -12px rgba(31, 27, 20, .18); }
.pub-unit.is-reserved { background: var(--ivory); }
.pub-unit header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.pub-unit h3 { font-size: 1.15rem; margin: 0; }
.pub-status { font-size: .8rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; white-space: nowrap; }
.pub-status.is-ok { background: #eaf3ec; color: var(--ok-ink); }
.pub-status.is-held { background: #f6ecd8; color: #8a5f12; }
.pub-unit dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: .75rem; margin: 0; padding: .85rem 1rem; background: var(--ivory); border-radius: 10px; }
.pub-unit dt { font-size: .76rem; color: var(--ink-3); }
.pub-unit dd { margin: 0; font-weight: 600; }
.pub-unit-loc { margin: 0; color: var(--ink-3); font-size: .9rem; }
.pub-feat { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; color: var(--ink-2); font-size: .93rem; }
.pub-feat li { padding-inline-start: 1.1rem; position: relative; }
.pub-feat li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); }
.pub-unit-ask { margin-top: auto; padding-top: .5rem; color: var(--wa) !important; font-weight: 600; font-size: .95rem; }
.pub-aside { position: sticky; top: 100px; }
.pub-aside-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem; box-shadow: 0 24px 60px -24px rgba(31, 27, 20, .22); display: flex; flex-direction: column; gap: .75rem; }
.pub-aside-card h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.pub-summary { margin: 0 0 .75rem; }
.pub-summary div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.pub-summary dt { color: var(--ink-3); }
.pub-summary dd { margin: 0; font-weight: 600; text-align: end; }
.pub-map { text-align: center; padding-top: .25rem; }
.pub-mobilebar { display: none; }

/* التذييل */
.pub-foot { background: var(--deep); color: rgba(255, 255, 255, .7); padding-top: clamp(3rem, 6vw, 4.5rem); font-size: .95rem; }
.pub-foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.pub-foot-brand img { height: 56px; width: auto; display: block; }
.pub-foot-brand p { margin: 1.25rem 0 0; max-width: 380px; line-height: 1.85; }
.pub-ico-ig { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5zm0 2a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3zm5 3.5a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9zm0 2a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM17.3 5.5a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4z'/%3E%3C/svg%3E"); }
.pub-ico-fb { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 22v-8.2h2.8l.4-3.2h-3.2V8.5c0-.9.3-1.6 1.6-1.6h1.7V4.1a23 23 0 0 0-2.5-.1c-2.5 0-4.2 1.5-4.2 4.3v2.4H7.3v3.2h2.8V22z'/%3E%3C/svg%3E"); }
.pub-social { display: flex; gap: .6rem; margin-top: 1.25rem; }
.pub-social a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(214, 178, 95, .45); display: grid; place-items: center; }
.pub-social a:hover, .pub-social a:focus-visible { background: rgba(214, 178, 95, .16); }
.pub-social span { width: 20px; height: 20px; background: #d6b25f; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
body.public .pub-foot h2 { color: #fff; font-size: 1rem; margin: 0 0 1rem; }
.pub-foot-grid a, .pub-foot-grid span { display: block; padding: .25rem 0; color: rgba(255, 255, 255, .7); }
.pub-foot a:hover { color: #fff; }
.pub-foot-grid [dir=ltr], .pub-way small[dir=ltr] { text-align: right; unicode-bidi: isolate; }
.pub-foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 1.25rem; padding-bottom: 1.5rem; font-size: .88rem; }
.pub-foot-login { display: inline-flex; align-items: center; min-height: 40px; padding: .35rem 1.1rem; border: 1px solid rgba(214, 178, 95, .55); border-radius: 999px; color: #d6b25f !important; font-weight: 600; }
.pub-foot-login:hover { background: rgba(214, 178, 95, .12); }

@media (prefers-reduced-motion: reduce) { body.public * { transition: none !important; } }
@media (max-width: 1000px) {
  .pub-nav { gap: 1.25rem; }
  .pub-detail { grid-template-columns: 1fr; }
  .pub-aside { position: static; }
  .pub-contact { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .pub-nav { display: none; }
  /* القائمة: الزر في طرف الشريط، واللوحة بعرض الشاشة تحته (لا تخرج عن الشاشة في RTL) */
  .pub-top-in { position: relative; gap: .75rem; min-height: 68px; }
  .pub-menu { display: block; position: static; margin-inline-start: auto; }
  .pub-login { margin-inline-start: auto; }
  .pub-login ~ .pub-menu { margin-inline-start: 0; }
  .pub-menu-panel { inset-inline: 16px; width: auto; top: calc(100% + 8px); max-height: calc(100dvh - 100px); overflow-y: auto; z-index: 40; }
  .pub-hero-grid { grid-template-columns: 1fr; }
  .pub-hero-visual { aspect-ratio: 4 / 3; order: -1; }
  .pub-about { grid-template-columns: 1fr; }
  .pub-about-mark { width: 160px; }
  .pub-foot-grid { grid-template-columns: 1fr 1fr; }
  .pub-foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body.public { font-size: 16px; }
  .pub-wrap { padding: 0 16px; }
  .pub-brand img { height: 42px; }
  .pub-login { min-height: 42px; padding: .4rem .95rem; font-size: .9rem; }
  .pub-grid { grid-template-columns: 1fr; }
  .pub-stats { gap: 2rem; }
  .pub-stats dd { font-size: 2rem; }
  .pub-actions .pub-btn { flex: 1 1 100%; }
  .pub-photos { height: auto; grid-template-columns: 1fr 1fr !important; grid-template-rows: auto !important; }
  .pub-photos a { aspect-ratio: 4 / 3; grid-row: auto !important; grid-column: auto !important; }
  .pub-photos .is-main { grid-column: 1 / -1 !important; }
  .pub-filter { padding: 1rem; }
  .pub-mobilebar { display: flex; gap: .6rem; position: fixed; inset-inline: 0; bottom: 0; z-index: 25; padding: .7rem 16px calc(.7rem + env(safe-area-inset-bottom)); background: rgba(251, 248, 242, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .pub-mobilebar .pub-btn { flex: 1; min-height: 50px; }
  body.public:has(.pub-mobilebar) .pub-foot { padding-bottom: 76px; }
  .pub-foot-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}
