/* ============================================================
   DZ Agency — Design System
   Arabic-first · RTL · mobile-first · professional real-estate
   ============================================================ */

:root {
  /* Brand */
  --brand: #0e7c5a;
  --brand-600: #0c6b4e;
  --brand-700: #0a5c42;
  --brand-50: #e8f4ef;
  --brand-100: #d3eae0;
  --gold: #c9962b;
  --gold-soft: #f6efe0;

  /* Ink & surfaces */
  --ink: #16211d;
  --ink-2: #3a4843;
  --muted: #6b7c76;
  --line: #e4eae8;
  --line-2: #eef2f1;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #fafbfb;

  /* Feedback */
  --ok: #1a8f5a;
  --ok-bg: #e6f7ee;
  --warn: #b9720a;
  --warn-bg: #fff3d6;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --info: #1f5fbf;
  --info-bg: #e7f0ff;

  /* Shape */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(16,33,29,.06), 0 2px 8px rgba(16,33,29,.05);
  --sh-2: 0 6px 24px rgba(16,33,29,.10);
  --maxw: 1180px;

  /* Type */
  --font: "Noto Kufi Arabic", "Segoe UI", "Tahoma", "Noto Naskh Arabic", system-ui, sans-serif;
  --fs: 15px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .4em; color: var(--ink); font-weight: 800; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 40px 0; }
.section--tight { padding: 26px 0; }
.section__head { margin-bottom: 20px; }
.section__title { display: flex; align-items: center; gap: 10px; }
.section__title::before {
  content: ""; width: 6px; height: 26px; border-radius: 4px; background: var(--brand); display: inline-block;
}
.section__sub { color: var(--muted); margin: 4px 0 0; }

/* ---------- top navigation ---------- */
.dz-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.dz-header__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.18rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-700));
  color: #fff; display: grid; place-items: center; font-weight: 900; box-shadow: var(--sh-1);
}
.brand__name span { color: var(--brand-700); }
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: var(--r-sm);
}
.nav a:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.nav .btn { color: #fff; }
.nav-toggle {
  display: none; margin-inline-start: auto; background: var(--brand-50); border: 1px solid var(--line);
  color: var(--brand-700); width: 40px; height: 40px; border-radius: var(--r-sm); font-size: 1.2rem; cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: 10px 18px; border-radius: var(--r-sm); font-size: .95rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--brand-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--lg { padding: 13px 22px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--ghost { background: #fff; color: var(--brand-700); border-color: var(--brand); }
.btn--ghost:hover { background: var(--brand-50); }
.btn--gold { background: var(--gold); border-color: var(--gold); }
.btn--gold:hover { background: #b7861f; }
.btn--danger { background: var(--bad); border-color: var(--bad); }
.btn--danger:hover { background: #a82f23; }
.btn--sm { padding: 6px 12px; font-size: .82rem; }
.btn--light { background: #fff; color: var(--brand-700); border-color: transparent; box-shadow: var(--sh-1); }

/* ---------- badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--brand-50); color: var(--brand-700); letter-spacing: .2px;
}
.badge--sale { background: var(--info-bg); color: var(--info); }
.badge--rent { background: var(--gold-soft); color: #8a6a14; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--muted { background: #eef2f1; color: var(--muted); }
.pill {
  display: inline-block; font-size: .74rem; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.tag {
  display: inline-block; font-size: .74rem; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--brand-50); color: var(--brand-700); margin: 2px 3px 2px 0;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-1); overflow: hidden;
}
.card__body { padding: 14px; }

/* ---------- property card ---------- */
.prop-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.prop-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); transition: transform .12s ease, box-shadow .12s ease; }
.prop-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); text-decoration: none; }
.prop-card__media { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg,#dfe7e4,#cdd8d4); display: grid; place-items: center; color: var(--muted); }
.prop-card__media img { width: 100%; height: 100%; object-fit: cover; }
.prop-card__badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.prop-card__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prop-card__title { font-weight: 800; color: var(--ink); font-size: 1.02rem; }
.prop-card__loc { color: var(--muted); font-size: .85rem; }
.prop-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line-2); }
.prop-card__price { font-weight: 900; color: var(--brand-700); font-size: 1.05rem; }
.prop-card__price small { font-weight: 600; color: var(--muted); font-size: .72rem; }

/* ---------- category cards ---------- */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 12px;
  color: var(--ink); box-shadow: var(--sh-1); transition: transform .12s ease, border-color .12s ease;
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--brand); text-decoration: none; }
.cat-card__icon { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; font-size: 1.6rem; }
.cat-card__name { font-weight: 800; }
.cat-card__sub { color: var(--muted); font-size: .78rem; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(255,255,255,.18), transparent),
    linear-gradient(135deg, var(--brand-700), var(--brand));
  color: #fff; border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 54px 0 90px;
}
.hero__title { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 10px; }
.hero__sub { color: rgba(255,255,255,.9); font-size: 1.05rem; margin: 0 0 22px; max-width: 640px; }
.hero-search {
  background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--sh-2);
  display: grid; gap: 10px; grid-template-columns: 1fr 1fr;
}
.hero-search .hs-full { grid-column: 1 / -1; }
.hero-search .btn { grid-column: 1 / -1; }
.hero-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hero-actions .btn--light { background: rgba(255,255,255,.95); }

/* ---------- stats (manager) ---------- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh-1); }
.stat-card__num { font-size: 1.9rem; font-weight: 900; color: var(--brand-700); line-height: 1.1; }
.stat-card__label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.stat-card--accent { background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; border: none; }
.stat-card--accent .stat-card__num { color: #fff; }
.stat-card--accent .stat-card__label { color: rgba(255,255,255,.85); }
.stat-card__ico { float: inline-end; opacity: .25; font-size: 1.6rem; }

/* ---------- opportunities (manager command center) ---------- */
.opp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.opp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--sh-1); transition: transform .12s, box-shadow .12s, border-color .12s; }
.opp-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--brand); }
.opp-card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.opp-card__row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); }
.opp-card__row > span { font-size: 1.2rem; }
.opp-card__row b { display: block; }
.opp-card__row .muted { font-size: .8rem; }

/* ---------- forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--sh-1); max-width: 760px; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--sh-1); max-width: 760px; }
.form label, .form-card label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.form > label { margin-top: 12px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.input, input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="url"], input[type="password"], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: .95rem; font-family: inherit; color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.check-grid { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

/* ---------- filters bar ---------- */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 18px; box-shadow: var(--sh-1); }
.filterbar .field { margin: 0; }
.filterbar .input, .filterbar select { min-width: 130px; }

/* ---------- tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; box-shadow: var(--sh-1); }
table.dz { width: 100%; border-collapse: collapse; min-width: 720px; }
table.dz th, table.dz td { padding: 11px 13px; text-align: start; border-bottom: 1px solid var(--line-2); font-size: .88rem; vertical-align: middle; }
table.dz th { background: var(--surface-2); font-weight: 800; color: var(--ink-2); position: sticky; top: 0; white-space: nowrap; }
table.dz tbody tr:hover { background: var(--brand-50); }
table.dz tr:last-child td { border-bottom: none; }

/* ---------- alerts & states ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); margin: 14px 0; border: 1px solid; font-size: .92rem; }
.alert--ok { background: var(--ok-bg); border-color: #bfe3d3; color: #0c5c3d; }
.alert--warn { background: var(--warn-bg); border-color: #f0d79a; color: #7c4f05; }
.alert--bad { background: var(--bad-bg); border-color: #f3c4bf; color: #92261b; }
.alert--info { background: var(--info-bg); border-color: #c2d4f5; color: #16407f; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }
.empty__icon { font-size: 2.2rem; opacity: .5; }
.skeleton { background: linear-gradient(90deg, #eef2f1, #e2e8e6, #eef2f1); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-sm); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,33,29,.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--r); max-width: 520px; width: 100%; padding: 22px; box-shadow: var(--sh-2); }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

/* ---------- footer ---------- */
.dz-footer { background: #112622; color: #cfe0d9; margin-top: 50px; }
.dz-footer a { color: #cfe0d9; }
.dz-footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 38px 16px 26px; display: grid; gap: 24px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.dz-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 10px; }
.dz-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.dz-footer__bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 16px; text-align: center; font-size: .8rem; color: #8fb0a5; }

/* ---------- manager shell ---------- */
.mgr-nav { background: #112622; }
.mgr-nav__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; }
.mgr-nav a { color: #cfe0d9; font-weight: 600; font-size: .9rem; padding: 13px 14px; white-space: nowrap; border-bottom: 3px solid transparent; }
.mgr-nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.06); }
.mgr-nav a.active { color: #fff; border-bottom-color: var(--brand); }
.mgr-nav .brand { color: #fff; }
.mgr-nav .brand__mark { background: linear-gradient(135deg, var(--brand), var(--gold)); }

/* ---------- misc ---------- */
.crumbs { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.lead-cta { background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; border-radius: var(--r-lg); padding: 34px; text-align: center; }
.lead-cta h2 { color: #fff; }
.lead-cta p { color: rgba(255,255,255,.9); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .dz-footer__inner { grid-template-columns: 1fr 1fr; }
  .form-row, .two { grid-template-columns: 1fr; }
  .hero-search { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 60px; inset-inline: 0; background: #fff; flex-direction: column; padding: 10px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); }
  .nav-toggle { display: inline-flex; }
  .mgr-nav__inner { font-size: .85rem; }
}
@media (max-width: 520px) {
  .dz-footer__inner { grid-template-columns: 1fr; }
  .section { padding: 28px 0; }
}
