/* فلسفة التصميم: طبقات RTL خفيفة فوق خريطة كاملة الارتفاع؛ الأسعار والإجراء المباشر هما أولوية الواجهة. */
/* ==========================================================
   نظام التصميم - منصة العقارات
   Design tokens
   ========================================================== */
:root {
    --navy-900: #1c2333;
    --navy-800: #253044;
    --navy-700: #303d52;
    --navy-600: #3c4a60;

    /* اللون الأساسي: أخضر الخريطة */
    --gold-500: #178a4c;
    --gold-400: #1fa85d;
    --gold-100: #d9f3e4;

    /* اللون الثانوي: أزرق الخريطة */
    --blue-500: #1d6fd6;
    --blue-400: #3b86e6;
    --blue-100: #e2efff;

    --gray-50:  #f7f8fa;
    --gray-100: #eef1f5;
    --gray-200: #e3e7ed;
    --gray-300: #cbd2dc;
    --gray-500: #7c879a;
    --gray-700: #454f60;
    --gray-900: #1c2333;

    --success: #178a4c;
    --danger:  #d94f4f;
    --warning: #e0a628;
    --info:    #1d6fd6;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, .14);

    --transition: all .2s cubic-bezier(.4,0,.2,1);

    /* متغيرات دلالية تتغيّر تلقائياً بين الثيم الليلي والنهاري */
    --page-bg: var(--gray-50);
    --surface-bg: #ffffff;
    --surface-border: var(--gray-100);
    --heading-color: var(--navy-900);
    --body-text-color: var(--gray-900);
    --navbar-bg: rgba(28, 35, 51, .97);
}

/* ==========================================================
   الثيم الليلي - يُفعَّل بإضافة data-bs-theme="dark" على <html>
   نعيد فقط تعريف قيم نفس المتغيرات، فتنعكس تلقائياً بكل الموقع
   ========================================================== */
[data-bs-theme="dark"] {
    --gray-50:  #0d0f14;
    --gray-100: #1c212a;
    --gray-200: #262c37;
    --gray-300: #394152;
    --gray-500: #98a2b3;
    --gray-700: #c7cdd8;
    --gray-900: #f2f4f7;

    --page-bg: #0d0f14;
    --surface-bg: #171b23;
    --surface-border: #262c37;
    --heading-color: #f2f4f7;
    --body-text-color: #d7dce4;
    --navbar-bg: rgba(6, 8, 12, .97);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .4);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, .5);

    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Tajawal', system-ui, sans-serif;
    background: var(--page-bg);
    color: var(--body-text-color);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5, h6 { color: var(--heading-color); letter-spacing: -.01em; }

a { transition: var(--transition); }

.text-brand { color: var(--heading-color) !important; }
.text-primary-brand { color: var(--gold-500) !important; }
.bg-brand { background: var(--navy-900) !important; }

/* ==========================================================
   الأزرار
   ========================================================== */
.btn { border-radius: var(--radius-sm); font-weight: 600; padding: .6rem 1.3rem; transition: var(--transition); border-width: 1.5px; }
.btn-sm { padding: .4rem .9rem; border-radius: 8px; }

.btn-brand {
    background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(10, 25, 48, .25);
}
.btn-brand:hover { background: linear-gradient(135deg, var(--navy-900), #060f1e); color: var(--gold-400); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(10, 25, 48, .32); }
.btn-brand:active { transform: translateY(0); }

.btn-outline-brand { border: 1.5px solid var(--navy-800); color: var(--navy-800); background: var(--surface-bg); }
.btn-outline-brand:hover { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #178456; border-color: #178456; }

.btn-outline-success { color: var(--success); border-color: var(--success); }
.btn-outline-success:hover { background: var(--success); border-color: var(--success); }

.btn-outline-danger { color: var(--danger); border-color: var(--danger); }
.btn-outline-warning { color: var(--warning); border-color: var(--warning); }

/* ==========================================================
   الحقول والنماذج
   ========================================================== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--surface-border);
    padding: .65rem .9rem;
    font-size: .95rem;
    transition: var(--transition);
    background: var(--surface-bg);
    color: var(--body-text-color);
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(23, 138, 76, .14);
}
.form-label { font-weight: 600; font-size: .88rem; color: var(--gray-700); margin-bottom: .4rem; }

/* ==========================================================
   شريط التنقل
   ========================================================== */
.main-navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,.15);
    padding: .8rem 0;
}
.main-navbar .navbar-brand { font-size: 1.25rem; color: #fff; display: flex; align-items: center; gap: 8px; }
.main-navbar .navbar-brand i { color: var(--gold-500); }
.main-navbar .nav-link { color: rgba(255,255,255,.82); font-weight: 500; padding: .5rem 1rem !important; border-radius: var(--radius-sm); }
.main-navbar .nav-link:hover { color: var(--gold-400); background: rgba(255,255,255,.06); }
.main-navbar .dropdown-menu { border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: .5rem; margin-top: .5rem; }
.main-navbar .dropdown-item { border-radius: 8px; padding: .55rem .9rem; font-size: .9rem; }
.main-navbar .dropdown-item:hover { background: var(--gray-100); }
.main-navbar .btn-outline-light { border-radius: var(--radius-sm); font-weight: 600; border-width: 1.5px; }
.main-navbar .btn-outline-light:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); }
.main-navbar .navbar-toggler { border: none; box-shadow: none !important; }

/* ==========================================================
   التذييل
   ========================================================== */
.site-footer { background: var(--navy-900); }
.footer-link { color: rgba(255,255,255,.72); text-decoration: none; font-size: .92rem; }
.footer-link:hover { color: var(--gold-400); padding-inline-start: 3px; }

/* ==========================================================
   الهيرو (Hero) - تصميم جديد بخلفية معمارية داكنة
   ========================================================== */
.hero-v2 {
    position: relative;
    overflow: hidden;
    padding-block: 4rem 2.5rem;
    min-height: 620px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(8,9,12,.55) 0%, rgba(8,9,12,.88) 75%, var(--page-bg) 100%),
        radial-gradient(ellipse at 20% 0%, rgba(23,138,76,.25) 0%, transparent 45%),
        linear-gradient(135deg, #14171d 0%, #0a0c10 100%);
}

/* سلايدر صور خلفية ضخم وباهت - يعرض أحدث صور العقارات المضافة فعلياً */
.hero-bg-slider { position: absolute; inset: 0; z-index: 0; }
.hero-bg-slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 2s ease-in-out;
    transform: scale(1.06);
}
.hero-bg-slide.active { opacity: .32; }
[data-bs-theme="light"] .hero-bg-slide.active { opacity: .16; }
.hero-v2-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 70%);
    pointer-events: none;
}
.hero-v2 > .container { position: relative; z-index: 1; }

.hero-v2-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(23,138,76,.15); border: 1px solid rgba(23,138,76,.35);
    color: var(--gold-400); padding: .35rem .9rem; border-radius: 100px;
    font-size: .78rem; font-weight: 700; margin-bottom: 1rem;
}
.hero-v2-title { font-size: 2.4rem; font-weight: 800; color: #fff; margin-bottom: .5rem; }
.hero-v2-subtitle { color: rgba(255,255,255,.65); font-size: 1rem; margin-bottom: 0; }

.hero-search-card {
    max-width: 780px; margin: 2rem auto 0;
    background: rgba(23, 27, 34, .9); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1.1rem;
}
[data-bs-theme="light"] .hero-search-card { background: rgba(255,255,255,.97); }

.hero-search-tabs { display: flex; gap: 6px; margin-bottom: .9rem; }
.hero-search-tabs input { position: absolute; opacity: 0; width: 0; height: 0; }
.hero-search-tabs label {
    flex: 1; text-align: center; padding: .55rem .5rem; border-radius: var(--radius-sm);
    font-weight: 700; font-size: .85rem; color: var(--gray-500); cursor: pointer;
    background: rgba(255,255,255,.04); border: 1px solid var(--surface-border); transition: var(--transition);
}
.hero-search-tabs input:checked + label { background: var(--gold-500); color: #fff; border-color: var(--gold-500); }

.hero-search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-search-field {
    flex: 1 1 180px; display: flex; align-items: center; gap: 8px;
    background: var(--page-bg); border: 1px solid var(--surface-border); border-radius: var(--radius-sm);
    padding: .1rem .9rem;
}
.hero-search-field i { color: var(--gold-500); flex-shrink: 0; }
.hero-search-field select, .hero-search-field input {
    border: none; background: transparent; outline: none; box-shadow: none;
    padding: .65rem 0; color: var(--body-text-color); font-size: .9rem; width: 100%;
}
.hero-search-btn {
    flex-shrink: 0; border: none; border-radius: var(--radius-sm); padding: .7rem 2rem;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400)); color: #fff;
    font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 6px;
    box-shadow: 0 4px 14px rgba(23,138,76,.35); transition: var(--transition);
}
.hero-search-btn:hover { filter: brightness(1.08); }

.hero-stats-row {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
    max-width: 780px; margin: 1.75rem auto 0;
}
.hero-stat {
    flex: 1 1 90px; display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-md); padding: .9rem .5rem; text-decoration: none;
    transition: var(--transition);
}
[data-bs-theme="light"] .hero-stat { background: var(--surface-bg); border-color: var(--surface-border); }
.hero-stat:hover { transform: translateY(-3px); border-color: var(--gold-500); }
.hero-stat i { color: var(--gold-500); font-size: 1.2rem; }
.hero-stat strong { color: #fff; font-size: 1.05rem; font-weight: 800; }
[data-bs-theme="light"] .hero-stat strong { color: var(--heading-color); }
.hero-stat span { color: rgba(255,255,255,.55); font-size: .74rem; }
[data-bs-theme="light"] .hero-stat span { color: var(--gray-500); }

@media (max-width: 767.98px) {
    .hero-v2 { padding-block: 2.5rem 2rem; min-height: auto; }
    .hero-v2-title { font-size: 1.6rem; }
    .hero-search-row { flex-direction: column; }
    .hero-search-field { flex: 0 0 auto; width: 100%; }
    .hero-search-field select, .hero-search-field input { padding: .55rem 0; font-size: .85rem; }
    .hero-search-btn { width: 100%; justify-content: center; }
    .hero-stat { flex: 1 1 45%; }
}

/* ==========================================================
   بطاقة العقار (rc-card)
   ========================================================== */
.rc-card {
    position: relative;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--surface-bg);
    display: flex;
    flex-direction: column;
}
.rc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }

.rc-card-img-link { display: block; }
.rc-card-img { position: relative; height: 210px; overflow: hidden; background: var(--gray-100); }
.rc-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.rc-card:hover .rc-card-img img { transform: scale(1.08); }

.rc-type-badge {
    position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
    background: rgba(13,15,20,.65); backdrop-filter: blur(4px); color: #fff;
    padding: .3rem .75rem; border-radius: 100px; font-weight: 600; font-size: .7rem;
}
.rc-listing-badge {
    position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
    background: var(--gold-500); color: #fff;
    padding: .3rem .75rem; border-radius: 100px; font-weight: 700; font-size: .7rem;
    box-shadow: var(--shadow-sm);
}
.rc-listing-badge.rent { background: var(--info); }

.rc-heart {
    position: absolute; top: 54px; inset-inline-end: 12px; z-index: 3;
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: rgba(13,15,20,.55); backdrop-filter: blur(4px); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .95rem;
    transition: var(--transition); cursor: pointer;
}
.rc-heart:hover { background: var(--gold-500); }
.rc-heart.active { background: var(--gold-500); color: #fff; }

.rc-card-body { padding: 1.05rem 1.15rem 1.2rem; flex-grow: 1; display: flex; flex-direction: column; }
.rc-title { color: var(--heading-color); font-weight: 700; font-size: .98rem; margin-bottom: .3rem; }
.rc-location { color: var(--gray-500); font-size: .8rem; margin-bottom: .6rem; }
.rc-location i { color: var(--gold-500); }

.rc-specs {
    display: flex; gap: 14px; margin-bottom: .8rem; padding-bottom: .8rem;
    border-bottom: 1px dashed var(--surface-border);
}
.rc-specs span { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--gray-500); }
.rc-specs i { color: var(--gray-500); }

.rc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.rc-price { font-weight: 800; font-size: 1.08rem; color: var(--heading-color); }
.rc-price::after { content: ""; }
.rc-arrow {
    width: 30px; height: 30px; border-radius: 50%; background: var(--gray-100);
    color: var(--gold-500); display: flex; align-items: center; justify-content: center;
    font-size: .8rem; transition: var(--transition);
}
.rc-card:hover .rc-arrow { background: var(--gold-500); color: #fff; }

/* ==========================================================
   الخرائط
   ========================================================== */
.map-box { width: 100%; height: 70vh; min-height: 460px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); position: relative; }

.rsmap-fullscreen-btn {
    position: absolute; top: 10px; left: 10px; z-index: 500;
    width: 38px; height: 38px; border: none; border-radius: 10px;
    background: var(--surface-bg); color: var(--heading-color); box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem; cursor: pointer;
    transition: var(--transition);
}
.rsmap-fullscreen-btn:hover { background: var(--gold-100); color: var(--navy-900); }

.map-box:fullscreen,
.leaflet-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
}
.map-box:-webkit-full-screen { width: 100vw !important; height: 100vh !important; border-radius: 0; }

/* ==========================================================
   وضع ملء الشاشة الحقيقي لخريطة صفحة البحث
   ========================================================== */
#mapView { position: relative; }
#mapView.map-fullscreen-mode {
    position: fixed;
    right: 0;
    left: 0;
    z-index: 1015;
    background: var(--surface-bg);
    margin: 0;
    padding: 0;
}
#mapView.map-fullscreen-mode .map-box {
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}
body.map-mode-active { overflow: hidden; }

/* ==========================================================
   صفحة التفاصيل
   ========================================================== */
.main-gallery-img { height: 460px; object-fit: cover; border-radius: var(--radius-lg); }
.thumb-row .thumb-img { height: 106px; object-fit: cover; cursor: pointer; border: 2px solid transparent; border-radius: var(--radius-sm); transition: var(--transition); }
.thumb-row .thumb-img:hover { border-color: var(--gold-500); transform: scale(1.02); }

.specs-grid .spec-box {
    background: var(--surface-bg); border-radius: var(--radius-md); padding: 1.1rem .6rem; text-align: center;
    box-shadow: var(--shadow-sm); border: 1px solid var(--surface-border); height: 100%;
    transition: var(--transition);
}
.specs-grid .spec-box:hover { box-shadow: var(--shadow-md); border-color: var(--gold-100); }
.spec-box i { font-size: 1.5rem; color: var(--gold-500); display: block; margin-bottom: 8px; }
.spec-box span { display: block; font-weight: 700; color: var(--heading-color); font-size: .98rem; }
.spec-box small { color: var(--gray-500); font-size: .78rem; }

.license-box { background: var(--surface-bg); border-radius: var(--radius-md); padding: 1.25rem 1.4rem; border-inline-start: 4px solid var(--gold-500); box-shadow: var(--shadow-sm); }

.contact-box { border: 1px solid var(--surface-border); border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-md) !important; background: var(--surface-bg); padding: 1.4rem; }

/* شريط المسار (Breadcrumb) وأزرار سريعة أعلى صفحة التفاصيل */
.pd-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--gray-500); flex-wrap: wrap; }
.pd-breadcrumb a { color: var(--gray-500); text-decoration: none; }
.pd-breadcrumb a:hover { color: var(--gold-500); }
.pd-breadcrumb i { font-size: .65rem; }
.pd-breadcrumb span { color: var(--heading-color); font-weight: 600; }

.pd-icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--surface-border);
    background: var(--surface-bg); color: var(--heading-color); display: flex; align-items: center;
    justify-content: center; transition: var(--transition);
}
.pd-icon-btn:hover { background: var(--gold-500); color: #fff; border-color: var(--gold-500); }
.pd-icon-btn.active { background: var(--gold-500); color: #fff; border-color: var(--gold-500); }
/* عند استخدام زر القلب (rc-heart) كزر أيقونة عادي بصفحة التفاصيل، نلغي التموضع المطلق الخاص ببطاقات العقار */
.pd-icon-btn.rc-heart { position: static; width: 40px; height: 40px; top: auto; inset-inline-end: auto; }

.pd-gallery-counter {
    position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
    background: rgba(13,15,20,.65); backdrop-filter: blur(4px); color: #fff;
    padding: .35rem .8rem; border-radius: 100px; font-size: .78rem; font-weight: 600;
}

.pd-header-card { background: var(--surface-bg); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; margin-bottom: 1.5rem; }
.pd-section-card { background: var(--surface-bg); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; }

.pd-agent-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1.1rem; }
.pd-agent-avatar {
    width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.pd-agent-header strong { display: block; color: var(--heading-color); font-size: .98rem; }
.pd-agent-header span { display: block; color: var(--gray-500); font-size: .78rem; }

.pd-price-strip {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--page-bg); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem;
}
.pd-price-strip strong { font-size: 1.15rem; }

.pd-meta-row {
    display: flex; justify-content: space-between; margin-top: 1.1rem; padding-top: 1.1rem;
    border-top: 1px dashed var(--surface-border); font-size: .78rem; color: var(--gray-500);
}

/* ==========================================================
   الفلاتر (صفحة البحث)
   ========================================================== */
.filter-box { border-radius: var(--radius-lg) !important; border: 1px solid var(--surface-border); }
#viewTabs .nav-link {
    border-radius: 100px; font-weight: 600; font-size: .88rem; color: var(--gray-700);
    padding: .5rem 1.2rem; border: 1.5px solid var(--gray-200); margin-inline-end: .5rem;
}
#viewTabs .nav-link.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

/* ترقيم الصفحات */
.pagination .page-link { border-radius: 8px !important; margin: 0 3px; border: 1.5px solid var(--gray-200); color: var(--navy-800); font-weight: 600; }
.pagination .page-item.active .page-link { background: var(--navy-900); border-color: var(--navy-900); }

/* ==========================================================
   لوحة تحكم الأدمن
   ========================================================== */
.admin-login-body { min-height: 100vh; background: var(--page-bg); }

.login-split { display: flex; min-height: 100vh; }
.login-split-form { flex: 1 1 46%; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--page-bg); }
.login-form-inner { width: 100%; max-width: 380px; }
.login-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-500); font-weight: 800; font-size: 1.15rem; }

.login-split-visual {
    flex: 1 1 54%; position: relative; overflow: hidden; display: none;
    background: radial-gradient(ellipse at 30% 20%, rgba(23,138,76,.35) 0%, transparent 55%), linear-gradient(150deg, #14171d 0%, #06070a 100%);
}
.login-visual-overlay {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse at 50% 50%, #000 0%, transparent 75%);
}
.login-visual-content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 3rem; }
.login-visual-content i { font-size: 3.5rem; color: var(--gold-500); margin-bottom: 1rem; }
.login-visual-content h3 { color: #fff; font-weight: 800; margin-bottom: .5rem; }
.login-visual-content p { color: rgba(255,255,255,.6); max-width: 340px; margin: 0 auto; }

@media (min-width: 992px) {
    .login-split-visual { display: block; }
}

.admin-layout { min-height: 100vh; }
.admin-sidebar {
    width: 260px; background: var(--navy-900); flex-shrink: 0; min-height: 100vh;
    position: sticky; top: 0; align-self: flex-start; overflow-y: auto;
}
.admin-nav-link {
    display: flex; align-items: center; gap: 10px; padding: .7rem .9rem; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.75); text-decoration: none; margin-bottom: 3px; font-size: .9rem; font-weight: 500;
    transition: var(--transition);
}
.admin-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.admin-nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav-link.active { background: linear-gradient(135deg, var(--gold-500), var(--gold-400)); color: #fff; font-weight: 700; }

.admin-content { background: var(--page-bg); min-height: 100vh; width: 100%; }
.admin-topbar {
    display: none;
    background: var(--surface-bg); border-bottom: 1px solid var(--surface-border); padding: .8rem 1rem;
    align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 900; box-shadow: var(--shadow-sm);
}
.admin-menu-toggle { background: var(--navy-900); color: #fff; border: none; border-radius: 10px; width: 40px; height: 40px; font-size: 1.1rem; }

/* لوحة معلومات الأدمن - الهيكل الجديد */
.dash-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }

.dash-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 1.5rem; }
.dash-stat-card {
    background: var(--surface-bg); border: 1px solid var(--surface-border); border-radius: var(--radius-lg);
    padding: 1.2rem; display: flex; align-items: center; gap: 14px; transition: var(--transition);
}
.dash-stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dash-stat-icon {
    width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.dash-stat-icon.success { background: rgba(30,158,107,.12); color: var(--success); }
.dash-stat-icon.warning { background: rgba(224,166,40,.12); color: var(--warning); }
.dash-stat-icon.danger  { background: rgba(217,79,79,.12); color: var(--danger); }
.dash-stat-icon.accent  { background: rgba(23,138,76,.12); color: var(--gold-500); }
.dash-stat-card h3 { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--heading-color); }
.dash-stat-card small { color: var(--gray-500); font-weight: 600; font-size: .78rem; }

.dash-panel { background: var(--surface-bg); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; }
.dash-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dash-panel-header a { font-size: .82rem; color: var(--gold-500); text-decoration: none; font-weight: 600; }

.dash-activity-list { display: flex; flex-direction: column; gap: 4px; }
.dash-activity-item {
    display: flex; align-items: center; gap: 12px; padding: .7rem .5rem; border-radius: var(--radius-sm);
    text-decoration: none; transition: var(--transition);
}
.dash-activity-item:hover { background: var(--page-bg); }
.dash-activity-item img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.dash-activity-info { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-activity-info strong { color: var(--heading-color); font-size: .88rem; }
.dash-activity-info small { color: var(--gray-500); font-size: .76rem; }

.dash-quick-action {
    display: flex; align-items: center; gap: 10px; padding: .8rem .9rem; border-radius: var(--radius-sm);
    color: var(--body-text-color); text-decoration: none; font-size: .88rem; font-weight: 600;
    background: var(--page-bg); margin-bottom: 8px; transition: var(--transition);
}
.dash-quick-action:hover { background: var(--gold-500); color: #fff; }
.dash-quick-action:hover i { color: #fff; }
.dash-quick-action i { color: var(--gold-500); font-size: 1.05rem; }

@media (max-width: 767.98px) {
    .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
}

.table { --bs-table-bg: transparent; width: 100%; min-width: 640px; }
.table thead th { color: var(--gray-500); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; border-bottom-width: 1.5px; padding: .9rem .75rem; white-space: nowrap; }
.table td { padding: .85rem .75rem; vertical-align: middle; border-color: var(--gray-100); }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--gray-50); }

/* عمود الإجراءات (أزرار تعديل/حذف/اعتماد...) - يبقى دائماً في صف واحد بدون التفاف */
.admin-actions {
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}
.admin-actions form { display: inline-flex; margin: 0; }
.admin-actions .btn { padding: .3rem .55rem; flex-shrink: 0; }

.badge { font-weight: 600; padding: .4em .7em; border-radius: 100px; font-size: .74rem; }

/* بطاقات bg-white قديمة تصبح متسقة تلقائياً */
.bg-white.rounded-4 { border-radius: var(--radius-lg) !important; background: var(--surface-bg) !important; border: 1px solid var(--surface-border); box-shadow: var(--shadow-sm) !important; }

/* أي عنصر يستخدم كلاس bg-white من Bootstrap مباشرة (لون ثابت) يتبع الثيم أيضاً في الوضع الليلي */
[data-bs-theme="dark"] .bg-white { background-color: var(--surface-bg) !important; color: var(--body-text-color); }
[data-bs-theme="dark"] .text-dark { color: var(--body-text-color) !important; }

/* ==========================================================
   التجاوب - الشاشات المتوسطة (أجهزة لوحية)
   ========================================================== */
@media (max-width: 991.98px) {
    .main-gallery-img { height: 340px; }
    .admin-sidebar { position: fixed; top: 0; bottom: 0; inset-inline-end: -280px; z-index: 1050; transition: inset-inline-end .3s ease; box-shadow: var(--shadow-lg); }
    .admin-sidebar.open { inset-inline-end: 0; }
    .admin-topbar { display: flex; }
    .admin-content { width: 100%; }
    .admin-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1040; }
    .admin-sidebar-backdrop.show { display: block; }
}

/* ==========================================================
   التجاوب - الجوال
   ========================================================== */
@media (max-width: 767.98px) {
    body { font-size: 15px; }
    .property-card-img { height: 170px; }
    .main-gallery-img { height: 240px; }
    .thumb-row .thumb-img { height: 78px; }
    .contact-box { position: static !important; margin-top: 1.5rem; }
    .filter-box { position: static !important; margin-bottom: 1.5rem; }
    .map-box { height: 65vh; min-height: 380px; }
    .stat-card h3 { font-size: 1.5rem; }
    .admin-content > div, .admin-content > form { padding: 1rem !important; }
    .table-responsive { border-radius: var(--radius-md); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
    #viewTabs .nav-link { padding: .45rem .9rem; font-size: .82rem; }
}

/* ==========================================================
   الشريط السفلي الثابت (الجوال)
   ========================================================== */
.bottom-nav {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 1030;
    background: var(--surface-bg); border-top: 1px solid var(--surface-border);
    display: flex; justify-content: space-around; align-items: center;
    padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
}
.bn-item {
    display: flex; align-items: center; justify-content: center;
    width: 50px; height: 46px; border-radius: 14px;
    color: var(--gray-500); font-size: 1.3rem; transition: var(--transition);
    background: transparent; border: none; padding: 0; cursor: pointer;
}
.bn-item:hover, .bn-item.active { color: var(--heading-color); background: var(--gray-100); }
.bn-item-add { color: var(--gold-500); font-size: 1.7rem; }
.bn-item-add:hover, .bn-item-add.active { color: var(--gold-500); background: var(--gold-100); }

@media (max-width: 767.98px) {
    body { padding-bottom: 70px; }
}

/* ==========================================================
   فقاعات الأسعار على الخريطة
   ألوان الخريطة التي أصبحت أساس هوية الموقع الموحدة - مصمَّمة
   لأقصى وضوح فوق تفاصيل الخريطة الملوّنة: أخضر=بيع، أزرق=إيجار
   ========================================================== */
:root {
    --map-sale: #178a4c;
    --map-sale-dark: #0f6b3a;
    --map-rent: #1d6fd6;
    --map-rent-dark: #1558ad;
    --map-cluster: #1c2333;
    --map-cluster-dark: #11151f;
}

.rsmap-price-bubble {
    position: absolute;
    transform: translate(-50%, -100%);
    background: var(--map-sale);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .02em;
    padding: 6px 12px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0,0,0,.3), 0 0 0 2px rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
    cursor: pointer;
    border: none;
    transition: transform .15s ease;
}
.rsmap-price-bubble:hover { transform: translate(-50%, -100%) scale(1.1); z-index: 10; }
.rsmap-price-bubble::after {
    content: '';
    position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
    border-width: 6px 5px 0 5px; border-style: solid;
    border-color: var(--map-sale) transparent transparent transparent;
}
.rsmap-price-bubble.rent { background: var(--map-rent); }
.rsmap-price-bubble.rent::after { border-color: var(--map-rent) transparent transparent transparent; }
/* هام: position:relative (وليس static) حتى يتموضع الذيل (::after) بشكل صحيح تحت الفقاعة نفسها في خرائط Leaflet */
.rsmap-price-bubble--leaflet { position: relative; transform: translate(-50%, -100%); display: inline-block; }
.rsmap-price-bubble--leaflet:hover { transform: translate(-50%, -100%) scale(1.1); }

/* فقاعة تجميع المدينة - كحلي داكن مميّز وواضح فوق أي خلفية خريطة، بلا اعتماد على الأحمر */
.rsmap-cluster-bubble {
    position: absolute;
    transform: translate(-50%, -100%);
    background: var(--map-cluster);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .02em;
    padding: 10px 18px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.95);
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
    cursor: pointer;
    border: none;
    transition: transform .15s ease;
    text-align: center;
}
.rsmap-cluster-bubble::after {
    content: '';
    position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
    border-width: 6px 6px 0 6px; border-style: solid;
    border-color: var(--map-cluster) transparent transparent transparent;
}
.rsmap-cluster-bubble:hover { transform: translate(-50%, -100%) scale(1.08); z-index: 10; }
/* هام: position:relative (وليس static) حتى يتموضع الذيل بشكل صحيح في خرائط Leaflet */
.rsmap-cluster-bubble--leaflet { position: relative; transform: translate(-50%, -100%); display: inline-block; }
.rsmap-cluster-bubble--leaflet:hover { transform: translate(-50%, -100%) scale(1.08); }

/* ==========================================================
   شريط رأس فلترة الخريطة الاحترافي
   ========================================================== */
.map-filter-header {
    position: absolute; top: 12px; inset-inline: 12px; z-index: 460;
    display: flex; flex-direction: column; gap: 10px;
}
.mfh-row { display: flex; gap: 8px; align-items: center; }

.mfh-filter-btn {
    flex-shrink: 0; display: flex; align-items: center; gap: 6px;
    background: var(--surface-bg); border: none; border-radius: 100px; padding: .65rem 1.15rem;
    font-weight: 800; font-size: .85rem; color: var(--heading-color); box-shadow: var(--shadow-lg);
    transition: var(--transition);
}
.mfh-filter-btn:hover { background: var(--gray-100); }
.mfh-filter-btn i { color: var(--gold-500); font-size: 1rem; }

.mfh-toggle-group {
    display: flex; gap: 4px; background: var(--surface-bg); border-radius: 100px; padding: 4px;
    box-shadow: var(--shadow-lg); overflow-x: auto; scrollbar-width: none; flex-grow: 1;
}
.mfh-toggle-group::-webkit-scrollbar { display: none; }
.mfh-toggle {
    flex-shrink: 0; border: none; background: transparent; border-radius: 100px;
    padding: .55rem 1.15rem; font-weight: 800; font-size: .85rem; color: var(--gray-700);
    transition: var(--transition); white-space: nowrap;
}
.mfh-toggle.active { background: var(--navy-900); color: #fff; }

.mfh-types-row { overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.mfh-types-row::-webkit-scrollbar { display: none; }
.mfh-chip {
    flex-shrink: 0; border: none; border-radius: 100px; padding: .6rem 1.2rem;
    font-weight: 800; font-size: .82rem; background: var(--surface-bg); color: var(--gray-700);
    box-shadow: var(--shadow-lg); transition: var(--transition); white-space: nowrap;
}
.mfh-chip.active { background: var(--gold-500); color: #fff; }

.mfh-city-wrap { position: relative; }
.mfh-city-btn {
    display: flex; align-items: center; gap: 10px; background: var(--surface-bg); border: none;
    border-radius: 16px; padding: .85rem 1.1rem; font-weight: 700; color: var(--heading-color);
    box-shadow: var(--shadow-lg); font-size: .92rem; width: 100%; text-align: right;
    transition: var(--transition);
}
.mfh-city-btn:hover { background: var(--gray-50); }
.mfh-city-btn i { color: var(--gold-500); font-size: 1.15rem; flex-shrink: 0; }
.mfh-city-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mfh-city-dropdown {
    position: absolute; top: calc(100% + 8px); inset-inline: 0; background: var(--surface-bg);
    border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 280px;
    overflow-y: auto; z-index: 470; display: none;
}
.mfh-city-dropdown.show { display: block; }
.mfh-city-option {
    display: block; width: 100%; text-align: right; border: none; background: transparent;
    padding: .6rem .85rem; border-radius: 10px; font-size: .9rem; color: var(--gray-700);
    transition: var(--transition);
}
.mfh-city-option:hover, .mfh-city-option.active { background: var(--gray-100); color: var(--heading-color); font-weight: 700; }

.mfh-list-btn {
    position: absolute; bottom: 16px; left: 16px; z-index: 460;
    display: flex; align-items: center; gap: 7px; background: var(--gold-500); color: #fff;
    border: none; border-radius: 100px; padding: .75rem 1.35rem; font-weight: 800; font-size: .88rem;
    box-shadow: var(--shadow-lg); transition: var(--transition);
}
.mfh-list-btn:hover { background: var(--gold-400); }

.mfh-count-badge {
    position: absolute; bottom: 16px; right: 16px; z-index: 460;
    background: var(--navy-900); color: #fff; border-radius: 100px; padding: .75rem 1.35rem;
    font-weight: 800; font-size: .88rem; box-shadow: var(--shadow-lg);
}

/* ==========================================================
   بطاقة معاينة العقار (تظهر عند الضغط على فقاعة سعر بالخريطة)
   ========================================================== */
.map-preview-card {
    position: absolute; bottom: 0; inset-inline: 0; z-index: 480;
    background: var(--surface-bg); border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow-lg); padding: 14px;
    transform: translateY(100%); opacity: 0; pointer-events: none;
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease;
    max-width: 460px; margin-inline: auto;
}
.map-preview-card.show { transform: translateY(0); opacity: 1; pointer-events: auto; }

.map-preview-close {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background: rgba(13,15,20,.55); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: .8rem; backdrop-filter: blur(4px);
}

.map-preview-inner {
    display: flex; flex-direction: row-reverse; gap: 12px; text-decoration: none; color: inherit;
}
.map-preview-inner img {
    width: 110px; height: 100px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--gray-100);
}
.map-preview-info { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.map-preview-badge {
    align-self: flex-start; background: var(--gold-500); color: #fff; font-size: .68rem; font-weight: 700;
    padding: .2rem .6rem; border-radius: 100px; margin-bottom: 4px;
}
.map-preview-badge.rent { background: var(--info); }
.map-preview-info h6 { color: var(--heading-color); font-weight: 700; font-size: .92rem; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-preview-location { color: var(--gray-500); font-size: .76rem; margin-bottom: 4px; }
.map-preview-location i { color: var(--gold-500); }
.map-preview-specs { display: flex; gap: 10px; margin-bottom: 6px; }
.map-preview-specs span { font-size: .72rem; color: var(--gray-500); display: flex; align-items: center; gap: 3px; }
.map-preview-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.map-preview-footer strong { color: var(--gold-500); font-size: .95rem; font-weight: 800; }
.map-preview-footer .btn { pointer-events: none; padding: .35rem .9rem; font-size: .78rem; }

@media (max-width: 575.98px) {
    .map-preview-inner img { width: 90px; height: 86px; }
}

/* التصفية المتقدمة - تنسدل من الأسفل */
.map-advanced-filter { border-radius: 22px 22px 0 0 !important; overflow-y: auto; }
.map-advanced-filter .offcanvas-header { border-bottom: 1px solid var(--gray-100); padding: 1.25rem 1.5rem; }
.map-advanced-filter .offcanvas-body { padding: 1.5rem; }

@media (max-width: 575.98px) {
    .mfh-filter-btn span, .mfh-list-btn span { display: none; }
    .mfh-filter-btn, .mfh-list-btn { padding: .65rem .8rem; }
}

@media (max-width: 575.98px) {
    .property-card-img { height: 190px; }
    .spec-box { padding: .8rem .4rem; }
    .admin-sidebar { width: 250px; }
    .rsmap-price-bubble { font-size: 11.5px; padding: 5px 10px; }
}

/* ==========================================================
   شعار تثبيت التطبيق (PWA)
   ========================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 12px;
    inset-inline: 12px;
    max-width: 460px;
    margin-inline: auto;
    background: var(--surface-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1040;
    transform: translateY(140%);
    opacity: 0;
    transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
    border: 1px solid var(--surface-border);
}
.pwa-install-banner.show { transform: translateY(0); opacity: 1; }

.pwa-install-icon img {
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.pwa-install-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-install-text strong { color: var(--heading-color); font-size: .95rem; }
.pwa-install-text span { color: var(--gray-500); font-size: .78rem; line-height: 1.4; }

.pwa-install-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pwa-install-btn {
    background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
    color: #fff; border: none; border-radius: 100px; padding: .55rem 1.1rem;
    font-weight: 700; font-size: .82rem; white-space: nowrap; box-shadow: 0 4px 14px rgba(10,25,48,.25);
}
.pwa-install-btn:hover { background: linear-gradient(135deg, var(--navy-900), #060f1e); color: var(--gold-400); }
.pwa-install-close {
    background: var(--gray-100); border: none; color: var(--gray-700);
    width: 30px; height: 30px; border-radius: 50%; font-size: 1.1rem; line-height: 1;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pwa-install-close:hover { background: var(--gray-200); }

@media (max-width: 575.98px) {
    .pwa-install-banner { flex-wrap: wrap; bottom: 78px; }
    .pwa-install-text { order: 3; width: 100%; }
}

/* ==========================================================
   زر تبديل الثيم (ليلي/نهاري)
   ========================================================== */
.theme-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.15);
    color: #fff; font-size: 1.05rem; transition: var(--transition); flex-shrink: 0; cursor: pointer;
}
.theme-toggle-btn:hover { background: var(--gold-500); border-color: var(--gold-500); color: #fff; }

/* عند استخدام زر الثيم داخل الشريط السفلي، يتبع لون bn-item الدلالي بدل اللون الأبيض الثابت
   (المصمَّم أصلاً للشريط العلوي الداكن فقط) لضمان ظهوره بوضوح في كلا الوضعين */
.bn-item.theme-toggle-btn {
    width: 50px; height: 46px; border-radius: 14px;
    background: transparent; border: none; color: var(--gray-500); font-size: 1.3rem;
}
.bn-item.theme-toggle-btn:hover { color: var(--heading-color); background: var(--gray-100); }

.admin-theme-toggle {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.85); border-radius: var(--radius-sm); padding: .6rem; font-size: .85rem;
    font-weight: 600; transition: var(--transition); cursor: pointer;
}
.admin-theme-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ==========================================================
   ضبط تباين إضافي دقيق في الوضع الليلي
   ========================================================== */
[data-bs-theme="dark"] .btn-outline-brand { color: var(--heading-color); border-color: var(--surface-border); }
[data-bs-theme="dark"] .btn-outline-brand:hover { background: var(--gray-100); color: var(--heading-color); border-color: var(--surface-border); }
[data-bs-theme="dark"] .btn-outline-secondary { color: var(--body-text-color); border-color: var(--surface-border); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] .dropdown-menu { background: var(--surface-bg); border-color: var(--surface-border); }
[data-bs-theme="dark"] .dropdown-item { color: var(--body-text-color); }
[data-bs-theme="dark"] .dropdown-item:hover { background: var(--gray-100); color: var(--heading-color); }
[data-bs-theme="dark"] .offcanvas { background: var(--surface-bg); color: var(--body-text-color); }
[data-bs-theme="dark"] .modal-content { background: var(--surface-bg); color: var(--body-text-color); }
[data-bs-theme="dark"] .card { background: var(--surface-bg); color: var(--body-text-color); border-color: var(--surface-border); }
[data-bs-theme="dark"] .alert-info { background: rgba(47,143,208,.15); color: #8fc6ea; border-color: rgba(47,143,208,.3); }
[data-bs-theme="dark"] .alert-warning { background: rgba(224,166,40,.15); color: #f0c766; border-color: rgba(224,166,40,.3); }
[data-bs-theme="dark"] .alert-danger { background: rgba(217,79,79,.15); color: #f19b9b; border-color: rgba(217,79,79,.3); }
[data-bs-theme="dark"] .alert-success { background: rgba(30,158,107,.15); color: #7fd6b3; border-color: rgba(30,158,107,.3); }
[data-bs-theme="dark"] .site-footer,
[data-bs-theme="dark"] .admin-login-body { background: #08090c; }

/* ==========================================================
   تجربة خريطة سوق عقاري سعودي — طبقة التنفيذ النهائية
   ========================================================== */
:root {
    --map-sale: #178a4c;
    --map-sale-dark: #0f6b3a;
    --map-rent: #1d6fd6;
    --map-rent-dark: #1558ad;
    --map-surface: rgba(255, 255, 255, .95);
    --map-stroke: rgba(21, 46, 34, .12);
    --map-shadow: 0 12px 30px rgba(21, 39, 29, .18);
}

.map-box {
    border-radius: 22px;
    background-color: #d9d0bd;
    background-image: linear-gradient(rgba(238, 230, 209, .16), rgba(238, 230, 209, .16));
    background-position: center;
    background-size: cover;
    isolation: isolate;
}
.map-box .leaflet-control-attribution { font-size: 9px; opacity: .72; }
.map-box .leaflet-control-zoom { display: none; }
.map-box.is-hidden-for-static { visibility: hidden; pointer-events: none; }
.map-regions-static-layer {
    position: absolute;
    z-index: 455;
    inset: 0;
    display: none;
    place-items: center;
    overflow: hidden;
    background: #eef3ed;
}
.map-regions-static-layer.is-visible { display: grid; }
.regions-static-mode .mfh-map-actions { display: none; }
.regions-static-layer { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.map-regions-static-layer.is-dragging { cursor: grabbing; }
.regions-static-viewport { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at center, #f9fbf6 0, #e7f1e9 100%); }
.regions-static-frame { position: absolute; inset: 0; overflow: hidden; background: #edf4ed; transform-origin: center; will-change: transform; }
.regions-static-frame > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.regions-static-hotspots { position: absolute; inset: 0; }
.regions-static-hotspot {
    position: absolute;
    left: var(--region-x);
    top: var(--region-y);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transform: translate(-50%, -100%);
    padding: 6px 8px;
    border: 1px solid rgba(20, 92, 53, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 4px 12px rgba(24, 64, 41, .18);
    color: #1a613b;
    font: inherit;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: transform 160ms cubic-bezier(.23, 1, .32, 1), background 160ms ease, color 160ms ease;
}
.regions-static-hotspot i { color: var(--map-sale); font-size: .82rem; }
.regions-static-hotspot { touch-action: manipulation; }
.regions-static-hotspot:hover { transform: translate(-50%, -100%) scale(1.07); background: var(--map-sale); color: #fff; }
.regions-static-hotspot:hover i { color: #fff; }
.regions-static-controls {
    position: absolute;
    z-index: 20;
    inset-inline-end: 18px;
    bottom: 92px;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--map-stroke);
    border-radius: 15px;
    background: var(--map-surface);
    box-shadow: var(--map-shadow);
}
.regions-static-controls button { display: grid; place-items: center; width: 50px; height: 46px; border: 0; border-bottom: 1px solid var(--map-stroke); background: transparent; color: #315141; font-size: 1.08rem; }
.regions-static-controls button:last-child { border-bottom: 0; }
.regions-static-controls button:hover { background: #e8f5ec; color: var(--map-sale); }
.regions-static-controls button:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(23, 138, 76, .32); outline-offset: -3px; }
.regions-drag-hint {
    position: absolute;
    z-index: 12;
    inset-inline-start: 16px;
    bottom: 80px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(20, 92, 53, .16);
    border-radius: 10px;
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 7px 18px rgba(24, 64, 41, .12);
    color: #486352;
    font-size: .68rem;
    font-weight: 700;
    pointer-events: none;
}
.regions-drag-hint i { color: var(--map-sale); }
.mfh-map-action:disabled { opacity: .42; cursor: not-allowed; }

.rsmap-price-bubble {
    background: var(--map-sale);
    border-radius: 8px;
    box-shadow: 0 4px 13px rgba(7, 72, 38, .34), 0 0 0 2px rgba(255, 255, 255, .86);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.12;
    padding: 7px 12px;
    text-shadow: none;
    transition: transform 160ms cubic-bezier(.23, 1, .32, 1), box-shadow 160ms cubic-bezier(.23, 1, .32, 1);
}
.rsmap-price-bubble:hover { transform: translate(-50%, -100%) scale(1.075); box-shadow: 0 7px 18px rgba(7, 72, 38, .4), 0 0 0 2px #fff; }
.rsmap-price-bubble::after { border-color: var(--map-sale) transparent transparent transparent; }
.rsmap-price-bubble.rent { background: var(--map-rent); }
.rsmap-price-bubble.rent::after { border-color: var(--map-rent) transparent transparent transparent; }
.rsmap-cluster-bubble { background: #154e30; border-radius: 10px; box-shadow: 0 5px 16px rgba(7, 72, 38, .32), 0 0 0 2px rgba(255, 255, 255, .9); }
.rsmap-cluster-bubble::after { border-color: #154e30 transparent transparent transparent; }
.rsmap-region-bubble {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transform: translate(-50%, -100%);
    padding: 7px 11px;
    border: 1px solid rgba(22, 71, 44, .18);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 5px 15px rgba(20, 61, 38, .18);
    color: #225c38;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: transform 160ms cubic-bezier(.23, 1, .32, 1), background 160ms ease, color 160ms ease;
}
.rsmap-region-bubble i { color: var(--map-sale); font-size: .9rem; }
.rsmap-region-bubble:hover { transform: translate(-50%, -100%) scale(1.08); background: var(--map-sale); color: #fff; }
.rsmap-region-bubble:hover i { color: #fff; }
.rsmap-region-bubble--leaflet { position: relative; display: inline-flex; }

.map-filter-header {
    position: absolute;
    z-index: 460;
    top: 16px;
    inset-inline: 16px;
    display: block;
    pointer-events: none;
}
.mfh-top-panel,
.mfh-floating-cards,
.mfh-map-actions,
.mfh-favorite-btn,
.mfh-bottom-bar,
.map-preview-card { pointer-events: auto; }
.mfh-top-panel {
    max-width: 740px;
    margin-inline: auto;
    padding: 9px;
    background: var(--map-surface);
    border: 1px solid var(--map-stroke);
    border-radius: 20px;
    box-shadow: var(--map-shadow);
    backdrop-filter: blur(14px);
}
.mfh-row { gap: 7px; }
.mfh-toggle-row { align-items: stretch; }
.mfh-filter-btn {
    min-height: 46px;
    border: 1.5px solid var(--blue-500);
    border-radius: 12px;
    background: rgba(255, 255, 255, .95);
    color: #1558ad;
    box-shadow: none;
    font-size: .92rem;
    padding: .6rem .95rem;
}
.mfh-filter-btn:hover { background: var(--blue-100); color: #1558ad; }
.mfh-filter-btn i { color: var(--blue-500); font-size: 1.08rem; }
.mfh-toggle-group {
    min-height: 46px;
    padding: 0;
    gap: 0;
    border: 1px solid var(--map-stroke);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
    box-shadow: none;
    overflow: hidden;
}
.mfh-toggle {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 0;
    color: #314238;
    font-size: .94rem;
    padding: .45rem .7rem;
}
.mfh-toggle + .mfh-toggle { border-inline-start: 1px solid var(--map-stroke); }
.mfh-toggle i { color: #4c5c54; margin-inline-end: .28rem; }
.mfh-toggle.active {
    position: relative;
    background: transparent;
    color: var(--map-sale);
    box-shadow: inset 0 -3px 0 var(--map-sale);
}
.mfh-toggle.active i { color: var(--map-sale); }
.mfh-types-row {
    margin-top: 7px;
    gap: 6px;
    padding: 0;
    overflow-x: auto;
}
.mfh-chip {
    min-width: 88px;
    border: 1px solid var(--map-stroke);
    border-radius: 10px;
    background: rgba(255, 255, 255, .86);
    box-shadow: none;
    color: #35453c;
    font-size: .9rem;
    padding: .52rem 1rem;
}
.mfh-chip.active { background: #dceee1; border-color: var(--map-sale); color: #155b36; }

.mfh-floating-cards {
    position: absolute;
    top: calc(100% + 12px);
    inset-inline-end: 0;
    width: min(100%, 280px);
    display: grid;
    gap: 8px;
}
.mfh-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 62px;
    padding: 8px 10px 8px 12px;
    border: 1px solid rgba(31, 60, 43, .1);
    border-radius: 14px;
    background: var(--map-surface);
    box-shadow: 0 8px 20px rgba(21, 39, 29, .15);
    color: var(--heading-color);
    text-align: start;
    transition: transform 160ms cubic-bezier(.23, 1, .32, 1), background 160ms ease;
}
.mfh-info-card:hover { background: #fff; transform: translateY(-1px); }
.mfh-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    background: #e1f2e6;
    color: var(--map-sale);
    font-size: 1.15rem;
}
.mfh-info-icon--outline { color: #24326d; background: #eceeff; }
.mfh-info-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.mfh-info-copy strong { overflow: hidden; color: #26382d; font-size: .88rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mfh-info-copy small { overflow: hidden; color: #748078; font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.mfh-card-arrow { color: #99a29c; font-size: .8rem; }
.mfh-city-dropdown,
.mfh-region-dropdown {
    top: 0;
    inset-inline: auto 0;
    width: 100%;
    border: 1px solid rgba(31, 60, 43, .1);
    border-radius: 14px;
    box-shadow: var(--map-shadow);
    background: #fff;
}
.mfh-region-dropdown { display: none; }
.mfh-region-dropdown.show { display: block; }
.mfh-city-option,
.mfh-region-option { display: block; width: 100%; border: 0; padding: .65rem .85rem; background: transparent; color: #33443a; text-align: right; }
.mfh-city-option:hover, .mfh-city-option.active,
.mfh-region-option:hover, .mfh-region-option.active { color: var(--map-sale); background: #edf7f0; }

.mfh-map-actions {
    position: absolute;
    z-index: 460;
    bottom: 98px;
    inset-inline-end: 18px;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--map-stroke);
    border-radius: 18px;
    background: var(--map-surface);
    box-shadow: var(--map-shadow);
    backdrop-filter: blur(14px);
}
.mfh-map-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 56px;
    min-height: 51px;
    border: 0;
    background: transparent;
    color: #315141;
    font-size: 1.3rem;
    transition: background 160ms ease, color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}
.mfh-map-action + .mfh-map-action { border-top: 1px solid var(--map-stroke); }
.mfh-map-action span { display: none; font-size: .7rem; font-weight: 700; }
.mfh-map-action:hover, .mfh-map-action.active { background: #e8f5ec; color: var(--map-sale); }
.mfh-map-action:active, .mfh-favorite-btn:active, .mfh-info-card:active { transform: scale(.97); }
.mfh-map-action.is-loading i { animation: map-spin 700ms linear infinite; }
@keyframes map-spin { to { transform: rotate(360deg); } }

.mfh-favorite-btn {
    position: absolute;
    z-index: 460;
    bottom: 98px;
    inset-inline-start: 18px;
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 62px;
    padding: 10px 9px;
    border: 1px solid var(--map-stroke);
    border-radius: 16px;
    background: var(--map-surface);
    box-shadow: var(--map-shadow);
    color: #49554e;
    font-size: 1.25rem;
    transition: background 160ms ease, color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}
.mfh-favorite-btn span { font-size: .7rem; font-weight: 700; }
.mfh-favorite-btn.active { background: var(--blue-100); color: var(--blue-500); }

.mfh-bottom-bar {
    position: absolute;
    z-index: 460;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    width: min(calc(100% - 32px), 640px);
    min-height: 57px;
    padding: 6px;
    border: 1px solid var(--map-stroke);
    border-radius: 18px;
    background: var(--map-surface);
    box-shadow: var(--map-shadow);
    backdrop-filter: blur(14px);
}
.mfh-list-btn,
.mfh-add-link {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .58rem .8rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: #35463c;
    font-size: .88rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}
.mfh-list-btn:hover { background: #edf7f0; color: #155b36; }
.mfh-add-link { color: var(--map-sale); }
.mfh-add-link:hover { color: #0f6b3a; background: #e4f3e8; }
.mfh-list-btn:active, .mfh-add-link:active { transform: scale(.97); }
.mfh-count-badge {
    position: static;
    flex: 1;
    padding: .3rem .45rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #344239;
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}

.map-preview-card {
    bottom: 86px;
    width: min(calc(100% - 32px), 460px);
    border: 1px solid var(--map-stroke);
    border-radius: 18px;
    box-shadow: var(--map-shadow);
}
.map-preview-badge { background: var(--map-sale); }
.map-preview-badge.rent { background: var(--map-rent); }
.map-preview-location i, .map-preview-footer strong { color: var(--map-sale); }

#mapView.map-fullscreen-mode .map-box { height: 100%; }
@media (min-width: 768px) {
    .mfh-map-action { min-width: 90px; padding-inline: 12px; }
    .mfh-map-action span { display: inline; }
}
@media (max-width: 575.98px) {
    .map-filter-header { top: 10px; inset-inline: 10px; }
    .mfh-top-panel { padding: 7px; border-radius: 16px; }
    .mfh-filter-btn { min-width: 44px; min-height: 42px; padding: .5rem .65rem; }
    .mfh-filter-btn span { display: none; }
    .mfh-toggle-group { min-height: 42px; }
    .mfh-toggle { font-size: .83rem; padding: .42rem .34rem; }
    .mfh-toggle i { display: none; }
    .mfh-chip { min-width: 75px; font-size: .8rem; padding: .46rem .72rem; }
    .mfh-floating-cards { top: calc(100% + 9px); width: 225px; gap: 6px; }
    .mfh-info-card { min-height: 55px; padding: 7px 8px; border-radius: 12px; }
    .mfh-info-icon { width: 35px; height: 35px; flex-basis: 35px; border-radius: 9px; font-size: 1rem; }
    .mfh-info-copy strong { font-size: .8rem; }
    .mfh-info-copy small { font-size: .64rem; }
    .mfh-map-actions, .mfh-favorite-btn { bottom: 88px; }
    .mfh-map-actions { inset-inline-end: 10px; border-radius: 15px; }
    .mfh-map-action { min-width: 50px; min-height: 46px; }
    .mfh-favorite-btn { inset-inline-start: 10px; min-width: 58px; padding: 8px 6px; border-radius: 14px; }
    .mfh-favorite-btn span { font-size: .65rem; }
    .mfh-bottom-bar { bottom: 10px; width: calc(100% - 20px); min-height: 52px; border-radius: 16px; }
    .mfh-list-btn, .mfh-add-link { padding: .48rem .55rem; font-size: .78rem; }
    .mfh-count-badge { font-size: .78rem; }
    .map-preview-card { bottom: 73px; width: calc(100% - 20px); }
    .regions-static-frame { width: 100%; }
    .regions-static-hotspot { padding: 5px 6px; font-size: .62rem; }
    .regions-static-controls { inset-inline-end: 10px; bottom: 88px; }
    .regions-static-controls button { width: 44px; height: 42px; }
    .regions-drag-hint { inset-inline-start: 10px; bottom: 70px; max-width: 190px; font-size: .6rem; }
}
/* اتجاه الجوال أولًا: تعكس الخريطة تركيب التطبيق العمودي الوارد في المرجع.
   يظل سطح المكتب متجاوبًا عبر قواعد العرض الأكبر أعلاه. */
@media (max-width: 767.98px) {
    body.map-mode-active .main-navbar { visibility: hidden; pointer-events: none; }
    #mapView.map-fullscreen-mode {
        top: 0 !important;
        width: 100vw;
        min-height: 100dvh;
        background: #eaf1eb;
    }
    #mapView.map-fullscreen-mode .map-box {
        width: 100%;
        height: 100%;
        min-height: 100dvh;
        border-radius: 0;
    }
    #mapView.map-fullscreen-mode .map-regions-static-layer { min-height: 100dvh; }
    #mapView.map-fullscreen-mode .map-filter-header {
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        inset-inline: 10px;
    }
    #mapView.map-fullscreen-mode .mfh-top-panel { border-radius: 18px; }
    #mapView.map-fullscreen-mode .mfh-floating-cards {
        top: calc(100% + 11px);
        inset-inline-end: 0;
        width: min(62vw, 248px);
    }
    #mapView.map-fullscreen-mode .mfh-map-actions,
    #mapView.map-fullscreen-mode .regions-static-controls { bottom: 91px; }
    #mapView.map-fullscreen-mode .mfh-favorite-btn { bottom: 91px; }
    #mapView.map-fullscreen-mode .mfh-bottom-bar {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
        width: calc(100% - 20px);
    }
    #mapView.map-fullscreen-mode .regions-drag-hint {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mfh-info-card, .mfh-map-action, .mfh-favorite-btn, .mfh-list-btn, .mfh-add-link, .rsmap-price-bubble { transition: none; }
    .mfh-map-action.is-loading i { animation: none; }
}
