/* =========================================================================
   Manzil Properties — Design System
   Scoped CSS for /property/ marketplace demo.
   Sits on top of the dark portfolio shell; cards live on a warm cream canvas.
   ========================================================================= */

:root {
  --manzil-bg:        #fbfaf6;
  --manzil-bg-2:      #f3efe6;
  --manzil-ink:       #14202b;
  --manzil-ink-2:     #2a3744;
  --manzil-muted:     #6b7785;
  --manzil-muted-2:   #9aa3ad;
  --manzil-primary:   #1f7a55;
  --manzil-primary-2: #2dab74;
  --manzil-primary-3: #166144;
  --manzil-accent:    #c9a049;
  --manzil-accent-2:  #b88a2f;
  --manzil-rose:      #d96b5c;
  --manzil-rose-2:    #c2503f;
  --manzil-sky:       #3a7bd5;
  --manzil-sky-2:     #2960b3;
  --manzil-card:      #ffffff;
  --manzil-line:      rgba(20, 32, 43, 0.08);
  --manzil-line-2:    rgba(20, 32, 43, 0.14);
  --manzil-shadow:    0 1px 2px rgba(20, 32, 43, 0.04), 0 8px 24px rgba(20, 32, 43, 0.06);
  --manzil-shadow-lg: 0 12px 40px rgba(20, 32, 43, 0.12);

  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1440px;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --ease: cubic-bezier(.2,.7,.2,1);
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 280ms;

  --font-ui: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Fraunces', 'Inter', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ------------------------------ Reset / base ------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.manzil {
  margin: 0;
  padding: 0;
  background: var(--manzil-bg);
  color: var(--manzil-ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.manzil.rtl { direction: rtl; }

img { max-width: 100%; display: block; }

a {
  color: var(--manzil-sky);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--manzil-sky-2); }

button { font-family: inherit; cursor: pointer; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--manzil-ink);
}

h1, h2, h3, h4, h5 { margin: 0 0 .4em; font-weight: 700; line-height: 1.2; color: var(--manzil-ink); }
h1 { font-size: clamp(28px, 4vw, 44px); font-family: var(--font-display); letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

p { margin: 0 0 .8em; color: var(--manzil-ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------- Layout helpers ----------------------------- */

.m-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) { .m-container { padding: 0 28px; } }
@media (min-width: 1024px) { .m-container { padding: 0 40px; } }

.m-section { padding: 56px 0; }
.m-section--tight { padding: 32px 0; }
.m-grid { display: grid; gap: 18px; }
.m-grid-2 { grid-template-columns: 1fr; }
.m-grid-3 { grid-template-columns: 1fr; }
.m-grid-4 { grid-template-columns: 1fr; }
@media (min-width: 480px)  { .m-grid-2 { grid-template-columns: repeat(2, 1fr); } .m-grid-3 { grid-template-columns: repeat(2, 1fr); } .m-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .m-grid-3 { grid-template-columns: repeat(3, 1fr); } .m-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .m-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.m-flex { display: flex; gap: 12px; align-items: center; }
.m-flex-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.m-spacer { flex: 1; }
.m-mt-1 { margin-top: 8px; } .m-mt-2 { margin-top: 16px; } .m-mt-3 { margin-top: 24px; } .m-mt-4 { margin-top: 36px; }
.m-mb-1 { margin-bottom: 8px; } .m-mb-2 { margin-bottom: 16px; } .m-mb-3 { margin-bottom: 24px; } .m-mb-4 { margin-bottom: 36px; }
.m-text-muted { color: var(--manzil-muted); }
.m-text-mono  { font-family: var(--font-mono); }
.m-text-center { text-align: center; }
.m-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- Demo banner ----------------------------- */
.m-demo-banner {
  background: linear-gradient(90deg, rgba(31,122,85,.12), rgba(201,160,73,.12));
  border-bottom: 1px solid var(--manzil-line);
  font-size: 12px;
  color: var(--manzil-ink-2);
  padding: 8px 0;
}
.m-demo-banner strong { color: var(--manzil-primary); margin-inline-end: 6px; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.m-demo-banner .credit { color: var(--manzil-muted); margin-inline-start: 8px; font-size: 11px; }

/* ---------------------------------- Nav ---------------------------------- */
.m-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--manzil-line);
}
.m-nav-inner { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.m-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--manzil-ink); }
.m-logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--manzil-primary) 0%, var(--manzil-primary-2) 60%, var(--manzil-accent) 100%);
  color: white; display: grid; place-items: center; font-weight: 800; font-size: 14px; font-family: var(--font-display);
  box-shadow: 0 4px 12px rgba(31,122,85,.3);
}
.m-nav-links { display: none; gap: 18px; }
.m-nav-links a { color: var(--manzil-ink-2); font-weight: 500; font-size: 14px; padding: 6px 4px; border-bottom: 2px solid transparent; }
.m-nav-links a:hover, .m-nav-links a.active { color: var(--manzil-primary); border-bottom-color: var(--manzil-primary); }
@media (min-width: 768px) { .m-nav-links { display: flex; } }

.m-nav-right { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.m-pill {
  border: 1px solid var(--manzil-line-2);
  background: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--manzil-ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.m-pill:hover { border-color: var(--manzil-primary); color: var(--manzil-primary); }
.m-pill--ghost { background: transparent; }

.m-nav-burger { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: white; border: 1px solid var(--manzil-line); }
@media (min-width: 768px) { .m-nav-burger { display: none; } }

/* ---------------------------- Sheet (mobile menu) ------------------------ */
.m-sheet {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 32, 43, .45);
  display: none;
  animation: m-fade-in var(--t-base) var(--ease);
}
.m-sheet.open { display: block; }
.m-sheet-panel {
  position: absolute; right: 0; top: 0; height: 100%; width: min(360px, 86%);
  background: white; padding: 24px; overflow-y: auto;
  animation: m-slide-in var(--t-slow) var(--ease);
}
.m-sheet a { display: block; padding: 12px 0; border-bottom: 1px solid var(--manzil-line); color: var(--manzil-ink); font-weight: 600; }
@keyframes m-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ---------------------------------- Hero --------------------------------- */
.m-hero {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  text-align: center;
  color: white;
  overflow: hidden;
}
.m-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20,32,43,.55) 0%, rgba(20,32,43,.65) 100%),
    url('https://images.unsplash.com/photo-1512453979798-5ea266f8880c?w=1800&q=80&auto=format') center/cover no-repeat;
  z-index: 0;
}
.m-hero-inner { position: relative; z-index: 1; padding: 64px 20px; width: 100%; max-width: 980px; }
.m-hero h1 { color: white; text-shadow: 0 2px 16px rgba(0,0,0,.25); margin-bottom: 8px; }
.m-hero .m-eyebrow { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.18); color: white; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; }
.m-hero .m-tagline { font-size: clamp(14px, 1.6vw, 17px); color: rgba(255,255,255,.92); margin-bottom: 28px; }

/* --------------------------- Search composer ----------------------------- */
.m-search {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--manzil-shadow-lg);
  padding: 12px;
  display: grid;
  gap: 8px;
  color: var(--manzil-ink);
  text-align: left;
}
.m-search-tabs { display: flex; gap: 4px; padding: 0 4px; }
.m-search-tab { padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--manzil-muted); cursor: pointer; background: transparent; border: 0; }
.m-search-tab.active { background: var(--manzil-ink); color: white; }
.m-search-fields { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .m-search-fields { grid-template-columns: 2fr 1fr 1fr 1fr auto; } }
.m-search-field { background: #f7f6f1; border-radius: 10px; padding: 8px 12px; border: 1px solid transparent; }
.m-search-field:focus-within { background: white; border-color: var(--manzil-primary); }
.m-search-field label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--manzil-muted); font-weight: 700; }
.m-search-field input, .m-search-field select { width: 100%; border: 0; background: transparent; padding: 4px 0; outline: none; font-size: 14px; font-weight: 600; }
.m-search-submit { background: var(--manzil-primary); color: white; border: 0; border-radius: 10px; padding: 14px 22px; font-weight: 700; font-size: 14px; transition: background var(--t-fast) var(--ease); display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.m-search-submit:hover { background: var(--manzil-primary-3); }
.m-search-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.m-search-chip { background: rgba(255,255,255,.16); color: white; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all var(--t-fast) var(--ease); }
.m-search-chip:hover { background: rgba(255,255,255,.28); }

/* --------------------------------- Cards --------------------------------- */
.m-card {
  background: var(--manzil-card);
  border: 1px solid var(--manzil-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
  position: relative;
}
.m-card:hover { transform: translateY(-2px); box-shadow: var(--manzil-shadow); }

.m-listing-card .m-listing-media { position: relative; aspect-ratio: 4 / 3; background: #eee; overflow: hidden; }
.m-listing-card .m-listing-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.m-listing-card:hover .m-listing-media img { transform: scale(1.04); }
.m-listing-media .m-fav { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center; font-size: 16px; transition: all var(--t-fast) var(--ease); }
.m-listing-media .m-fav.on { color: var(--manzil-rose); transform: scale(1.08); }
.m-listing-media .m-fav:hover { background: white; transform: scale(1.06); }
.m-listing-media .m-carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 999px; background: rgba(255,255,255,.88); border: 0; display: grid; place-items: center; font-weight: 700; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.m-listing-card:hover .m-carousel-nav { opacity: 1; }
.m-carousel-nav.prev { left: 8px; }
.m-carousel-nav.next { right: 8px; }

.m-listing-body { padding: 14px 16px 16px; }
.m-listing-price { font-size: 18px; font-weight: 800; color: var(--manzil-ink); letter-spacing: -0.01em; }
.m-listing-price .m-price-rent { font-size: 12px; color: var(--manzil-muted); font-weight: 600; margin-inline-start: 4px; }
.m-listing-title { font-size: 14px; font-weight: 600; color: var(--manzil-ink-2); margin-top: 2px; }
.m-listing-loc { font-size: 12px; color: var(--manzil-muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.m-listing-stats { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--manzil-line); font-size: 12px; color: var(--manzil-ink-2); font-weight: 600; }
.m-listing-stats span { display: flex; align-items: center; gap: 4px; }
.m-listing-agent { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--manzil-muted); }
.m-listing-agent img { width: 24px; height: 24px; border-radius: 999px; object-fit: cover; }

/* ---------------------------------- Badges ------------------------------- */
.m-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.m-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: white; color: var(--manzil-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.m-badge--verified { background: var(--manzil-primary); color: white; }
.m-badge--featured { background: var(--manzil-accent); color: var(--manzil-ink); }
.m-badge--new     { background: var(--manzil-sky); color: white; }
.m-badge--drop    { background: var(--manzil-rose); color: white; }
.m-badge--premium { background: linear-gradient(135deg, var(--manzil-accent), var(--manzil-accent-2)); color: white; }
.m-badge--ghost { background: white; color: var(--manzil-ink-2); border: 1px solid var(--manzil-line); }

/* --------------------------------- Buttons ------------------------------- */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
  background: white;
  color: var(--manzil-ink);
}
.m-btn:hover { transform: translateY(-1px); }
.m-btn:active { transform: translateY(0); }
.m-btn--primary { background: var(--manzil-primary); color: white; }
.m-btn--primary:hover { background: var(--manzil-primary-3); color: white; }
.m-btn--gold { background: var(--manzil-accent); color: var(--manzil-ink); }
.m-btn--gold:hover { background: var(--manzil-accent-2); color: white; }
.m-btn--ghost { background: transparent; border-color: var(--manzil-line-2); }
.m-btn--ghost:hover { border-color: var(--manzil-primary); color: var(--manzil-primary); }
.m-btn--dark { background: var(--manzil-ink); color: white; }
.m-btn--dark:hover { background: var(--manzil-ink-2); color: white; }
.m-btn--block { width: 100%; }
.m-btn--sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.m-btn--lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }
.m-btn--icon { padding: 8px; width: 36px; height: 36px; }

/* ---------------------------------- Forms -------------------------------- */
.m-field { display: grid; gap: 4px; }
.m-field label { font-size: 12px; font-weight: 600; color: var(--manzil-ink-2); }
.m-input, .m-select, .m-textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--manzil-line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
  font-family: inherit;
}
.m-input:focus, .m-select:focus, .m-textarea:focus { border-color: var(--manzil-primary); }
.m-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.m-range { display: flex; align-items: center; gap: 8px; }
.m-range input[type=number] { width: 110px; }

/* --------------------------------- Filters ------------------------------- */
.m-filter-bar {
  background: white;
  border-bottom: 1px solid var(--manzil-line);
  padding: 12px 0;
  position: sticky;
  top: 56px;
  z-index: 30;
}
.m-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.m-filter-row .m-pill.active { background: var(--manzil-ink); color: white; border-color: var(--manzil-ink); }

.m-filter-drawer {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 86vh;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--manzil-shadow-lg);
  padding: 20px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--t-slow) var(--ease);
  z-index: 110;
}
.m-filter-drawer.open { transform: translateY(0); }
.m-filter-drawer-backdrop { position: fixed; inset: 0; background: rgba(20,32,43,.4); z-index: 109; display: none; }
.m-filter-drawer-backdrop.open { display: block; }

/* --------------------------------- Tables -------------------------------- */
.m-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.m-table th, .m-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--manzil-line); }
.m-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--manzil-muted); background: #fafaf6; }
.m-table tr:hover td { background: #fdfcf7; }
.m-table-actions { display: flex; gap: 6px; }
.m-table-empty { padding: 32px; text-align: center; color: var(--manzil-muted); }

/* -------------------------------- Modals --------------------------------- */
.m-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 32, 43, .55);
  display: grid; place-items: center;
  padding: 16px;
  animation: m-fade-in var(--t-base) var(--ease);
}
.m-modal {
  background: white; border-radius: var(--radius-lg);
  max-width: 560px; width: 100%; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--manzil-shadow-lg);
  animation: m-scale-in var(--t-base) var(--ease);
}
.m-modal--lg { max-width: 880px; }
.m-modal--xl { max-width: 1140px; }
.m-modal-head { padding: 18px 20px; border-bottom: 1px solid var(--manzil-line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.m-modal-head h3 { margin: 0; font-size: 16px; }
.m-modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.m-modal-foot { padding: 14px 20px; border-top: 1px solid var(--manzil-line); display: flex; gap: 8px; justify-content: flex-end; }
.m-modal-close { background: transparent; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--manzil-muted); }
.m-modal-close:hover { color: var(--manzil-ink); }
@keyframes m-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* --------------------------------- Toast --------------------------------- */
.m-toast-stack { position: fixed; top: 16px; right: 16px; z-index: 300; display: grid; gap: 8px; }
.m-toast {
  background: var(--manzil-ink); color: white; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: m-toast-in var(--t-base) var(--ease);
  min-width: 220px;
}
.m-toast.success { background: var(--manzil-primary); }
.m-toast.warn { background: var(--manzil-accent); color: var(--manzil-ink); }
.m-toast.error { background: var(--manzil-rose); }
.m-toast.fading { animation: m-toast-out var(--t-base) var(--ease) forwards; }
@keyframes m-toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes m-toast-out { to { transform: translateX(20px); opacity: 0; } }

/* ------------------------------- Skeletons ------------------------------- */
.m-skel {
  background: linear-gradient(90deg, #eee 25%, #f5f5f0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: m-skel 1.4s linear infinite;
  border-radius: 6px;
}
.m-skel--card { height: 280px; }
.m-skel--line { height: 12px; margin: 6px 0; }
.m-skel--circle { width: 36px; height: 36px; border-radius: 999px; }
@keyframes m-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------ Empty states ----------------------------- */
.m-empty { padding: 48px 20px; text-align: center; color: var(--manzil-muted); }
.m-empty-icon { font-size: 36px; margin-bottom: 8px; opacity: .5; }
.m-empty h3 { color: var(--manzil-ink-2); margin-bottom: 6px; }

/* ---------------------------------- Map ---------------------------------- */
.m-map { height: 560px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--manzil-line); }
.m-map--detail { height: 300px; }
.m-map-pin {
  background: var(--manzil-primary); color: white;
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  white-space: nowrap;
}
.m-map-pin::after {
  content: ""; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid var(--manzil-primary);
}
.m-map-pin.featured { background: var(--manzil-accent); color: var(--manzil-ink); }
.m-map-pin.featured::after { border-top-color: var(--manzil-accent); }
.m-map-pin.active { background: var(--manzil-ink); transform: scale(1.1); z-index: 1000; }
.m-map-pin.active::after { border-top-color: var(--manzil-ink); }

.m-split { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .m-split { grid-template-columns: 1.1fr 1fr; } }

/* ---------------------------- Listing detail ----------------------------- */
.m-detail-gallery { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .m-detail-gallery { grid-template-columns: 3fr 2fr; grid-template-rows: 1fr 1fr; } }
.m-detail-gallery .m-gallery-cell { background: #eee; aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; position: relative; cursor: zoom-in; }
.m-detail-gallery .m-gallery-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.m-detail-gallery .m-gallery-cell:hover img { transform: scale(1.03); }
@media (min-width: 768px) {
  .m-detail-gallery .m-gallery-cell:first-child { grid-row: 1 / span 2; aspect-ratio: auto; }
  .m-detail-gallery .m-gallery-cell { aspect-ratio: auto; }
}
.m-gallery-more { position: absolute; bottom: 10px; right: 10px; background: rgba(20,32,43,.78); color: white; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; backdrop-filter: blur(4px); }

.m-detail-grid { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 1024px) { .m-detail-grid { grid-template-columns: 2fr 1fr; } }

.m-detail-rail { position: sticky; top: 80px; align-self: start; }
.m-stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line); margin-top: 16px; }
@media (min-width: 768px) { .m-stat-row { grid-template-columns: repeat(4, 1fr); } }
.m-stat-row .m-stat { display: flex; flex-direction: column; gap: 2px; }
.m-stat-k { font-size: 11px; color: var(--manzil-muted); text-transform: uppercase; letter-spacing: .06em; }
.m-stat-v { font-size: 16px; font-weight: 700; color: var(--manzil-ink); }

.m-amenity-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .m-amenity-grid { grid-template-columns: repeat(3, 1fr); } }
.m-amenity { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: white; border-radius: 10px; border: 1px solid var(--manzil-line); font-size: 13px; }
.m-amenity-icon { font-size: 18px; }

.m-agent-card-rail {
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line);
  padding: 20px; box-shadow: var(--manzil-shadow);
}
.m-agent-head { display: flex; gap: 12px; align-items: center; }
.m-agent-head img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; }
.m-agent-head h4 { margin: 0; }
.m-agent-head .m-meta { font-size: 12px; color: var(--manzil-muted); }
.m-agent-actions { display: grid; gap: 8px; margin-top: 16px; }

/* ------------------------------ Lightbox --------------------------------- */
.m-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 400;
  display: grid; place-items: center;
  animation: m-fade-in var(--t-base) var(--ease);
}
.m-lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; animation: m-scale-in var(--t-base) var(--ease); }
.m-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 999px; background: rgba(255,255,255,.12); border: 0; color: white; font-size: 22px; cursor: pointer; }
.m-lightbox-nav.prev { left: 16px; }
.m-lightbox-nav.next { right: 16px; }
.m-lightbox-nav:hover { background: rgba(255,255,255,.22); }
.m-lightbox-close { position: absolute; top: 16px; right: 16px; background: transparent; color: white; border: 0; font-size: 28px; cursor: pointer; }
.m-lightbox-count { position: absolute; top: 16px; left: 16px; color: white; font-family: var(--font-mono); font-size: 13px; }

/* ------------------------------ Mortgage --------------------------------- */
.m-mortgage {
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line);
  padding: 20px;
}
.m-mortgage-row { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 12px; }
@media (min-width: 480px) { .m-mortgage-row { grid-template-columns: 1fr 1fr; } }
.m-mortgage-result { background: linear-gradient(135deg, rgba(31,122,85,.06), rgba(201,160,73,.08)); border-radius: 12px; padding: 16px; margin-top: 12px; }
.m-mortgage-result .big { font-size: 28px; font-weight: 800; color: var(--manzil-primary); font-family: var(--font-display); }
.m-mortgage-rows { display: grid; gap: 6px; font-size: 13px; margin-top: 8px; }
.m-mortgage-rows div { display: flex; justify-content: space-between; }

/* ---------------------------- Area / agent card -------------------------- */
.m-area-card { position: relative; aspect-ratio: 5/3; border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; }
.m-area-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.m-area-card:hover img { transform: scale(1.06); }
.m-area-card .cap { position: absolute; left: 14px; bottom: 14px; right: 14px; color: white; }
.m-area-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(20,32,43,.78) 100%); }
.m-area-card .cap { z-index: 1; }
.m-area-card h3 { color: white; margin: 0; font-size: 18px; }
.m-area-card .sub { font-size: 12px; color: rgba(255,255,255,.84); }

.m-agent-card { display: flex; gap: 12px; padding: 16px; background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line); align-items: center; }
.m-agent-card img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; }
.m-agent-card h4 { margin: 0; font-size: 14px; }
.m-agent-card .agency { font-size: 12px; color: var(--manzil-muted); }
.m-agent-card .ratings { display: flex; gap: 4px; font-size: 12px; color: var(--manzil-accent); }

/* ---------------------------------- Admin -------------------------------- */
.m-admin { display: grid; grid-template-columns: 1fr; min-height: 100vh; background: #f3f4f6; }
@media (min-width: 1024px) { .m-admin { grid-template-columns: 240px 1fr; } }

.m-admin-side { background: var(--manzil-ink); color: rgba(255,255,255,.85); padding: 18px 12px; }
.m-admin-side .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: white; padding: 4px 8px; margin-bottom: 16px; }
.m-admin-group { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.4); padding: 8px 10px; margin-top: 8px; }
.m-admin-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: rgba(255,255,255,.78); text-decoration: none; font-size: 13px; font-weight: 500; transition: background var(--t-fast) var(--ease); }
.m-admin-link:hover { background: rgba(255,255,255,.06); color: white; }
.m-admin-link.active { background: var(--manzil-primary); color: white; }

.m-admin-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: white; border-bottom: 1px solid var(--manzil-line); position: sticky; top: 0; z-index: 20; }
.m-admin-search { flex: 1; max-width: 420px; }
.m-admin-search input { width: 100%; background: #f6f6f1; border: 1px solid transparent; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.m-admin-content { padding: 24px; }
.m-admin-content h2 { margin-top: 0; }

.m-kpi-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .m-kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .m-kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.m-kpi { background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line); padding: 16px; }
.m-kpi-label { font-size: 11px; color: var(--manzil-muted); text-transform: uppercase; letter-spacing: .06em; }
.m-kpi-value { font-size: 26px; font-weight: 800; color: var(--manzil-ink); font-family: var(--font-display); margin-top: 4px; }
.m-kpi-delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
.m-kpi-delta.up   { color: var(--manzil-primary); }
.m-kpi-delta.down { color: var(--manzil-rose); }

.m-panel { background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line); padding: 20px; }
.m-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.m-panel-head h3 { margin: 0; font-size: 15px; }

/* Hand-rolled charts */
.m-bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 8px 0; }
.m-bars .bar { flex: 1; background: linear-gradient(180deg, var(--manzil-primary-2), var(--manzil-primary)); border-radius: 6px 6px 0 0; min-height: 4px; position: relative; transition: filter var(--t-fast) var(--ease); }
.m-bars .bar:hover { filter: brightness(1.1); }
.m-bars .bar .v { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--manzil-muted); font-weight: 600; }
.m-bars-labels { display: flex; gap: 8px; }
.m-bars-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--manzil-muted); }

.m-line-chart { width: 100%; height: 220px; }
.m-line-chart .axis { stroke: var(--manzil-line-2); stroke-width: 1; }
.m-line-chart .grid { stroke: var(--manzil-line); stroke-width: 1; stroke-dasharray: 4 4; }
.m-line-chart .line { fill: none; stroke: var(--manzil-primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.m-line-chart .area { fill: rgba(31,122,85,0.12); }
.m-line-chart .dot { fill: var(--manzil-primary); }
.m-line-chart .lbl { font-size: 10px; fill: var(--manzil-muted); font-family: var(--font-mono); }

.m-funnel { display: flex; flex-direction: column; gap: 8px; }
.m-funnel-row { display: flex; align-items: center; gap: 12px; }
.m-funnel-row .lbl { width: 130px; font-size: 12px; color: var(--manzil-ink-2); font-weight: 600; }
.m-funnel-row .bar { background: linear-gradient(90deg, var(--manzil-primary-2), var(--manzil-primary)); height: 28px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; color: white; font-size: 12px; font-weight: 700; min-width: 40px; }

/* Calendar (viewings) */
.m-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.m-cal-day { background: #fafaf6; border: 1px solid var(--manzil-line); border-radius: 6px; padding: 6px; min-height: 64px; font-size: 11px; color: var(--manzil-muted); }
.m-cal-day.has-events { background: white; border-color: var(--manzil-primary); }
.m-cal-day .num { font-weight: 700; color: var(--manzil-ink); font-size: 12px; }
.m-cal-day .ev { background: var(--manzil-primary); color: white; padding: 2px 4px; border-radius: 4px; font-size: 9px; margin-top: 2px; }

/* Inbox (inquiries) */
.m-inbox { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1024px) { .m-inbox { grid-template-columns: 320px 1fr; } }
.m-inbox-list { background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line); max-height: 600px; overflow-y: auto; }
.m-inbox-item { padding: 12px 14px; border-bottom: 1px solid var(--manzil-line); cursor: pointer; transition: background var(--t-fast) var(--ease); }
.m-inbox-item:hover { background: #fafaf6; }
.m-inbox-item.active { background: rgba(31,122,85,.08); }
.m-inbox-item .name { font-weight: 700; font-size: 13px; }
.m-inbox-item .preview { font-size: 12px; color: var(--manzil-muted); margin-top: 2px; }
.m-inbox-item .when { font-size: 10px; color: var(--manzil-muted-2); margin-top: 4px; font-family: var(--font-mono); }
.m-inbox-detail { background: white; border-radius: var(--radius-lg); border: 1px solid var(--manzil-line); padding: 20px; }
.m-pipeline { display: flex; gap: 4px; padding: 8px 0; }
.m-pipe-step { flex: 1; padding: 6px 10px; background: #f4f4ef; border-radius: 6px; font-size: 11px; font-weight: 600; text-align: center; color: var(--manzil-muted); }
.m-pipe-step.active { background: var(--manzil-primary); color: white; }
.m-pipe-step.done { background: rgba(31,122,85,.18); color: var(--manzil-primary); }

.m-thread { display: grid; gap: 8px; margin-top: 12px; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.m-msg { padding: 10px 12px; border-radius: 10px; max-width: 86%; font-size: 13px; }
.m-msg.in  { background: #f4f4ef; }
.m-msg.out { background: var(--manzil-primary); color: white; margin-inline-start: auto; }
.m-msg .meta { font-size: 10px; color: var(--manzil-muted); margin-top: 4px; }
.m-msg.out .meta { color: rgba(255,255,255,.7); }

/* Status chips */
.m-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f4f4ef; color: var(--manzil-ink-2); }
.m-chip.new      { background: rgba(58,123,213,.15); color: var(--manzil-sky-2); }
.m-chip.contacted{ background: rgba(201,160,73,.18); color: var(--manzil-accent-2); }
.m-chip.scheduled{ background: rgba(31,122,85,.18); color: var(--manzil-primary); }
.m-chip.won      { background: rgba(31,122,85,.85); color: white; }
.m-chip.lost     { background: rgba(217,107,92,.18); color: var(--manzil-rose-2); }
.m-chip.active   { background: rgba(31,122,85,.18); color: var(--manzil-primary); }
.m-chip.draft    { background: #ebebe5; color: var(--manzil-muted); }
.m-chip.pending  { background: rgba(201,160,73,.18); color: var(--manzil-accent-2); }
.m-chip.sold     { background: rgba(20,32,43,.18); color: var(--manzil-ink-2); }
.m-chip.rented   { background: rgba(58,123,213,.18); color: var(--manzil-sky-2); }
.m-chip.expired  { background: rgba(217,107,92,.16); color: var(--manzil-rose-2); }
.m-chip.verified { background: var(--manzil-primary); color: white; }

/* Bell */
.m-bell { position: relative; }
.m-bell-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 999px; background: var(--manzil-rose); border: 2px solid white; }
.m-bell-panel { position: absolute; right: 0; top: 110%; width: 320px; background: white; border: 1px solid var(--manzil-line); border-radius: var(--radius); box-shadow: var(--manzil-shadow-lg); padding: 8px; display: none; z-index: 40; }
.m-bell-panel.open { display: block; }
.m-bell-item { padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.m-bell-item:hover { background: #fafaf6; }
.m-bell-item .when { font-size: 11px; color: var(--manzil-muted); margin-top: 2px; }
.m-bell-item.unread { background: rgba(31,122,85,.06); }

/* Compare */
.m-compare-table { width: 100%; border-collapse: separate; border-spacing: 12px 0; }
.m-compare-table td { vertical-align: top; padding: 12px; background: white; border: 1px solid var(--manzil-line); border-radius: 12px; font-size: 13px; }
.m-compare-table th { padding: 12px; text-align: left; font-size: 12px; color: var(--manzil-muted); font-weight: 700; width: 140px; }
.m-compare-table img { aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; width: 100%; }

/* Footer */
.m-foot { background: var(--manzil-ink); color: rgba(255,255,255,.7); padding: 40px 0 28px; margin-top: 60px; }
.m-foot a { color: rgba(255,255,255,.78); }
.m-foot a:hover { color: white; }
.m-foot-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .m-foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.m-foot h4 { color: white; font-size: 13px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
.m-foot ul { list-style: none; padding: 0; margin: 0; }
.m-foot ul li { padding: 4px 0; }
.m-foot-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; }

/* Tag/eyebrow */
.m-eyebrow {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(31,122,85,.1); color: var(--manzil-primary);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 12px;
}

/* Section tag (light variant) */
.m-section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.m-section-head h2 { margin: 0; }
.m-section-head .more { font-weight: 600; color: var(--manzil-primary); font-size: 13px; }

/* Pills row */
.m-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.m-pills .m-pill.active { background: var(--manzil-primary); color: white; border-color: var(--manzil-primary); }

/* Star rating */
.m-stars { color: var(--manzil-accent); font-size: 13px; letter-spacing: 1px; }

/* Floorplan placeholder */
.m-floor { background: white; border: 1px solid var(--manzil-line); border-radius: var(--radius); padding: 16px; }
.m-floor svg { width: 100%; height: auto; }
.m-floor-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--manzil-muted); }
.m-floor-legend .sq { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-inline-end: 4px; vertical-align: middle; }

/* Print — turns the listing detail page into a one-page A4 brochure. */
@media print {
  @page { size: A4; margin: 12mm 14mm; }
  /* Hide all chrome and noisy widgets */
  .m-nav, .m-foot, .m-demo-banner, .m-detail-rail, .m-search, .m-filter-bar,
  .m-toast-stack, .m-modal-backdrop, [data-no-print],
  .m-mortgage, #similar-grid, .m-amenity-grid + *, .m-listing-card .m-fav,
  .m-listing-card .m-carousel-nav, button { display: none !important; }
  /* Background to white, ink black */
  body.manzil { background: white !important; color: black !important; font-size: 11pt; }
  /* Make the detail grid single-column */
  .m-detail-grid { grid-template-columns: 1fr !important; gap: 12px !important; margin-top: 10mm !important; }
  /* Print-only brochure header — injected via .m-print-header on the page */
  .m-print-header { display: block !important; margin-bottom: 8mm; padding-bottom: 4mm; border-bottom: 2px solid var(--manzil-primary); }
  .m-print-header h1 { font-size: 18pt !important; margin: 0 0 2mm; color: var(--manzil-primary); font-family: var(--font-display); }
  .m-print-header .meta { font-size: 9pt; color: #555; font-family: var(--font-mono); display: flex; gap: 12px; }
  /* Gallery: collapse to single hero + 2 thumbs */
  .m-detail-gallery { display: grid !important; grid-template-columns: 2fr 1fr !important; grid-template-rows: auto auto !important; gap: 4px !important; max-height: 80mm; }
  .m-detail-gallery .m-gallery-cell { aspect-ratio: auto !important; max-height: 80mm; overflow: hidden; }
  .m-detail-gallery .m-gallery-cell:first-child { grid-row: 1 / span 2; }
  .m-detail-gallery .m-gallery-cell:nth-child(n+4) { display: none !important; }
  .m-gallery-more { display: none !important; }
  /* Cards/panels lose shadows, get tight borders */
  .m-card, .m-panel { box-shadow: none !important; border: 1px solid #ddd !important; padding: 6mm !important; break-inside: avoid; }
  .m-stat-row { grid-template-columns: repeat(4, 1fr) !important; padding: 4mm !important; }
  .m-stat-v { font-size: 12pt !important; }
  /* Amenities: 4-up to fit */
  .m-amenity-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 3mm !important; }
  .m-amenity { padding: 3mm 4mm !important; font-size: 9pt !important; }
  /* Map: hidden (no value in print) */
  .m-map { display: none !important; }
  /* Floor plan: visible but smaller */
  .m-floor svg { max-height: 60mm; }
  /* Print-only agent card — injected from the page */
  .m-print-agent { display: block !important; margin-top: 8mm; padding: 5mm; border: 1px solid #ccc; background: #fafaf6; break-inside: avoid; }
  .m-print-agent h3 { margin: 0 0 2mm; font-size: 12pt; color: var(--manzil-primary); }
  .m-print-agent .row { display: flex; gap: 14mm; font-size: 10pt; margin-top: 2mm; }
  /* Print footer */
  .m-print-footer { display: block !important; margin-top: 8mm; padding-top: 3mm; border-top: 1px solid #ccc; font-size: 8pt; color: #777; display: flex; justify-content: space-between; }
  /* Hide elements only meant for screen */
  .m-print-hide { display: none !important; }
  a { color: inherit; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #888; }
  /* Don't let URL hover hint leak onto listing.html internal links */
  a[href^="listing.html"]::after, a[href^="agent.html"]::after, a[href^="area.html"]::after, a[href^="search.html"]::after, a[href^="mortgage.html"]::after { content: ""; }
}

/* Hide print-only elements when on screen */
.m-print-header, .m-print-agent, .m-print-footer { display: none; }

/* RTL flips */
body.manzil.rtl .m-listing-media .m-fav { left: 10px; right: auto; }
body.manzil.rtl .m-listing-media .m-badges { right: 10px; left: auto; align-items: flex-end; }
body.manzil.rtl .m-carousel-nav.prev { right: 8px; left: auto; }
body.manzil.rtl .m-carousel-nav.next { left: 8px; right: auto; }
body.manzil.rtl .m-admin-side { border-radius: 0; }
