/* Rentals Hub – واجهة الموقع */
:root,
html[data-rh-theme="light"] {
  --rh-primary: #0f766e;
  --rh-bg: #ffffff;
  --rh-surface: #f6f7f9;
  --rh-card: #ffffff;
  --rh-text: #17202a;
  --rh-muted: #6b7684;
  --rh-border: #e3e7ec;
  --rh-shadow: 0 4px 18px rgba(20, 30, 50, .08);
}
html[data-rh-theme="dark"] {
  --rh-bg: #0f1419;
  --rh-surface: #161c24;
  --rh-card: #1b232d;
  --rh-text: #e8edf2;
  --rh-muted: #95a1ae;
  --rh-border: #2a3441;
  --rh-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}

/* يطبّق الوضع على خلفية الموقع كاملة */
html[data-rh-theme="dark"] body {
  background: var(--rh-bg);
  color: var(--rh-text);
}

.rh-wrap { max-width: 1200px; margin: 0 auto; padding: 16px; color: var(--rh-text); font-family: inherit; }
.rh-wrap *, .rh-wrap *::before, .rh-wrap *::after { box-sizing: border-box; }
.rh-wrap a { color: var(--rh-primary); text-decoration: none; }

/* أزرار */
.rh-primary-btn, .rh-ghost-btn {
  display: inline-block; border-radius: 10px; padding: 11px 20px; font-size: 0.9375rem;
  cursor: pointer; border: 1px solid var(--rh-primary); text-align: center; line-height: 1.2;
  transition: opacity .15s, transform .15s;
}
.rh-primary-btn { background: var(--rh-primary); color: #fff !important; }
.rh-ghost-btn { background: transparent; color: var(--rh-primary) !important; }
.rh-primary-btn:hover, .rh-ghost-btn:hover { opacity: .88; transform: translateY(-1px); }
.rh-block { display: block; width: 100%; margin-top: 10px; }

/* الأزرار العائمة */
.rh-floating { position: fixed; bottom: 18px; inset-inline-start: 18px; display: flex; gap: 8px; z-index: 9999; }
.rh-btn {
  background: var(--rh-card); color: var(--rh-text) !important; border: 1px solid var(--rh-border);
  border-radius: 999px; padding: 9px 16px; box-shadow: var(--rh-shadow); cursor: pointer; font-size: 0.875rem; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px;
}
.rh-theme-btn .rh-ico-moon { display: none; }
html[data-rh-theme="dark"] .rh-theme-btn .rh-ico-sun { display: none; }
html[data-rh-theme="dark"] .rh-theme-btn .rh-ico-moon { display: inline; }
.rh-switchers { display: inline-flex; gap: 8px; }
.rh-wa-float {
  position: fixed; bottom: 18px; inset-inline-end: 18px; width: 52px; height: 52px; border-radius: 50%;
  background: #25d366; color: #fff !important; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; text-decoration: none; box-shadow: var(--rh-shadow); z-index: 9999;
}

/* الفلترة */
.rh-filter {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 14px; padding: 14px; margin-bottom: 22px;
}
.rh-filter input, .rh-filter select, .rh-form input, .rh-form select, .rh-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--rh-border);
  background: var(--rh-card); color: var(--rh-text); font-size: 0.875rem; font-family: inherit;
}

/* شبكة البطاقات */
.rh-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.rh-card { background: var(--rh-card); border: 1px solid var(--rh-border); border-radius: 16px; overflow: hidden; box-shadow: var(--rh-shadow); display: flex; flex-direction: column; }
.rh-card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--rh-surface); overflow: hidden; }
.rh-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.rh-card:hover .rh-card-img img { transform: scale(1.05); }
.rh-noimg { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 3.5rem; opacity: .4; }
.rh-card.is-rented .rh-card-img img { filter: grayscale(.7); }
.rh-badge { position: absolute; top: 10px; inset-inline-start: 10px; padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; color: #fff; }
.rh-badge-feat { background: #d97706; inset-inline-start: auto; inset-inline-end: 10px; }
.rh-badge-rented { background: #b91c1c; }
.rh-price-lg .rh-badge { position: static; margin-inline-start: 8px; }
.rh-card-body { padding: 14px 16px 18px; }
.rh-card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.75rem; color: var(--rh-muted); margin-bottom: 6px; }
.rh-card-meta span { background: var(--rh-surface); padding: 2px 10px; border-radius: 999px; }
.rh-card-title { margin: 0 0 8px; font-size: 1.125rem; line-height: 1.4; }
.rh-card-title a { color: var(--rh-text) !important; }
.rh-price { color: var(--rh-primary); font-weight: 700; font-size: 1.0625rem; }
.rh-price-lg { font-size: 1.625rem; }
.rh-specs { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rh-border); display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--rh-muted); }
.rh-empty { text-align: center; padding: 40px 0; color: var(--rh-muted); }
.rh-pagination { text-align: center; margin-top: 26px; }
.rh-pagination .page-numbers { display: inline-block; padding: 8px 14px; margin: 2px; border: 1px solid var(--rh-border); border-radius: 8px; color: var(--rh-text); }
.rh-pagination .current { background: var(--rh-primary); color: #fff; border-color: var(--rh-primary); }

/* صفحة العقار */
.rh-gallery-main img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 16px; display: block; }
.rh-gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.rh-thumb { border: 2px solid transparent; border-radius: 10px; padding: 0; background: none; cursor: pointer; flex: 0 0 auto; }
.rh-thumb img { width: 92px; height: 68px; object-fit: cover; border-radius: 8px; display: block; }
.rh-thumb.active { border-color: var(--rh-primary); }
.rh-single-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 22px 0 10px; }
.rh-single-title { margin: 0 0 4px; font-size: 1.875rem; }
.rh-addr { margin: 0; color: var(--rh-muted); }
.rh-facts { list-style: none; padding: 0; margin: 14px 0 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.rh-facts li { background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 12px; padding: 14px; text-align: center; }
.rh-facts strong { display: block; font-size: 1.25rem; }
.rh-facts span { font-size: 0.8125rem; color: var(--rh-muted); }
.rh-single-cols { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.rh-contact { background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 16px; padding: 20px; position: sticky; top: 90px; }
.rh-contact h3 { margin-top: 0; }
.rh-features { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rh-features li { background: var(--rh-surface); border: 1px solid var(--rh-border); padding: 6px 14px; border-radius: 999px; font-size: 0.875rem; }
.rh-map iframe { width: 100%; height: 340px; border: 0; border-radius: 14px; }
.rh-desc { line-height: 1.9; }

/* لوحة التحكم الأمامية */
.rh-dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.rh-dash-head h2 { margin: 0; }
.rh-dash-actions { display: flex; gap: 8px; }
.rh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.rh-stat { background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 14px; padding: 16px; }
.rh-stat strong { display: block; font-size: 1.75rem; color: var(--rh-primary); }
.rh-stat span { color: var(--rh-muted); font-size: 0.8125rem; }
.rh-table-wrap { overflow-x: auto; border: 1px solid var(--rh-border); border-radius: 14px; }
.rh-table { width: 100%; border-collapse: collapse; background: var(--rh-card); }
.rh-table th, .rh-table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--rh-border); font-size: 0.875rem; vertical-align: middle; }
.rh-table th { background: var(--rh-surface); color: var(--rh-muted); font-weight: 600; }
.rh-table img { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; display: block; }
.rh-tag { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.75rem; color: #fff; background: #15803d; cursor: pointer; border: 0; }
.rh-tag.rented { background: #b91c1c; }
.rh-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rh-mini { background: var(--rh-surface); color: var(--rh-text); border: 1px solid var(--rh-border); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 0.8125rem; }
.rh-mini.danger { color: #b91c1c; }

/* النافذة المنبثقة */
.rh-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 100000; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 30px 12px; }
.rh-modal[hidden] { display: none; }
.rh-modal-box { background: var(--rh-bg); color: var(--rh-text); border-radius: 18px; width: 100%; max-width: 820px; padding: 24px; position: relative; }
.rh-modal-close { position: absolute; top: 10px; inset-inline-end: 14px; background: none; border: 0; font-size: 1.875rem; cursor: pointer; color: var(--rh-text); }
.rh-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rh-form label { font-size: 0.8125rem; color: var(--rh-muted); display: block; }
.rh-form label input, .rh-form label select, .rh-form label textarea { margin-top: 5px; color: var(--rh-text); }
.rh-span { grid-column: 1 / -1; }
.rh-checks { display: flex; gap: 20px; align-items: center; }
.rh-checks input { width: auto; margin-inline-end: 6px; }
.rh-media-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rh-media-preview { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.rh-media-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.rh-form-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px; }
.rh-msg { font-size: 0.875rem; }
.rh-msg.ok { color: #15803d; }
.rh-msg.err { color: #b91c1c; }
.rh-login { max-width: 420px; }
.rh-login input[type="text"], .rh-login input[type="password"] { width: 100%; padding: 10px; border: 1px solid var(--rh-border); border-radius: 9px; background: var(--rh-card); color: var(--rh-text); }

/* الجوال */
@media (max-width: 860px) {
  .rh-single-cols { grid-template-columns: 1fr; }
  .rh-contact { position: static; }
  .rh-single-title { font-size: 1.5rem; }
}
@media (max-width: 600px) {
  .rh-form-grid { grid-template-columns: 1fr; }
  .rh-table th:first-child, .rh-table td:first-child { display: none; }
}

/* ألوان الحالات: متوفر / مؤجر / محجوز / يتوفر قريبًا */
.rh-badge.rh-st-available { background: #15803d; }
.rh-badge.rh-st-rented { background: #b91c1c; }
.rh-badge.rh-st-reserved { background: #b45309; }
.rh-badge.rh-st-soon { background: #1d4ed8; }
.rh-card.is-rented .rh-card-img img { filter: grayscale(.7); }
.rh-status-select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--rh-border); background: var(--rh-card); color: var(--rh-text); font-size: 0.8125rem; }
.rh-status-select.rh-st-available { border-color: #15803d; }
.rh-status-select.rh-st-rented { border-color: #b91c1c; }
.rh-status-select.rh-st-reserved { border-color: #b45309; }
.rh-status-select.rh-st-soon { border-color: #1d4ed8; }

/* ===== v1.2: نوع العرض، واتساب، البحث المختصر ===== */
.rh-badge-deal { top: auto; bottom: 10px; background: var(--rh-primary); }
.rh-badge-deal.rh-deal-sale { background: #7c3aed; }
.rh-feat-tag { color: #d97706; font-weight: 700; }
.rh-wa-btn {
	display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px;
	background: #20b65a; color: #fff !important; padding: 10px 14px; border-radius: 8px;
	font-size: 0.875rem; font-weight: 700; text-decoration: none; transition: opacity .15s, transform .15s;
}
.rh-wa-btn:hover { opacity: .9; transform: translateY(-1px); }
.rh-filter-compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rh-dash-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.rh-dash-tools input, .rh-dash-tools select { padding: 9px 12px; border: 1px solid var(--rh-border); border-radius: 8px; background: var(--rh-card); color: var(--rh-text); font: inherit; }
.rh-dash-tools input { flex: 1 1 220px; }
.rh-deal-tag { font-size: 0.6875rem; color: var(--rh-muted); display: block; }
