/**
 * ثيم «أكارات» — ألوان مستوحاة من شعار شركة المسري
 * كحلي #121f2b، ذهبي #f9a800، أبيض، تيل #2a6f97، سماوي #a9d6e5، نحاسي #d97706
 */
:root {
    /* لوحة الشعار (مرجع ثابت) */
    --navy: #121f2b;
    --navy-deep: #0d1b2a;
    --gold: #f9a800;
    --gold-bright: #ffb703;
    --gold-hover: #e09200;
    --white: #ffffff;
    /* نص فاتح مائل للرمادي (بدل الأبيض الصافي في الواجهة والوضع الداكن) */
    --text-soft: #e8e7e4;
    /* نص أسفل اسم الموقع — أصفر خفيف */
    --tagline-soft-yellow: #e9dda8;
    --tagline-soft-yellow-hover: #f2e8bc;
    --teal: #2a6f97;
    --sky: #a9d6e5;
    --copper: #d97706;

    --font: "Segoe UI", "Tahoma", system-ui, sans-serif;
    --radius: 12px;
    --transition: 0.2s ease;

    /* === وضع فاتح === */
    --bg: #f8f9fa;
    --bg-elevated: #ffffff;
    --text: var(--navy);
    --text-muted: #3d5568;
    --border: #d4e3eb;
    --border-strong: rgba(18, 31, 43, 0.14);

    --accent: var(--gold);
    --accent-hover: var(--gold-hover);
    --accent-soft: rgba(249, 168, 0, 0.2);
    --on-accent: var(--navy);

    --surface-2: #eef4f8;
    --secondary: var(--teal);
    --secondary-soft: rgba(42, 111, 151, 0.12);

    --topbar-bg: var(--navy);
    --topbar-fg: var(--text-soft);
    --topbar-border: var(--gold);

    --shadow: 0 10px 40px rgba(18, 31, 43, 0.08);

    --danger: #b42318;
    --success: #1d6b55;
    --success-soft: rgba(42, 111, 151, 0.12);
}

[data-theme="dark"] {
    --bg: var(--navy);
    --bg-elevated: #1a2836;
    --text: var(--text-soft);
    --text-muted: rgba(169, 214, 229, 0.85);
    --border: rgba(249, 168, 0, 0.22);
    --border-strong: rgba(249, 168, 0, 0.35);

    --accent: var(--gold);
    --accent-hover: var(--gold-bright);
    --accent-soft: rgba(249, 168, 0, 0.18);
    --on-accent: var(--navy-deep);

    --surface-2: #152535;
    --secondary: var(--sky);
    --secondary-soft: rgba(169, 214, 229, 0.1);

    --topbar-bg: var(--navy-deep);
    --topbar-fg: var(--text-soft);
    --topbar-border: var(--gold);

    --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
}

body.app-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

body.app-body--bare {
    min-height: 100vh;
}

.topbar {
    --topbar-sticky-offset: 4.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.65rem 1.25rem;
    background: var(--topbar-bg);
    color: var(--topbar-fg);
    border-bottom: 3px solid var(--topbar-border);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 260;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.main-nav-toggle {
    display: none;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 14px;
    border: 1px solid rgba(249, 168, 0, 0.38);
    background: linear-gradient(160deg, rgba(249, 168, 0, 0.16) 0%, rgba(249, 168, 0, 0.05) 55%, rgba(255, 255, 255, 0.04) 100%);
    cursor: pointer;
    padding: 0;
    line-height: 0;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

.main-nav-toggle:hover {
    border-color: rgba(255, 183, 3, 0.72);
    background: linear-gradient(160deg, rgba(249, 168, 0, 0.24) 0%, rgba(249, 168, 0, 0.1) 100%);
    box-shadow:
        0 4px 14px rgba(249, 168, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.main-nav-toggle:active {
    transform: scale(0.94);
}

.main-nav-toggle:focus {
    outline: none;
}

.main-nav-toggle:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
}

.main-nav-toggle__icon {
    position: relative;
    display: block;
    width: 1.35rem;
    height: 1.05rem;
}

.main-nav-toggle__line {
    position: absolute;
    inset-inline: 0;
    height: 2.5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
    box-shadow: 0 0 6px rgba(249, 168, 0, 0.35);
    transition:
        transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        bottom 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        width 0.28s ease;
}

.main-nav-toggle__line:nth-child(1) {
    top: 0;
}

.main-nav-toggle__line:nth-child(2) {
    top: 50%;
    width: 72%;
    margin-inline-start: auto;
    transform: translateY(-50%);
}

.main-nav-toggle__line:nth-child(3) {
    bottom: 0;
}

.topbar.nav-open .main-nav-toggle {
    border-color: rgba(255, 183, 3, 0.75);
    background: linear-gradient(160deg, rgba(249, 168, 0, 0.28) 0%, rgba(249, 168, 0, 0.12) 100%);
    box-shadow:
        0 0 0 3px rgba(249, 168, 0, 0.14),
        0 4px 16px rgba(249, 168, 0, 0.22);
}

.topbar.nav-open .main-nav-toggle__line:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.topbar.nav-open .main-nav-toggle__line:nth-child(2) {
    opacity: 0;
    transform: translateY(-50%) scaleX(0);
}

.topbar.nav-open .main-nav-toggle__line:nth-child(3) {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) rotate(-45deg);
}

[data-theme="light"] .main-nav-toggle {
    border-color: rgba(224, 146, 0, 0.45);
    background: linear-gradient(160deg, rgba(249, 168, 0, 0.2) 0%, rgba(255, 255, 255, 0.65) 100%);
    box-shadow:
        0 2px 8px rgba(13, 27, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .main-nav-toggle__line {
    background: linear-gradient(90deg, #e09200 0%, #f9a800 100%);
    box-shadow: none;
}

[data-theme="light"] .main-nav-toggle:hover,
[data-theme="light"] .topbar.nav-open .main-nav-toggle {
    border-color: rgba(224, 146, 0, 0.65);
    box-shadow:
        0 4px 14px rgba(249, 168, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.main-nav-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .topbar {
        flex-wrap: nowrap;
    }

    .topbar-start .brand {
        min-width: 0;
    }

    .topbar-start .brand-text-block {
        min-width: 0;
    }

    .topbar-start .brand-text {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 42vw;
    }

    .main-nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: fixed;
        z-index: 250;
        inset-inline: 0;
        top: var(--topbar-sticky-offset);
        max-height: min(78vh, 24rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.15rem;
        margin: 0;
        padding: 0.45rem 1rem 0.9rem;
        background: var(--topbar-bg);
        border-bottom: 2px solid var(--topbar-border);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-0.5rem);
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    }

    .topbar.nav-open .main-nav {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .main-nav .nav-link {
        padding: 0.65rem 0.75rem;
        border-radius: 8px;
        text-align: center;
    }

    .main-nav-backdrop {
        display: block;
        position: fixed;
        z-index: 240;
        inset-inline: 0;
        top: var(--topbar-sticky-offset);
        bottom: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: rgba(13, 27, 42, 0.45);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .main-nav-backdrop[hidden] {
        display: none !important;
    }

    .main-nav .nav-link--auth:not(:first-child) {
        margin-top: 0.35rem;
        padding-top: 0.65rem;
        border-top: 1px solid rgba(249, 168, 0, 0.28);
    }

    .topbar-actions {
        position: relative;
        z-index: 270;
    }

    .nav-profile-panel {
        z-index: 280;
    }

    body.is-main-nav-open {
        overflow: hidden;
    }
}

@media (min-width: 769px) {
    .main-nav-backdrop {
        display: none !important;
    }

    .main-nav .nav-link--auth:not(:first-child) {
        margin-inline-start: 0.85rem;
        padding-inline-start: 1rem;
        border-inline-start: 1px solid rgba(249, 168, 0, 0.35);
    }
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: rgba(233, 231, 227, 0.95);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
    color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.12);
}

.nav-link.is-active {
    color: var(--gold-bright);
    box-shadow: inset 0 -2px 0 var(--gold);
}

.nav-link--compact {
    font-size: 0.88rem;
    opacity: 0.95;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.02em;
    user-select: none;
}

.brand:focus {
    outline: none;
}

.brand:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
    border-radius: 8px;
}

.brand:hover {
    color: var(--gold-bright);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-drag: none;
}

.brand-text {
    color: var(--topbar-fg);
    font-weight: 700;
}

.brand:hover .brand-text {
    color: #f2f1ee;
}

.brand:hover .brand-tagline {
    color: var(--tagline-soft-yellow-hover);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topbar-actions .main-nav-toggle {
    margin-inline-start: 0.1rem;
}

/* قائمة الملف الشخصي (Font Awesome) بجانب زر الثيم */
.nav-profile-dropdown {
    position: relative;
}

.nav-profile-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(249, 168, 0, 0.45);
    background: rgba(236, 234, 231, 0.1);
    color: var(--gold);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

/* شارة الحسابات الجديدة — دائرة حمراء فوق زر الحساب */
.nav-profile-badge,
.main-nav-toggle-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px var(--bg);
}

.main-nav-toggle-badge {
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    z-index: 2;
}

/* شارة داخل عنصر القائمة المنسدلة */
.nav-item-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    margin-inline-start: 0.45rem;
    vertical-align: middle;
    box-sizing: border-box;
}

.nav-profile-btn:hover,
.nav-profile-btn.is-active {
    border-color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold-bright);
}

[data-theme="light"] .nav-profile-btn {
    background: rgba(236, 234, 231, 0.14);
    border-color: rgba(249, 168, 0, 0.55);
    color: var(--gold-bright);
}

[data-theme="light"] .nav-profile-btn:hover,
[data-theme="light"] .nav-profile-btn.is-active {
    background: rgba(249, 168, 0, 0.2);
}

.nav-profile-panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 6px);
    min-width: 15.5rem;
    padding: 0.35rem 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
}

.nav-profile-panel[hidden] {
    display: none !important;
}

.nav-profile-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
}

.nav-profile-item:hover {
    background: var(--surface-2);
}

.nav-profile-item-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.nav-profile-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(249, 168, 0, 0.45);
    background: rgba(236, 234, 231, 0.1);
    color: var(--gold);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.theme-toggle:hover {
    border-color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold-bright);
}

.theme-toggle::after {
    content: "☀";
    font-size: 1.1rem;
}

[data-theme="dark"] .theme-toggle::after {
    content: "☾";
}

[data-theme="light"] .theme-toggle {
    background: rgba(236, 234, 231, 0.14);
    border-color: rgba(249, 168, 0, 0.55);
    color: var(--gold-bright);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(249, 168, 0, 0.2);
}

/* أيقونة دائرية بنفس ألوان أزرار النافبار (الملف الشخصي / الثيم) */
.topbar-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(249, 168, 0, 0.45);
    background: rgba(236, 234, 231, 0.1);
    color: var(--gold);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.topbar-icon-btn:hover {
    border-color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold-bright);
}

.topbar-icon-btn:focus {
    outline: none;
}

.topbar-icon-btn:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

.topbar-icon-btn i {
    font-size: 1.15rem;
}

[data-theme="light"] .topbar-icon-btn {
    background: #121f2b;
    border-color: #121f2b;
    color: #fff;
}

[data-theme="light"] .topbar-icon-btn:hover {
    background: #1e3349;
    border-color: #1e3349;
    color: #fff;
}

.main-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 2.5rem;
}

.main-wrap--wide {
    align-items: flex-start;
}

.main-wrap--dashboard {
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.main-wrap--wide .card {
    max-width: 960px;
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow);
}

[data-theme="dark"] .card {
    border-color: var(--border-strong);
    box-shadow: var(--shadow), 0 0 0 1px rgba(169, 214, 229, 0.06);
}

.card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    color: var(--text);
}

.card .subtitle {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* لوحة التحكم */
.dashboard-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    min-height: calc(100vh - 9rem);
    box-sizing: border-box;
}

.dashboard-top {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 1.25rem;
}

.dashboard-welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    margin: 0;
    font-size: 1.35rem;
    color: var(--text);
    text-align: start;
}

.dashboard-welcome__greet {
    font-weight: 700;
}

.dashboard-welcome__role {
    font-size: 0.92em;
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-welcome__role::before {
    content: "—";
    margin-inline-end: 0.35em;
    font-weight: 400;
    color: var(--text-muted);
}

.dashboard-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.dashboard-stat-card {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

[data-theme="dark"] .dashboard-stat-card {
    border-color: var(--border-strong);
    box-shadow: var(--shadow), 0 0 0 1px rgba(169, 214, 229, 0.06);
}

.dashboard-stat-card__label {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-stat-card__value {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .dashboard-stats {
        gap: 0.45rem;
    }

    .dashboard-stat-card {
        padding: 0.7rem 0.4rem;
    }

    .dashboard-stat-card__label {
        font-size: 0.68rem;
        line-height: 1.3;
        margin-bottom: 0.35rem;
    }

    .dashboard-stat-card__value {
        font-size: 1.05rem;
    }
}

.dashboard-actions-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-block: 0.5rem 1rem;
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 22rem;
}

.dashboard-actions .btn {
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
}

.dashboard-export-alert {
    margin: 0 0 1rem;
    max-width: 36rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.field-label-text {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

[data-theme="light"] input[type="checkbox"] {
    accent-color: #121f2b;
}

[data-theme="dark"] input[type="checkbox"] {
    accent-color: var(--accent);
}

.field input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--secondary-soft);
}

.field select,
.field textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field textarea {
    min-height: 5rem;
    resize: vertical;
}

.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--secondary-soft);
}

[data-theme="dark"] .field select:focus,
[data-theme="dark"] .field textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

[data-theme="dark"] .field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* إظهار/إخفاء كلمة المرور — Font Awesome */
.password-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.field .password-wrap input {
    padding-inline-end: 2.75rem;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background var(--transition);
}

.password-toggle:hover {
    color: var(--teal);
    background: var(--secondary-soft);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

[data-theme="dark"] .password-toggle:hover {
    color: var(--gold);
    background: var(--accent-soft);
}

[data-theme="dark"] .password-toggle:focus-visible {
    outline-color: var(--gold);
}

.password-toggle .fa-fw {
    font-size: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: var(--accent);
    color: var(--on-accent);
    transition: background var(--transition), transform 0.08s ease, box-shadow var(--transition);
    box-shadow: 0 2px 0 rgba(18, 31, 43, 0.12);
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn-ghost {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--secondary-soft);
    color: var(--teal);
}

[data-theme="dark"] .btn-ghost {
    color: var(--sky);
    border-color: rgba(169, 214, 229, 0.55);
}

[data-theme="dark"] .btn-ghost:hover {
    background: var(--secondary-soft);
    color: var(--text-soft);
}

[data-theme="light"] .btn:not(.btn-ghost):not(.btn-danger):not(.btn-outline):not(.btn-secondary):not(.btn-danger-outline) {
    background: #121f2b;
    color: #fff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .btn:not(.btn-ghost):not(.btn-danger):not(.btn-outline):not(.btn-secondary):not(.btn-danger-outline):hover {
    background: #1e3349;
}

[data-theme="light"] .btn-danger-outline {
    background: #121f2b !important;
    border-color: #121f2b !important;
    color: #fff !important;
}

[data-theme="light"] .btn-danger-outline:hover {
    background: #1e3349 !important;
    border-color: #1e3349 !important;
}

.links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.links-row a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

.links-row a:hover {
    color: var(--copper);
    text-decoration: underline;
}

[data-theme="dark"] .links-row a {
    color: var(--gold);
}

[data-theme="dark"] .links-row a:hover {
    color: var(--gold-bright);
}

.alert {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
    border: 1px solid rgba(180, 35, 24, 0.28);
}

.alert-success {
    background: var(--success-soft);
    color: var(--teal);
    border: 1px solid rgba(42, 111, 151, 0.28);
}

[data-theme="dark"] .alert-success {
    color: var(--sky);
    border-color: rgba(169, 214, 229, 0.35);
    background: rgba(42, 111, 151, 0.2);
}

.debug-link {
    word-break: break-all;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--teal);
}

[data-theme="dark"] .debug-link {
    color: var(--gold);
}

.profile-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.profile-section h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--text);
}

.profile-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.profile-actions {
    margin-top: 1rem;
}

.profile-actions .btn {
    width: auto;
    display: inline-flex;
    text-decoration: none;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.5rem;
}

/* ══════════════════════════════════════════
   صفحة سجل النشاط
══════════════════════════════════════════ */
.al-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 1.2rem;
}
.al-filters-bar .field {
    margin: 0;
    flex: 1 1 10rem;
    max-width: 14rem;
}
.al-table .al-date {
    font-size: 0.78rem;
    white-space: nowrap;
    color: var(--text-muted);
}
.al-table .al-user {
    font-weight: 600;
    font-size: 0.85rem;
}
.al-table .al-user--guest {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}
.al-table .al-desc {
    font-size: 0.88rem;
    max-width: 28rem;
    word-break: break-word;
}
.al-table .al-ip {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.al-entity-link {
    margin-inline-start: 0.3rem;
    font-size: 0.78rem;
    color: var(--gold);
    text-decoration: underline;
}

.al-entity-link--trash {
    color: var(--red, #e53e3e);
}

/* ─── صفحة العقار المحذوف ─────────────────────────────────────── */
.property-trash-card {
    max-width: 680px;
    margin: 0 auto;
}

.property-trash__heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.35rem;
    color: var(--text-muted);
}

.property-trash__id {
    color: var(--accent);
}

.property-trash__countdown {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem 1rem;
    background: color-mix(in srgb, var(--warning, #ed8936) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--warning, #ed8936) 40%, transparent);
    border-radius: var(--radius, 8px);
    font-size: .9rem;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.property-trash__countdown--urgent {
    background: color-mix(in srgb, var(--red, #e53e3e) 12%, transparent);
    border-color: color-mix(in srgb, var(--red, #e53e3e) 40%, transparent);
    color: var(--red, #e53e3e);
}

.property-trash__not-found {
    text-align: center;
    padding: 2.5rem 1rem;
}

.property-trash__details {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.property-trash__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

.property-trash__dl {
    display: grid;
    gap: .4rem;
}

.property-trash__dl-row {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: .5rem;
    align-items: baseline;
    font-size: .9rem;
}

.property-trash__dl-row dt {
    color: var(--text-muted);
    font-weight: 500;
}

.property-trash__dl-row dd {
    margin: 0;
}

.property-trash__section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.property-trash__section-title {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 .4rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.property-trash__actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}

.property-trash__restore-btn {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.property-trash__restore-btn:hover {
    opacity: .88;
}

/* شارات الأحداث */
.al-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.al-badge--green   { background: rgba(34,197,94,.15);  color: #15803d; }
.al-badge--blue    { background: rgba(59,130,246,.15); color: #1d4ed8; }
.al-badge--orange  { background: rgba(249,115,22,.15); color: #c2410c; }
.al-badge--yellow  { background: rgba(234,179,8,.15);  color: #a16207; }
.al-badge--teal    { background: rgba(20,184,166,.15); color: #0f766e; }
.al-badge--red     { background: rgba(239,68,68,.15);  color: #b91c1c; }
.al-badge--purple  { background: rgba(168,85,247,.15); color: #7e22ce; }
.al-badge--indigo  { background: rgba(99,102,241,.15); color: #3730a3; }
.al-badge--gray    { background: rgba(107,114,128,.15);color: #374151; }

[data-theme="dark"] .al-badge--green   { color: #4ade80; }
[data-theme="dark"] .al-badge--blue    { color: #60a5fa; }
[data-theme="dark"] .al-badge--orange  { color: #fb923c; }
[data-theme="dark"] .al-badge--yellow  { color: #facc15; }
[data-theme="dark"] .al-badge--teal    { color: #2dd4bf; }
[data-theme="dark"] .al-badge--red     { color: #f87171; }
[data-theme="dark"] .al-badge--purple  { color: #c084fc; }
[data-theme="dark"] .al-badge--indigo  { color: #818cf8; }
[data-theme="dark"] .al-badge--gray    { color: #9ca3af; }

/* ترقيم الصفحات */
.al-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.al-pagination__info {
    margin-inline-start: auto;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.btn--active-page {
    background: var(--gold) !important;
    color: #000 !important;
    border-color: var(--gold) !important;
    font-weight: 700;
    pointer-events: none;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 0.6rem 0.5rem;
    text-align: start;
    border-bottom: 1px solid var(--border);
}

.users-table th {
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.users-table tr:hover td {
    background: var(--surface-2);
}

.users-table select {
    min-width: 10rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}

.users-table .btn-inline {
    width: auto;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--danger, #b42318) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.btn-danger:hover {
    background: #8f1a12 !important;
}

.accounts-delete-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* إدارة كتالوج العقار — قائمة الأقسام ولوحات مخفية */
.catalog-section-bar {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.catalog-section-bar label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.catalog-section-select {
    width: 100%;
    max-width: 22rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text);
    font: inherit;
}

.catalog-panel {
    display: none;
    margin-top: 0;
}

.catalog-panel--active {
    display: block;
    margin-top: 1rem;
}

.catalog-panel .manage-h3 {
    text-align: center;
}

.catalog-panel .table-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.catalog-panel .table-wrap .users-table {
    width: auto;
    min-width: min(100%, 22rem);
    max-width: 100%;
    margin-inline: auto;
}

.catalog-panel .users-table th,
.catalog-panel .users-table td {
    text-align: center;
}

.catalog-panel .users-table th:last-child,
.catalog-panel .users-table td:last-child {
    text-align: center;
}

.property-default-media-preview {
    margin-top: 0.75rem;
}

.property-default-media-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.property-default-media-preview__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.property-default-media-preview__grid img {
    width: auto;
    max-height: 140px;
    object-fit: cover;
}

.property-add-picked-cover {
    margin: 0.5rem 0 0.65rem;
}

.property-add-picked-gallery {
    margin: 0.5rem 0 0.35rem;
}

.property-add-picked-gallery__name {
    margin: 0;
    text-align: center;
    word-break: break-word;
}

/* إدارة المحافظات والمناطق — أزرار الإجراءات في الجداول (مقاس موحّد) */
.kw-geo-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.kw-geo-actions .btn,
.kw-geo-actions__form .btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0;
    width: 6.75rem;
    min-width: 6.75rem;
    min-height: 2.5rem;
    max-width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.kw-geo-actions__form {
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
}

@media (max-width: 520px) {
    .kw-geo-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .kw-geo-actions .btn,
    .kw-geo-actions__form .btn {
        width: 100%;
        min-width: 0;
    }

    .kw-geo-actions__form {
        width: 100%;
    }
}

.kw-geo-actions .btn.kw-geo-action--active {
    border-color: var(--teal);
    background: var(--secondary-soft);
    color: var(--text);
    font-weight: 600;
}

[data-theme="dark"] .kw-geo-actions .btn.kw-geo-action--active {
    border-color: var(--gold);
    background: var(--accent-soft);
}

.kw-geo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    transition: border-color var(--transition), background var(--transition);
}

.kw-geo-back-link:hover {
    border-color: var(--teal);
    background: var(--surface-1);
}

[data-theme="dark"] .kw-geo-back-link:hover {
    border-color: var(--gold);
}

/* نموذج إضافة/تعديل محافظة أو منطقة — بدون إطار منقط */
.kw-geo-form {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem 1rem 0.85rem;
    max-width: 32rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    outline: none;
    box-shadow: none;
}

.kw-geo-form:focus-within {
    outline: none;
    box-shadow: 0 0 0 2px var(--secondary-soft);
}

[data-theme="dark"] .kw-geo-form:focus-within {
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.kw-geo-form--region {
    margin-bottom: 1.25rem;
}

/* علامة تجارية + فوتر */
.brand-stack {
    text-decoration: none;
    color: inherit;
}

.brand-row-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
}

.brand-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--tagline-soft-yellow);
    max-width: 14rem;
    line-height: 1.25;
}

.site-footer {
    margin-top: auto;
    padding: 1rem 1.25rem 1.25rem;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-strong);
}

.site-footer-inner {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-copy {
    margin: 0 0 0.65rem;
    color: var(--text);
}

.footer-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    justify-content: center;
    align-items: center;
}

.footer-contact-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
}

.footer-phone {
    font-weight: 600;
    unicode-bidi: embed;
}

/* إدارة الموقع + الهاتف بمفتاح دولة */
.site-manage-card .manage-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.site-manage-card .manage-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.manage-h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--text);
}

.manage-h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.phone-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.dial-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1 1 9rem;
    min-width: 9rem;
}

.dial-select {
    width: 100%;
    padding: 0.65rem 2.75rem 0.65rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.dial-badge {
    position: absolute;
    inset-inline-end: 1.6rem;
    pointer-events: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.dial-select-wrap::after {
    content: '▾';
    position: absolute;
    inset-inline-end: 0.5rem;
    pointer-events: none;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.phone-local-input {
    flex: 2 1 10rem;
    min-width: 8rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}


.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field-group {
    margin: 0 0 1.25rem;
    padding: 1rem 1rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.field-group__legend {
    padding: 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

/* رابط إدارة المحافظات والمناطق — نموذج إضافة عقار */
.property-geo-manage-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0 0 0.9rem;
}

.property-geo-manage-row__hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
    flex: 1 1 12rem;
}

.geo-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(42, 111, 151, 0.45);
    background: var(--secondary-soft);
    color: var(--teal);
    box-shadow: 0 1px 0 rgba(18, 31, 43, 0.06);
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.08s ease;
}

.geo-admin-link:hover {
    background: rgba(42, 111, 151, 0.16);
    border-color: var(--teal);
    color: var(--copper);
}

.geo-admin-link:active {
    transform: translateY(1px);
}

.geo-admin-link__icon {
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.92;
}

[data-theme="dark"] .geo-admin-link {
    border-color: rgba(249, 168, 0, 0.42);
    background: var(--accent-soft);
    color: var(--gold-bright);
    box-shadow: none;
}

[data-theme="dark"] .geo-admin-link:hover {
    background: rgba(249, 168, 0, 0.22);
    border-color: var(--gold);
    color: var(--text-soft);
}

.alert-error .geo-admin-link--in-alert {
    margin-top: 0.35rem;
    margin-inline-end: 0.35rem;
    display: inline-flex;
    vertical-align: middle;
    border-color: rgba(42, 111, 151, 0.4);
    background: var(--surface-2);
    color: var(--teal);
}

[data-theme="dark"] .alert-error .geo-admin-link--in-alert {
    border-color: rgba(249, 168, 0, 0.4);
    background: rgba(30, 35, 42, 0.65);
    color: var(--gold-bright);
}

.alert-error__tail {
    display: inline;
    font-size: inherit;
}

/* نموذج العقار: محافظة، منطقة، …، مساحة — سطران على الشاشة العريضة */
.property-loc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    margin-bottom: 0.25rem;
}

.property-loc-grid .field {
    margin-bottom: 0;
    min-width: 0;
}

@media (max-width: 900px) {
    .property-loc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .property-loc-grid {
        grid-template-columns: 1fr;
    }
}

.input-readonly {
    opacity: 0.85;
    cursor: not-allowed;
}

.field-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

.field-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.site-manage-form .field > label:not(.check-label):not(.field-checkbox-label),
.form-infield-labels .field > label:not(.check-label):not(.field-checkbox-label) {
    display: none;
}

.site-manage-form .field-label-row > label:first-child:not(.field-checkbox-label),
.form-infield-labels .field-label-row > label:first-child:not(.field-checkbox-label) {
    display: none;
}

.site-manage-form .field > .field-label-text,
.form-infield-labels .field > .field-label-text {
    display: none;
}

.site-manage-form .field-infield-file-box,
.form-infield-labels .field-infield-file-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: var(--surface-2);
}

.site-manage-form .field-infield-file-title,
.form-infield-labels .field-infield-file-title {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.site-manage-form .field-infield-file-box .profile-meta,
.form-infield-labels .field-infield-file-box .profile-meta {
    margin: 0 0 0.5rem;
}

.site-manage-form .field-infield-file-box input[type="file"],
.form-infield-labels .field-infield-file-box input[type="file"] {
    width: 100%;
    font: inherit;
    color: var(--text);
}

[data-theme="light"] .site-manage-form .field input,
[data-theme="light"] .site-manage-form .field select,
[data-theme="light"] .site-manage-form .field textarea {
    color: #000;
}

.site-contacts-lead {
    margin-top: 0;
    margin-bottom: 1rem;
}

.site-contacts-form-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--surface-2);
}

.site-contacts-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.site-contacts-list-title {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.site-contacts-table__phone {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.site-contacts-table tr.site-contacts-table__row--active td {
    background: rgba(201, 162, 39, 0.12);
}

.site-contacts-actions-cell {
    white-space: nowrap;
}

.site-contacts-actions-cell .btn,
.site-contacts-actions-cell form {
    display: inline-block;
    vertical-align: middle;
}

.site-contacts-delete-form {
    display: inline-block;
    margin: 0;
    margin-inline-start: 0.35rem;
}

.contact-edit-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1rem 0.75rem;
    margin-bottom: 1rem;
    background: var(--surface-2);
}

.contact-new-box {
    margin-top: 1.25rem;
    border-style: dashed;
}

.contact-form-actions {
    margin-bottom: 0.75rem;
}

.contact-delete-form {
    margin: 0 0 0.75rem;
}

.manage-preview-img {
    max-height: 48px;
    width: auto;
    border-radius: 6px;
}

.manage-preview-favicon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.btn-danger-outline {
    border-color: rgba(180, 35, 24, 0.55) !important;
    color: var(--danger) !important;
}

.btn-danger-outline:hover {
    background: rgba(180, 35, 24, 0.1) !important;
}

/* البروفايل: تصدير العقارات */
.profile-section--excel-export {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

.excel-export-intro {
    max-width: 52rem;
    margin-bottom: 1rem;
}

.excel-export-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.excel-export-actions .btn {
    width: auto;
    text-decoration: none;
    box-sizing: border-box;
}

.excel-export-regen-form {
    display: inline;
    margin: 0;
}

.excel-export-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1rem 0.75rem;
    margin: 0 0 1rem;
    background: var(--surface-2);
}

.excel-export-legend {
    padding: 0 0.35rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.excel-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.excel-export-check {
    margin: 0;
    padding: 0.35rem 0.25rem;
    border-radius: 8px;
    transition: background var(--transition);
}

.excel-export-check:hover {
    background: rgba(42, 111, 151, 0.08);
}

[data-theme="dark"] .excel-export-check:hover {
    background: rgba(249, 168, 0, 0.08);
}

/* إعدادات بطاقة البوابة / صفحة العقار العامة */
.card-settings-manage-form .card-settings-checkboxes,
.excel-export-form .excel-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.card-settings-manage-form .card-settings-field {
    margin: 0;
}

.card-settings-manage-form .card-settings-check,
.excel-export-form .excel-export-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    transition: background var(--transition);
}

.card-settings-manage-form .card-settings-check:hover,
.excel-export-form .excel-export-check:hover {
    background: rgba(42, 111, 151, 0.08);
}

[data-theme="dark"] .card-settings-manage-form .card-settings-check:hover,
[data-theme="dark"] .excel-export-form .excel-export-check:hover {
    background: rgba(249, 168, 0, 0.08);
}

.card-settings-manage-form .card-settings-check input[type="checkbox"],
.excel-export-form .excel-export-check input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    margin: 0.15rem 0 0;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
}

[data-theme="light"] .card-settings-manage-form .card-settings-check input[type="checkbox"],
[data-theme="light"] .excel-export-form .excel-export-check input[type="checkbox"] {
    accent-color: #121f2b;
}

.card-settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.65rem 0 0.25rem;
}

.card-settings-toolbar .btn {
    width: auto;
    min-height: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.88rem;
}

.btn-secondary {
    background: var(--secondary-soft);
    color: var(--secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    filter: brightness(1.05);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--text);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    width: auto;
    min-height: 0;
}

.properties-manage-toolbar {
    margin-bottom: 1rem;
}

.properties-manage-pagination {
    margin: 1rem 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.properties-manage-pagination__summary {
    margin: 0;
}

.properties-manage-pagination__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.properties-manage-pagination__links .btn {
    width: auto;
    min-height: 0;
    text-decoration: none;
}

.properties-search-wrap {
    margin-bottom: 0.75rem;
}

.properties-search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.properties-search-input {
    width: 100%;
    max-width: 36rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1rem;
}

.properties-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem 1rem;
    align-items: end;
}

.portal-properties-filters.properties-filters-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.35rem 0.45rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.portal-properties-filters.properties-filters-grid > .field {
    margin-bottom: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.portal-properties-filters.properties-filters-grid > .portal-filter-actions-cell {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.3rem;
    justify-self: end;
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.portal-filter-purpose-cell .properties-filter-select,
.portal-filter-type-cell .properties-filter-select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-filter-actions-cell .btn {
    width: auto;
    min-width: 0;
}

.portal-filter-actions-cell .portal-price-filter-btn,
.portal-filter-actions-cell .portal-search-launch-btn {
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 0;
    padding: 0.4rem 0.48rem;
    font-size: 0.8rem;
    line-height: 1.15;
    font-weight: 700;
}

.portal-price-filter-btn {
    white-space: nowrap;
}

.portal-price-filter-btn.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.portal-price-overlay[hidden] {
    display: none !important;
}

.portal-search-overlay.portal-price-overlay:not([hidden]) {
    z-index: 505;
}

.portal-search-launch-btn {
    white-space: nowrap;
}

.portal-search-launch-btn.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.portal-search-overlay__field {
    margin: 0 0 1.1rem;
}

.portal-search-overlay__field .properties-search-input {
    max-width: none;
    width: 100%;
    font-size: 1.05rem;
    padding: 0.65rem 0.85rem;
    min-height: 2.85rem;
}

.portal-price-overlay:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 4vw, 2rem);
}

body.portal-page-modal-open {
    overflow: hidden;
}

.portal-price-overlay__scrim {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.portal-price-overlay__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 38rem);
    max-height: min(92vh, 40rem);
    overflow: auto;
    padding: clamp(1.35rem, 3.5vw, 2.1rem) clamp(1.25rem, 3.5vw, 2.35rem);
    border-radius: calc(var(--radius) * 1.5);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
}

.portal-price-overlay__close-x {
    position: absolute;
    top: 0.55rem;
    inset-inline-end: 0.55rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.portal-price-overlay__close-x:hover {
    background: var(--border);
    color: var(--text);
}

.portal-price-overlay__heading {
    margin: 0 0 1.1rem;
    padding-inline-end: 2.5rem;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    font-weight: 800;
    line-height: 1.3;
}

.portal-price-overlay__nums {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 0.75rem 1rem;
    margin: 0.85rem 0 1.1rem;
}

.portal-price-num-col .portal-price-num-input {
    max-width: none;
    width: 100%;
    font-size: 1.12rem;
    padding: 0.65rem 0.8rem;
    min-height: 2.85rem;
}

.portal-price-overlay__slider-wrap {
    margin: 0.25rem 0 0;
    padding: 1rem 0.65rem;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.portal-price-dual-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2rem;
}

.portal-price-dual-row--labels-outside-flip {
    flex-direction: row-reverse;
}


.portal-price-dual-side {
    flex-shrink: 0;
    width: 2.35rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}

.portal-price-dual-row--large .portal-price-dual-side {
    width: 2.65rem;
    font-size: 0.92rem;
}

.portal-price-dual-track {
    position: relative;
    flex: 1;
    height: 1.75rem;
    min-width: 0;
}

.portal-price-dual-row--large .portal-price-dual-track {
    height: 2.35rem;
}

.portal-price-range {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 1.5rem;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}

.portal-price-dual-row--large .portal-price-range {
    height: 2.35rem;
}

.portal-price-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 4px;
}

.portal-price-range--lo::-webkit-slider-runnable-track {
    background: transparent;
}

.portal-price-range--hi::-webkit-slider-runnable-track {
    background: var(--border);
}

.portal-price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: auto;
}

.portal-price-dual-row--large .portal-price-range::-webkit-slider-thumb {
    width: 1.4rem;
    height: 1.4rem;
    margin-top: -8px;
}

.portal-price-range::-moz-range-track {
    height: 6px;
    border-radius: 4px;
}

.portal-price-range--lo::-moz-range-track {
    background: transparent;
}

.portal-price-range--hi::-moz-range-track {
    background: var(--border);
}

.portal-price-range::-moz-range-thumb {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-elevated);
    cursor: pointer;
    pointer-events: auto;
}

.portal-price-dual-row--large .portal-price-range::-moz-range-thumb {
    width: 1.4rem;
    height: 1.4rem;
}

.portal-price-range--lo {
    z-index: 2;
}

.portal-price-range--hi {
    z-index: 3;
}

.portal-price-overlay__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.portal-price-overlay__actions .btn {
    flex: 1;
    min-width: 9rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
}

.portal-price-reset-btn {
    min-height: 2.65rem;
}

.field--compact label {
    font-size: 0.85rem;
}

.properties-filter-select {
    width: 100%;
}

.properties-count-hint {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.properties-row-hidden {
    display: none !important;
}

.properties-manage-table tbody tr.properties-data-row {
    content-visibility: auto;
    contain-intrinsic-size: auto 2.75rem;
}

.properties-actions-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}

.properties-delete-form {
    display: inline;
    margin: 0;
}

.property-cover-preview img {
    max-width: 220px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* تعديل عقار — معاينة الغلاف والمعرض */
.property-edit-media-field .field-hint {
    margin-top: 0.15rem;
}

.property-edit-cover-zone {
    margin: 0.5rem 0 0.65rem;
}

.property-edit-cover-preview-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.property-edit-cover-preview-img {
    display: block;
    max-width: min(100%, 22rem);
    max-height: 14rem;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.property-edit-cover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.property-edit-file-row {
    margin-top: 0.35rem;
}

.property-edit-file-row input[type="file"] {
    width: auto;
    max-width: 100%;
}

.property-edit-cover-empty {
    margin: 0.35rem 0 0;
}

.property-edit-gallery-zone {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.65rem;
    margin: 0.5rem 0 0.65rem;
}

.property-edit-gallery-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: 0.45rem;
}

.property-edit-gallery-card__media {
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 6.5rem;
    max-height: 10rem;
}

.property-edit-gallery-card__img {
    display: block;
    max-width: 100%;
    max-height: 10rem;
    width: auto;
    height: auto;
    object-fit: contain;
}

.property-edit-gallery-card__video {
    display: block;
    width: 100%;
    max-height: 10rem;
    background: #0a0e14;
}

.property-edit-gallery-card__remove {
    align-self: center;
}

/* إدارة التواصل — لون المنصة وأيقونة المعاينة */
.contact-platforms-card .manage-h2 {
    margin-top: 0;
}

.contact-platform-icon-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.contact-platform-icon-row input {
    flex: 1;
    min-width: 12rem;
}

.field-label-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.4rem;
}

.field-label-row > label:first-child {
    margin: 0;
    font-weight: 600;
}

.field-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.field-checkbox-label {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.field-inline-check input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    cursor: pointer;
    accent-color: var(--accent);
}

[data-theme="light"] .field-inline-check input[type="checkbox"] {
    accent-color: #121f2b;
}

.contact-platforms-table__dash {
    font-size: 1.1rem;
    color: var(--text-muted);
    opacity: 0.65;
}

.contact-platform-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 1.35rem;
    color: var(--secondary);
}

.platform-color-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    max-width: 28rem;
}

/* ═══ حقل لون المنصة — تصميم جديد ═══ */

/* الحاوية الموحّدة: عمودان جنباً إلى جنب */
.platform-color-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

@media (max-width: 520px) {
    .platform-color-dual {
        grid-template-columns: 1fr;
    }
}

/* كل بلوك (لايت / دارك) */
.platform-color-mode-block {
    border-radius: 10px;
    padding: 0.65rem 0.75rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.platform-color-mode-block--dark {
    background: #111c29;
    border-color: rgba(255, 255, 255, 0.1);
}

.platform-color-mode-label {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.platform-color-mode-block--dark .platform-color-mode-label {
    color: rgba(169, 214, 229, 0.75);
}

.platform-color-mode-hint {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-inline-start: 0.2rem;
}

/* حقل الـ HEX داخل البلوك */
.platform-color-hex {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: #121f2b;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

/* داخل بلوك الدارك مود — يبقى داكناً دائماً */
.platform-color-mode-block--dark .platform-color-hex {
    background: #0a1420;
    color: #d8e8f4;
    border-color: rgba(255, 255, 255, 0.12);
}

.platform-color-mode-block--dark .platform-color-picker {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.platform-color-mode-block--dark .platform-color-picker:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.platform-color-swatch {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.platform-color-swatch--sm {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 6px;
}

.platform-color-picker {
    width: 2.75rem;
    height: 2.5rem;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--surface-2);
    transition: border-color var(--transition), background var(--transition);
    flex-shrink: 0;
}

.platform-color-picker:hover {
    border-color: #121f2b;
    background: var(--bg-elevated);
}

.platform-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.platform-color-picker::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

.platform-color-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    direction: ltr;
}

.platform-color-hex-inline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-platforms-table__preview {
    text-align: center;
    vertical-align: middle;
}

.contact-platforms-table__icon-wrap {
    display: inline-flex;
    font-size: 1.25rem;
}

/* معاينة اللونين في الجدول */
.cp-preview-dual {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.cp-preview-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cp-preview-chip--light {
    background: #f0f4f8;
    border: 1px solid #d4e3eb;
}

.cp-preview-chip--dark {
    background: #1a2836;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* خلية اللونين في الجدول */
.cp-color-dual {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cp-color-dual__row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cp-color-swatch--light {
    outline: 1px solid #d4e3eb;
}

.cp-color-swatch--dark {
    outline: 1px solid rgba(255, 255, 255, 0.18);
}

.cp-color-same {
    font-style: italic;
    opacity: 0.6;
    font-size: 0.75rem;
}

.contact-platforms-table__url {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.contact-platforms-table__order {
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.contact-platforms-table__order .contact-platforms-order-form {
    display: inline-block;
    margin: 0 0.15rem;
    vertical-align: middle;
}

.contact-platforms-table__order-muted {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ——— الرئيسية للزائر ——— */
/* توسيط العمود في RTL وLTR: main بعرض أقصى دون margin يلتصق بـ inline-start (اليمين في العربية) */
.main-wrap--visitor-home {
    width: 100%;
    max-width: min(96vw, 28rem);
    margin-inline: auto;
    box-sizing: border-box;
}

.visitor-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.visitor-home > .visitor-home__panel.card {
    width: min(100%, 28rem);
    max-width: 28rem;
    margin-inline: auto;
    box-sizing: border-box;
}

.visitor-home__panel {
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--surface-2) 100%);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .visitor-home__panel {
    background: linear-gradient(180deg, #0f1828 0%, #121f2b 55%, #151f30 100%);
    border-color: rgba(249, 168, 0, 0.12);
}

.visitor-home__brand {
    text-align: center;
    margin: 0 0 1.25rem;
    padding: 0 0 1.25rem;
    border-bottom: 1px solid var(--border);
}

.visitor-home__brand-logo {
    display: block;
    margin: 0 auto;
    width: auto;
    max-width: min(52vw, 10.5rem);
    max-height: 8rem;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
}

.visitor-home__brand-name {
    margin: 0.9rem 0 0.3rem;
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

.visitor-home__brand-tagline {
    margin: 0 auto;
    max-width: 28rem;
    font-size: clamp(0.95rem, 2.6vw, 1.08rem);
    line-height: 1.55;
    font-weight: 500;
    color: #121f2b;
}

[data-theme="dark"] .visitor-home__brand-tagline {
    color: var(--text-soft);
    opacity: 1;
}

.visitor-home__kicker {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.visitor-home__title {
    margin: 0 0 1.1rem;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    line-height: 1.25;
}

.visitor-home__kicker--center,
.visitor-home__title--center {
    text-align: center;
}

.visitor-home__pill-column {
    width: min(90vw, 26.5rem);
    max-width: 100%;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
}

.visitor-home__action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0 0 0.35rem;
    width: 100%;
}

/* أزرار الرئيسية للزائر — نمط «حبة» عريضة في المنتصف (مثل مرجع المسري) */
.visitor-pill-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    min-height: 3.7rem;
    padding: 0.5rem 0.55rem;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1c2536;
    color: #f0f2f6;
    text-decoration: none;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

[data-theme="light"] .visitor-pill-btn {
    background: #e8ecf2;
    color: var(--navy);
    border-color: rgba(18, 31, 43, 0.12);
}

.visitor-pill-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .visitor-pill-btn:hover {
    box-shadow: 0 6px 18px rgba(18, 31, 43, 0.12);
}

.visitor-pill-btn--portal,
[data-theme="light"] .visitor-pill-btn--portal {
    background: #121f2b;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(18, 31, 43, 0.25);
}

.visitor-pill-btn--portal:hover,
[data-theme="light"] .visitor-pill-btn--portal:hover {
    background: #1e3349;
    border-color: rgba(255, 255, 255, 0.2);
}

.visitor-pill-btn--admin {
    border-color: rgba(169, 214, 229, 0.45);
    box-shadow: 0 0 0 1px rgba(42, 111, 151, 0.15);
}

.visitor-pill-btn--admin:hover {
    border-color: rgba(169, 214, 229, 0.75);
}

.visitor-pill-btn--surface {
    border-color: rgba(255, 255, 255, 0.12);
}

.visitor-pill-btn--request {
    border-color: rgba(42, 111, 151, 0.35);
}
.visitor-pill-btn--request:hover {
    border-color: rgba(42, 111, 151, 0.65);
}
[data-theme="light"] .visitor-pill-btn--request {
    border-color: rgba(42, 111, 151, 0.25);
}

.visitor-pill-btn__icon-box {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 1.12rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .visitor-pill-btn__icon-box {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(18, 31, 43, 0.1);
}

.visitor-pill-btn__icon-box--gold {
    color: var(--gold);
    border-color: rgba(249, 168, 0, 0.4);
    background: rgba(249, 168, 0, 0.12);
}

.visitor-pill-btn__icon-box--blue {
    color: var(--sky);
    border-color: rgba(169, 214, 229, 0.35);
    background: rgba(42, 111, 151, 0.2);
}

[data-theme="light"] .visitor-pill-btn__icon-box--blue {
    color: var(--teal);
    background: rgba(42, 111, 151, 0.12);
}

/* تحديد اللون الفعلي حسب الثيم */
.visitor-pill-btn--social {
    --pill-accent: var(--pill-accent-dark, var(--gold));
}

[data-theme="light"] .visitor-pill-btn--social {
    --pill-accent: var(--pill-accent-light, var(--teal));
}

.visitor-pill-btn__icon-box--accent {
    color: var(--pill-accent, var(--gold));
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.visitor-pill-btn--social .visitor-pill-btn__icon-box--accent {
    border-color: color-mix(in srgb, var(--pill-accent, var(--gold)) 42%, transparent);
    background: color-mix(in srgb, var(--pill-accent, var(--gold)) 16%, rgba(0, 0, 0, 0.2));
}

[data-theme="light"] .visitor-pill-btn--social .visitor-pill-btn__icon-box--accent {
    background: color-mix(in srgb, var(--pill-accent, var(--teal)) 14%, #fff);
}

.visitor-pill-btn__icon-box--empty {
    opacity: 0.45;
}

.visitor-pill-btn__label {
    flex: 1 1 auto;
    text-align: center;
    min-width: 0;
    padding-inline: 0.4rem;
    line-height: 1.35;
}

.visitor-pill-btn__chevron {
    flex: 0 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    opacity: 0.42;
}

.visitor-pill-btn__chevron--muted {
    opacity: 0.22;
}

.visitor-pill-btn--static {
    cursor: default;
}

.visitor-pill-btn--static:hover {
    transform: none;
    box-shadow: none;
}

.visitor-pill-btn--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-bottom: 0.55rem;
}

.visitor-pill-btn__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    min-height: 2.75rem;
}

.visitor-pill-btn__hint {
    display: block;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 500;
    color: rgba(232, 231, 228, 0.55);
}

[data-theme="light"] .visitor-pill-btn__hint {
    color: var(--text-muted);
}

.visitor-home__section-title {
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border);
}

.visitor-home__section-title--in-column {
    text-align: center;
    margin-top: 0.85rem;
    padding-top: 1rem;
}

.visitor-home__empty {
    margin: 0;
    text-align: center;
}

.visitor-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.visitor-contact-list--stack {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
}

.visitor-contact-list--pill {
    gap: 0.65rem;
}

.visitor-contact-list__item {
    margin: 0;
    width: 100%;
}

.visitor-contact-list--stack .visitor-contact-list__item {
    width: 100%;
}

/* ——— بوابة العقارات ——— */
.main-wrap--portal .portal-page-card {
    max-width: 72rem;
    margin-inline: auto;
}

.portal-page-header {
    margin-bottom: 1.5rem;
}

.portal-page-header__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.portal-page-header__title-row h1 {
    margin: 0;
}

.portal-page-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.portal-page-home-btn:hover {
    background: var(--surface-2);
    color: var(--accent);
}

.portal-page-home-btn i {
    font-size: 1.1rem;
}

.portal-page-lead {
    max-width: 44rem;
}

/* ── إحصائيات زوار البوابة ── */
.portal-visit-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.6rem;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.portal-visit-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.portal-visit-stat .fa-eye {
    font-size: 0.78rem;
    opacity: 0.7;
}
.portal-visit-stat__label {
    opacity: 0.8;
}
.portal-visit-stat__val {
    font-weight: 700;
    color: var(--text);
}
.portal-visit-stat__sep {
    opacity: 0.4;
}

.portal-properties-filters {
    margin-top: 0.35rem;
}

.properties-manage-toolbar > .portal-geo-picker:first-child {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .portal-properties-filters.properties-filters-grid {
        gap: 0.28rem 0.32rem;
    }

    .portal-properties-filters.properties-filters-grid > .portal-filter-actions-cell {
        gap: 0.22rem;
    }

    .portal-properties-filters .properties-filter-select {
        font-size: 0.78rem;
        padding: 0.38rem 0.4rem;
        padding-inline-end: 1.5rem;
    }

    .portal-filter-actions-cell .portal-price-filter-btn,
    .portal-filter-actions-cell .portal-search-launch-btn {
        padding: 0.24rem 0.3rem;
        font-size: 0.68rem;
        line-height: 1.1;
        border-width: 1px;
    }
}

.portal-geo-picker {
    margin-top: 0.35rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.portal-geo-combo-wrap {
    position: relative;
    margin-top: 0;
}

/* Scrim شفاف يغطي الشاشة كاملة خلف القائمة — يمنع الضغط على العناصر خلفها */
.portal-geo-scrim {
    position: fixed;
    inset: 0;
    z-index: 450;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: default;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

body.portal-geo-picker-open {
    overflow: hidden;
}

.portal-geo-combo-wrap--open .portal-geo-combo-input-row,
.portal-geo-combo-wrap--open .portal-geo-selected-strip {
    position: relative;
    z-index: 452;
}

.portal-geo-scrim[hidden] {
    display: none !important;
}

.portal-geo-combo-input-row {
    position: relative;
}

.portal-geo-combo-input {
    max-width: none;
    width: 100%;
}

.portal-geo-listbox {
    contain: layout style;
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 0.25rem);
    z-index: 451;
    max-height: min(22rem, 55vh);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
}

/* السمة hidden لا تخفي العنصر إذا فرضنا display:flex أعلاه — نلزم الإخفاء */
.portal-geo-listbox[hidden] {
    display: none !important;
}

.portal-geo-listbox-scroll {
    overflow: auto;
    padding: 0.35rem 0.25rem 0.5rem;
    flex: 1;
    min-height: 0;
}

.portal-geo-selected-strip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.5rem 0.15rem 0.35rem;
    font-size: 0.88rem;
}

.portal-geo-selected-strip[hidden] {
    display: none !important;
}

.portal-geo-selected-gov-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    width: 100%;
}

.portal-geo-selected-gov-group__title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.35;
}

.portal-geo-selected-gov-group__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    width: 100%;
    padding-inline-start: 0.15rem;
}

.portal-geo-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.15rem 0.35rem 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.portal-geo-chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

.portal-geo-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.portal-geo-chip__remove:hover {
    background: var(--surface-2);
    color: var(--text);
}

.portal-geo-picker__empty {
    margin: 0.75rem 0 0;
}

.portal-geo-gov {
    margin: 0 0 0.85rem;
    padding: 0 0.35rem 0.65rem;
    border-bottom: 1px solid var(--border);
}

.portal-geo-gov:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.portal-geo-gov--hidden {
    display: none !important;
}

.portal-geo-opt--hidden,
.portal-geo-reg-list__item--hidden {
    display: none !important;
}

.portal-geo-filter-empty,
.portal-geo-filter-hint {
    margin: 0.5rem 0.65rem 0.25rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    border-radius: var(--radius);
    background: var(--surface-2);
}

.portal-geo-filter-hint--limit {
    font-size: 0.85rem;
}

.portal-geo-gov__head {
    margin-bottom: 0.35rem;
}

.portal-geo-reg-list {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0 1rem 0 0;
}

.portal-geo-reg-list__item {
    margin: 0.2rem 0;
}

.portal-geo-opt {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    width: 100%;
    margin: 0;
    padding: 0.4rem 0.45rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: start;
    cursor: pointer;
}

.portal-geo-opt:hover {
    background: var(--surface-2);
}

.portal-geo-opt.is-selected {
    background: var(--surface-2);
    outline: 1px solid var(--accent);
}

.portal-geo-opt--reg {
    font-weight: 500;
    color: var(--text-muted);
}

.portal-geo-opt__check {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-elevated);
}

.portal-geo-opt.is-selected .portal-geo-opt__check {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 2px var(--bg-elevated);
}

.portal-geo-label__text {
    flex: 1;
    min-width: 0;
}

.portal-geo-count {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.portal-empty {
    padding: 1rem 0 0.5rem;
}


.portal-property-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 1.1rem;
}

.portal-property-card {
    position: relative;
    margin: 0;
}

/* ── زر المفضلة على بطاقة العقار ── */
:root {
    --fav-color: #e53e3e;
    --fav-color-hover: #c53030;
}

.fav-card-btn {
    position: absolute;
    top: 0.55rem;
    inset-inline-start: 0.55rem;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fav-card-btn:hover {
    background: rgba(229, 62, 62, 0.85);
    border-color: rgba(229, 62, 62, 0.6);
    color: #fff;
}

.fav-card-btn.is-fav {
    color: var(--fav-color);
    background: rgba(229, 62, 62, 0.18);
    border-color: rgba(229, 62, 62, 0.5);
}

.fav-card-btn.is-fav:hover {
    background: rgba(229, 62, 62, 0.85);
    color: #fff;
}

[data-theme="light"] .fav-card-btn {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(229, 62, 62, 0.3);
    color: var(--fav-color);
}

[data-theme="light"] .fav-card-btn:hover,
[data-theme="light"] .fav-card-btn.is-fav:hover {
    background: var(--fav-color);
    color: #fff;
    border-color: var(--fav-color);
}

[data-theme="light"] .fav-card-btn.is-fav {
    background: rgba(229, 62, 62, 0.1);
    border-color: rgba(229, 62, 62, 0.5);
    color: var(--fav-color);
}

@keyframes fav-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.fav-card-btn.fav-pop {
    animation: fav-pop 0.38s ease;
}

/* زر المفضلة في صفحة تفاصيل العقار */
.fav-public-btn.is-fav {
    color: var(--fav-color) !important;
}

[data-theme="light"] .fav-public-btn.is-fav {
    color: var(--fav-color) !important;
    background: rgba(229, 62, 62, 0.1) !important;
    border-color: rgba(229, 62, 62, 0.4) !important;
}

/* ── أيقونة إشعارات طلبات الإضافة في الشريط العلوي ── */
.topbar-notify-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(249, 168, 0, 0.45);
    background: rgba(236, 234, 231, 0.1);
    color: var(--gold);
    font-size: 1.15rem;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.topbar-notify-link:hover,
.topbar-notify-link.is-active {
    border-color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold-bright);
}

.topbar-notify-link:focus { outline: none; }
.topbar-notify-link:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.topbar-notify-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px var(--bg);
}

[data-theme="light"] .topbar-notify-link {
    background: rgba(236, 234, 231, 0.14);
    border-color: rgba(249, 168, 0, 0.55);
    color: var(--gold-bright);
}

[data-theme="light"] .topbar-notify-link:hover,
[data-theme="light"] .topbar-notify-link.is-active {
    background: rgba(249, 168, 0, 0.2);
}

/* ── رابط المفضلة الثابت في الشريط العلوي — نفس تنسيق nav-profile-btn ── */
.topbar-fav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(249, 168, 0, 0.45);
    background: rgba(236, 234, 231, 0.1);
    color: var(--gold);
    font-size: 1.35rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.topbar-fav-link:hover,
.topbar-fav-link.is-active {
    border-color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold-bright);
}

.topbar-fav-link:focus { outline: none; }
.topbar-fav-link:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

[data-theme="light"] .topbar-fav-link {
    background: rgba(236, 234, 231, 0.14);
    border-color: rgba(249, 168, 0, 0.55);
    color: var(--gold-bright);
}

[data-theme="light"] .topbar-fav-link:hover,
[data-theme="light"] .topbar-fav-link.is-active {
    background: rgba(249, 168, 0, 0.2);
}

/* سطح المكتب: اعرض النص بجانب الأيقونة */
@media (min-width: 769px) {
    .topbar-fav-link {
        width: auto;
        padding: 0 0.75rem;
        font-size: 1rem;
        font-weight: 600;
    }
    .topbar-fav-link i {
        font-size: 1.1rem;
    }
}

/* الهواتف: أيقونة فقط 42×42 بدون نص */
@media (max-width: 768px) {
    .topbar-fav-link .topbar-fav-text {
        display: none;
    }
}

/* ── زر التواصل على بطاقة العقار ── */
.portal-card-contact-btn {
    position: absolute;
    top: 0.55rem;
    inset-inline-end: 0.55rem;
    z-index: 10;
}
/* عند الضغط على الرابط للبطاقة لا يُطلق الـ tooltip */
.portal-property-card__link {
    display: block;
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════
   مكوّن ct-wrap — زر التواصل + Tooltip
══════════════════════════════════════════ */
.ct-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* الزر */
.ct-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* نسخة البطاقة — أصغر وبخلفية شفافة */
.ct-btn--card {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
    border-radius: 8px !important;
    background: rgba(0,0,0,0.45) !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ct-btn--card:hover {
    background: rgba(249,168,0,0.85) !important;
    color: #000 !important;
}
[data-theme="light"] .ct-btn--card {
    background: rgba(255,255,255,0.75) !important;
    color: var(--gold) !important;
    border-color: rgba(249,168,0,0.4) !important;
}
[data-theme="light"] .ct-btn--card:hover {
    background: var(--gold) !important;
    color: #fff !important;
}
/* زر واتساب — داك مود: لون الأيقونة برتقالي (pill-accent-dark) / لايت مود: خلفية كحلية + أيقونة بيضاء */
.ct-btn--whatsapp.ct-btn--card {
    --pill-accent: var(--pill-accent-dark, var(--gold));
    color: var(--pill-accent) !important;
    background: color-mix(in srgb, var(--pill-accent) 14%, rgba(0,0,0,0.25)) !important;
    border-color: color-mix(in srgb, var(--pill-accent) 42%, transparent) !important;
}
.ct-btn--whatsapp.ct-btn--card:hover {
    background: var(--pill-accent) !important;
    color: #fff !important;
    border-color: var(--pill-accent) !important;
}
[data-theme="light"] .ct-btn--whatsapp.ct-btn--card {
    --pill-accent: var(--pill-accent-light, #121f2b);
    color: #fff !important;
    background: var(--pill-accent) !important;
    border-color: var(--pill-accent) !important;
}
[data-theme="light"] .ct-btn--whatsapp.ct-btn--card:hover {
    background: color-mix(in srgb, var(--pill-accent) 75%, #000) !important;
    color: #fff !important;
    border-color: color-mix(in srgb, var(--pill-accent) 75%, #000) !important;
}

/* الـ Tooltip */
.ct-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 13rem;
    max-width: 18rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top end;
    transition: opacity 0.17s, visibility 0.17s, transform 0.17s;
}
.ct-wrap:hover .ct-tooltip,
.ct-wrap:focus-within .ct-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ct-tooltip__heading {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0.75rem 0.4rem;
    border-bottom: 1px solid var(--border);
    margin: 0 0 0.3rem;
}

.ct-tooltip__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ct-tooltip__item {
    margin: 0;
}

.ct-tooltip__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.75rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
    transition: background 0.12s;
    cursor: pointer;
}
.ct-tooltip__link:hover {
    background: var(--surface-2);
}
.ct-tooltip__link--nolink {
    color: var(--text-muted);
    cursor: default;
}
.ct-tooltip__link--nolink:hover {
    background: transparent;
}

.ct-tooltip__icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(42,111,151,0.15); /* fallback */
    background: color-mix(in srgb, var(--ct-color, #2a6f97) 18%, transparent);
    color: var(--ct-color, #2a6f97);
    font-size: 0.85rem;
    flex-shrink: 0;
}
[data-theme="dark"] .ct-tooltip__icon {
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold);
    border: 1px solid rgba(249, 168, 0, 0.3);
}

.ct-tooltip__name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-tooltip__empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.portal-property-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.portal-property-card__link:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.portal-property-card__media {
    aspect-ratio: 5 / 3;
    background: var(--surface-2);
    overflow: hidden;
}

.portal-property-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-property-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    color: var(--text-muted);
    opacity: 0.45;
}

.portal-property-card__body {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-property-card__title {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.35;
    font-weight: 700;
}

.portal-property-card__meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.portal-property-card__loc {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.portal-property-card__dot {
    margin: 0 0.2rem;
    opacity: 0.5;
}

/* ── عدد المشاهدات على بطاقة العقار ── */
.portal-property-card__views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}
.portal-property-card__views .fa-eye {
    font-size: 0.7rem;
    opacity: 0.6;
}

.portal-property-card__price {
    margin: 0.25rem 0 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
}

[data-theme="light"] .portal-property-card__price {
    color: #121f2b;
}

.portal-property-card__currency {
    font-size: 0.85rem;
    font-weight: 600;
    margin-inline-start: 0.2rem;
    opacity: 0.9;
}

.portal-property-card__price-type {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.75;
    margin-inline-start: 0.35rem;
}

[data-theme="light"] .portal-property-card__price-type {
    color: #121f2b;
    opacity: 0.65;
}

.portal-property-card__details-line {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    margin: 0.2rem 0 0;
    line-height: 1.5;
}

.portal-property-card__desc {
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    margin: 0.25rem 0 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-property-card__notes {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    margin: 0.2rem 0 0;
    font-style: italic;
}

.portal-property-card__meta--small {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ——— عرض عقار عام ——— */
.property-public-card {
    max-width: 48rem;
    margin-inline: auto;
}

/* ── أيقونة مشاهدات العقار مع Tooltip ── */
.prop-views-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.prop-views-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    cursor: default;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 0.55rem;
    height: 38px;
    background: var(--surface-2);
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}
.prop-views-btn:hover,
.prop-views-wrap:focus-within .prop-views-btn {
    background: var(--surface-3, var(--surface-2));
    color: var(--text);
}
.prop-views-btn .fa-eye {
    font-size: 0.95rem;
}
.prop-views-total {
    font-weight: 700;
    font-size: 0.85rem;
}
/* Tooltip */
.prop-views-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 10rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
}
.prop-views-wrap:hover .prop-views-tooltip,
.prop-views-wrap:focus-within .prop-views-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.prop-views-tooltip__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.18rem 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.prop-views-tooltip__row:last-child {
    border-bottom: none;
}
.prop-views-tooltip__row strong {
    color: var(--text);
    font-weight: 700;
}
.prop-views-tooltip__row--total {
    margin-top: 0.2rem;
    padding-top: 0.35rem;
    font-weight: 600;
    color: var(--text);
}
.prop-views-tooltip__row--total strong {
    color: var(--gold);
}

.property-public-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-inline-start: auto;
}

.property-public-back-btn,
.property-public-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    text-decoration: none;
    flex-shrink: 0;
    transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition), transform 0.2s ease;
}

.property-public-back-btn {
    background: var(--surface-2);
    color: var(--text);
}

.property-public-back-btn:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.property-public-back-btn i {
    font-size: 1.35rem;
}

.property-public-social-btn {
    border-color: rgba(249, 168, 0, 0.5);
    background: linear-gradient(145deg, rgba(249, 168, 0, 0.22) 0%, rgba(249, 168, 0, 0.08) 100%);
    color: var(--gold-bright);
    box-shadow: 0 2px 10px rgba(249, 168, 0, 0.15);
}

.property-public-social-btn:hover {
    border-color: var(--gold-bright);
    background: linear-gradient(145deg, rgba(249, 168, 0, 0.38) 0%, rgba(249, 168, 0, 0.16) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 168, 0, 0.28);
    transform: translateY(-1px);
}

.property-public-social-btn i {
    font-size: 1.15rem;
}

[data-theme="light"] .property-public-social-btn {
    border-color: rgba(224, 146, 0, 0.45);
    background: linear-gradient(145deg, rgba(249, 168, 0, 0.18) 0%, rgba(255, 255, 255, 0.9) 100%);
    color: #c47f00;
    box-shadow: 0 2px 8px rgba(249, 168, 0, 0.12);
}

/* زر واتساب في صفحة العقار — داك مود: برتقالي، لايت مود: كحلي + أيقونة بيضاء */
.property-public-social-btn.ct-btn--whatsapp {
    --pill-accent: var(--pill-accent-dark, var(--gold));
    border-color: color-mix(in srgb, var(--pill-accent) 42%, transparent) !important;
    background: color-mix(in srgb, var(--pill-accent) 16%, rgba(0,0,0,0.2)) !important;
    color: var(--pill-accent) !important;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--pill-accent) 25%, transparent) !important;
}
.property-public-social-btn.ct-btn--whatsapp:hover {
    background: var(--pill-accent) !important;
    border-color: var(--pill-accent) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--pill-accent) 35%, transparent) !important;
}
[data-theme="light"] .property-public-social-btn.ct-btn--whatsapp {
    --pill-accent: var(--pill-accent-light, #121f2b);
    background: var(--pill-accent) !important;
    border-color: var(--pill-accent) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--pill-accent) 30%, transparent) !important;
}
[data-theme="light"] .property-public-social-btn.ct-btn--whatsapp:hover {
    background: color-mix(in srgb, var(--pill-accent) 75%, #000) !important;
    border-color: color-mix(in srgb, var(--pill-accent) 75%, #000) !important;
    color: #fff !important;
}

.property-public-gallery {
    margin: 0.5rem 0 1.25rem;
}

.property-public-gallery .property-public-h2 {
    margin-top: 0;
}

/* معرض عام: شريحة واحدة مرئية؛ التنقل بالسابق/التالي والنقاط */

.property-gallery-slider__viewport {
    overflow: hidden;
    width: 100%;
    direction: ltr;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.property-gallery-slider__track {
    display: block;
}

.property-gallery-slider__slide {
    display: none;
    width: 100%;
    min-width: 0;
}

.property-gallery-slider__slide.is-active {
    display: block;
}

.property-gallery-slider__figure {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: min(42vh, 16rem);
    max-height: min(56vh, 24rem);
    padding: 0.35rem;
}

.property-gallery-slider__media {
    display: block;
    max-width: 100%;
    max-height: min(54vh, 23rem);
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

video.property-gallery-slider__media {
    background: #0a0e14;
    width: 100%;
}

.property-gallery-slider__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-top: 0.7rem;
}

.property-gallery-slider__nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.property-gallery-slider__nav:hover:not(:disabled) {
    color: var(--accent);
    border-color: rgba(243, 156, 18, 0.45);
    background: var(--surface);
}

.property-gallery-slider__nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.property-gallery-slider__nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.property-gallery-slider__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-width: 8rem;
}

.property-gallery-slider__counter {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.property-gallery-slider__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.property-gallery-slider__dot {
    width: 0.55rem;
    height: 0.55rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border-strong);
    cursor: pointer;
    opacity: 0.55;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.property-gallery-slider__dot:hover {
    opacity: 0.95;
}

.property-gallery-slider__dot.is-active {
    opacity: 1;
    background: var(--accent);
    transform: scale(1.25);
}

.property-gallery-slider__dot:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.property-public-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.property-public-title-row h1 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
}

.property-public-copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.property-public-copy-btn:hover {
    color: var(--accent);
    border-color: rgba(243, 156, 18, 0.45);
    background: var(--surface);
}

.property-public-copy-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.property-public-copy-btn i {
    font-size: 1.1rem;
    line-height: 1;
}

.property-public-header .property-public-ref {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.property-public-loc {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.property-public-dl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem 1rem;
    margin: 1.25rem 0;
    padding: 0;
}

.property-public-dl > div {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.property-public-dl dt {
    margin: 0 0 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: none;
}

.property-public-dl dd {
    margin: 0;
    font-size: 0.95rem;
}

.property-public-dl--wide {
    grid-column: 1 / -1;
}

.property-public-price-block {
    display: flex;
    flex-direction: column;
    align-items: start; /* في RTL = محاذاة لليمين */
    gap: 0.4rem;
    margin: 0.35rem 0 1.35rem;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.property-public-price-main {
    margin: 0;
    padding: 0;
    border: none;
    font-weight: 700;
    font-size: clamp(1.28rem, 4vw, 1.72rem);
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: #f39c12;
    text-align: end; /* أرقام LTR تظهر من اليمين نحو اليسار داخل السطر */
}

[data-theme="light"] .property-public-price-main {
    color: #d97706;
}

.property-public-price-currency {
    font-weight: 700;
    margin-inline-start: 0.3rem;
    white-space: nowrap;
}

.property-public-price-tafqeet {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: min(40rem, 100%);
    text-align: start;
}

.property-public-header .property-public-copy-hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 0;
}

.property-public-header .property-public-copy-hint:empty {
    margin: 0;
}

.property-copy-manage-form .property-copy-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.5rem 1rem;
    margin-top: 0.35rem;
}

.property-copy-manage-form .property-copy-field {
    margin: 0;
}

.property-public-h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.property-public-desc {
    line-height: 1.7;
    color: var(--text);
    font-size: 0.98rem;
}

.property-public-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.property-public-actions .btn {
    width: auto;
}

/* ═══════════════════════════════════════════════════════
   WhatsApp Lead Modal — Light & Dark
═══════════════════════════════════════════════════════ */

body.wa-modal-open { overflow: hidden; }

/* ── Overlay ── */
.wa-modal {
    display: none;
    position: fixed;
    /* fallback لـ inset: 0 على المتصفحات القديمة */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
}
.wa-modal.is-open {
    display: -webkit-flex;
    display: flex;
}

.wa-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Card ── */
.wa-modal__box {
    position: relative;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem 1.75rem 1.75rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;         /* fallback */
    max-height: 90dvh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: waBoxIn .22s cubic-bezier(.34,1.3,.64,1);
    /* يضمن عدم انزلاق البطاقة للأسفل */
    margin: auto;
    flex-shrink: 0;
}
@keyframes waBoxIn {
    from { opacity: 0; transform: translateY(24px) scale(.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── زر الإغلاق ── */
.wa-modal__close {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1;
}
.wa-modal__close:hover {
    background: var(--border);
    color: var(--text);
    border-color: var(--border-strong);
}

/* ── رأس كل خطوة ── */
.wa-modal__header {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-top: .2rem;
}

.wa-modal__icon-wrap {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto .9rem;
    color: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.wa-modal__icon-wrap--wa       { background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); }
.wa-modal__icon-wrap--customer { background: linear-gradient(135deg, #2a8fd1 0%, #1a5f8e 100%); }
.wa-modal__icon-wrap--company  { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.wa-modal__icon-wrap--success  { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }

.wa-modal__title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 .35rem;
    letter-spacing: -.015em;
}
.wa-modal__subtitle {
    font-size: .875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

/* ── أزرار الاختيار ── */
.wa-modal__choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}
.wa-modal__choices--two {
    grid-template-columns: repeat(2, 1fr);
    max-width: 272px;
    margin: 0 auto;
}

.wa-modal__choice-btn {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 1.1rem;
    padding: 1.25rem .65rem 1.05rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    color: var(--text);
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: border-color .18s, background .18s, transform .14s, box-shadow .18s;
}
.wa-modal__choice-btn:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, .07);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(37, 211, 102, .2);
}
.wa-modal__choice-btn:focus-visible {
    outline: 2px solid #25D366;
    outline-offset: 3px;
}
.wa-modal__choice-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.wa-modal__choice-icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
    transition: transform .14s;
}
.wa-modal__choice-btn:hover .wa-modal__choice-icon {
    transform: scale(1.08);
}
.wa-modal__choice-icon--customer { background: linear-gradient(135deg, #2a8fd1 0%, #1a5f8e 100%); }
.wa-modal__choice-icon--company  { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.wa-modal__choice-label { font-size: .84rem; font-weight: 600; }

/* ── فاصل خفيف قبل النموذج ── */
.wa-modal__step > .wa-modal__form {
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    margin-top: .2rem;
}

/* ── النماذج ── */
.wa-modal__form {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.wa-modal__form .field-label {
    font-size: .83rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .3rem;
    display: flex;
    align-items: center;
    gap: .2rem;
}
.wa-modal__form .req {
    color: #ef4444;
    font-size: .8em;
}
.wa-modal__form .field-input {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: .6rem;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.wa-modal__form .field-input::placeholder {
    color: var(--text-muted);
    opacity: .7;
}
.wa-modal__form .field-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .18);
    background: var(--bg-elevated);
    outline: none;
}

/* ── صف الأزرار ── */
.wa-modal__form-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .2rem;
}
.wa-modal__back-btn {
    flex: 0 0 auto;
    width: auto !important;
    padding: .58rem .95rem !important;
    font-size: .83rem !important;
    font-weight: 600;
    gap: .3rem;
}
.wa-modal__submit-btn {
    flex: 1;
    width: auto !important;
    background: #25D366 !important;
    border-color: #25D366 !important;
    color: #fff !important;
    gap: .4rem;
    box-shadow: 0 3px 14px rgba(37, 211, 102, .35) !important;
    transition: background .18s, border-color .18s, box-shadow .18s, transform .1s !important;
}
.wa-modal__submit-btn:hover {
    background: #128C7E !important;
    border-color: #128C7E !important;
    box-shadow: 0 4px 18px rgba(18, 140, 126, .4) !important;
}
.wa-modal__submit-btn:active {
    transform: translateY(1px) !important;
    box-shadow: none !important;
}
.wa-modal__submit-btn.is-loading {
    opacity: .6;
    pointer-events: none;
}

/* ── نجاح ── */
.wa-modal__header--success .wa-modal__subtitle {
    color: #16a34a;
    font-weight: 500;
}

/* ── اهتزاز خطأ ── */
@keyframes waShake {
    0%, 100% { transform: translateX(0); }
    20%,  60% { transform: translateX(-6px); }
    40%,  80% { transform: translateX(6px); }
}
.wa-shake { animation: waShake .4s ease; }

/* ── Dark mode ── */
[data-theme="dark"] .wa-modal__box {
    background: var(--bg-elevated);
    border-color: var(--border);
    box-shadow: 0 20px 64px rgba(0, 0, 0, .55);
}
[data-theme="dark"] .wa-modal__choice-btn {
    background: var(--surface-2);
    border-color: var(--border);
}
[data-theme="dark"] .wa-modal__choice-btn:hover {
    background: rgba(37, 211, 102, .1);
    border-color: #25D366;
    box-shadow: 0 8px 22px rgba(37, 211, 102, .12);
}
[data-theme="dark"] .wa-modal__form .field-input {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .wa-modal__form .field-input:focus {
    background: #1a2836;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .12);
}
[data-theme="dark"] .wa-modal__submit-btn {
    box-shadow: 0 3px 14px rgba(37, 211, 102, .2) !important;
}
[data-theme="dark"] .wa-modal__header--success .wa-modal__subtitle {
    color: #4ade80;
}

/* ── شاشات صغيرة ── */
@media (max-width: 400px) {
    .wa-modal__box { padding: 1.6rem 1.2rem 1.4rem; border-radius: 1.25rem; }
    .wa-modal__choices--two { max-width: 240px; gap: .6rem; }
    .wa-modal__choice-btn { padding: 1rem .45rem .85rem; border-radius: .9rem; }
    .wa-modal__choice-icon { width: 2.4rem; height: 2.4rem; font-size: .95rem; }
    .wa-modal__choice-label { font-size: .8rem; }
    .wa-modal__back-btn { padding: .5rem .75rem !important; font-size: .8rem !important; }
}

/* ═══════════════════════════════════════════════════════
   مفتاح تفعيل نافذة واتساب (.wa-toggle-*)
═══════════════════════════════════════════════════════ */
.wa-toggle-section {
    padding: 1.1rem 1.4rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    margin-bottom: 1.5rem;
    background: var(--surface-2);
}
.wa-toggle-section .manage-h2 {
    margin: 0 0 .3rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--text);
}
.wa-toggle-form {
    margin-top: .65rem;
}
.wa-toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    user-select: none;
}
.wa-toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.wa-toggle-track {
    position: relative;
    display: inline-block;
    width: 2.6rem;
    height: 1.45rem;
    background: var(--border);
    border-radius: 999px;
    transition: background .22s;
    flex-shrink: 0;
}
.wa-toggle-switch input:checked + .wa-toggle-track {
    background: #25D366;
}
.wa-toggle-thumb {
    position: absolute;
    top: .175rem;
    inset-inline-start: .175rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
    transition: transform .22s cubic-bezier(.34,1.3,.64,1);
}
.wa-toggle-switch input:checked + .wa-toggle-track .wa-toggle-thumb {
    transform: translateX(-1.1rem); /* RTL: move towards inline-end */
}
[dir="ltr"] .wa-toggle-switch input:checked + .wa-toggle-track .wa-toggle-thumb {
    transform: translateX(1.1rem);
}
.wa-toggle-label {
    font-size: .92rem;
    color: var(--text);
}
[data-theme="dark"] .wa-toggle-track {
    background: rgba(255,255,255,.15);
}
[data-theme="dark"] .wa-toggle-switch input:checked + .wa-toggle-track {
    background: #25D366;
}

/* ═══════════════════════════════════════════════════════
   صفحة طلبات التواصل (whatsapp_leads.php) — Light & Dark
═══════════════════════════════════════════════════════ */

/* ── بطاقات الإحصائيات ── */
.wl-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.wl-stat-card {
    flex: 1 1 9rem;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    position: relative;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
}
.wl-stat-card::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 3px;
    background: var(--border);
    border-radius: 1rem 1rem 0 0;
}
.wl-stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.wl-stat-card--today::before    { background: #25D366; }
.wl-stat-card--customer::before { background: #3b82f6; }
.wl-stat-card--company::before  { background: #f59e0b; }
.wl-stat-card--today    { border-color: rgba(37, 211, 102, .3); }
.wl-stat-card--customer { border-color: rgba(59, 130, 246, .3); }
.wl-stat-card--company  { border-color: rgba(245, 158, 11, .3); }

.wl-stat-card__icon {
    font-size: 1.3rem;
    margin-bottom: .1rem;
    line-height: 1;
}
.wl-stat-card__val {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -.02em;
}
.wl-stat-card__lbl {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── شريط الفلاتر ── */
.wl-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.25rem;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: .875rem;
    padding: .75rem 1rem;
}
.wl-filter-select  { width: 9rem; }
.wl-filter-search  { flex: 1 1 14rem; min-width: 0; }
.wl-filter-date    { width: 9.5rem; }
.wl-filters-bar .field-input {
    background: var(--bg-elevated);
    border-color: var(--border);
}
.wl-filters-bar .field-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .15);
}

/* ── الجدول ── */
.wl-table-wrap {
    overflow-x: auto;
    border-radius: .875rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    background: var(--bg-elevated);
}
.wl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.wl-table th {
    padding: .7rem 1rem;
    text-align: start;
    border-bottom: 1.5px solid var(--border);
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-muted);
    font-size: .78rem;
    white-space: nowrap;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.wl-table td {
    padding: .75rem 1rem;
    text-align: start;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.wl-table tbody tr:last-child td { border-bottom: none; }
.wl-table tbody tr { transition: background .12s; }
.wl-table tbody tr:hover td { background: var(--surface-2); }

.wl-td-id   { color: var(--text-muted); width: 3.5rem; font-size: .8rem; font-variant-numeric: tabular-nums; }
.wl-td-name { font-weight: 600; }
.wl-td-phone { font-variant-numeric: tabular-nums; }
.wl-td-date { white-space: nowrap; color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.wl-phone-link {
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.wl-phone-link:hover { text-decoration: underline; }
.wl-prop-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    font-size: .85rem;
    padding: .15rem .5rem;
    border-radius: .4rem;
    background: var(--secondary-soft);
    transition: background .15s;
}
.wl-prop-link:hover { background: color-mix(in srgb, var(--secondary) 20%, transparent); }
.wl-empty { color: var(--text-muted); opacity: .5; }

/* ── شارات الأنواع ── */
.wl-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .01em;
}
.wl-badge--customer { background: rgba(59, 130, 246, .15);  color: #1d4ed8; }
.wl-badge--company  { background: rgba(245, 158, 11, .15); color: #b45309; }

[data-theme="dark"] .wl-badge--customer { background: rgba(59, 130, 246, .2);  color: #93c5fd; }
[data-theme="dark"] .wl-badge--company  { background: rgba(245, 158, 11, .2); color: #fcd34d; }

/* ── صفحية ── */
.wl-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    padding: .5rem 0 .25rem;
}

/* ── شارة واتساب في الناف بار ── */
.nav-item-badge--wa { background: #25D366; }

/* زر واتساب في الـ topbar */
.topbar-wa-btn {
    position: relative;
    color: #25D366;
    text-decoration: none;
}
.topbar-wa-btn:hover {
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.5);
    background: rgba(37, 211, 102, 0.12);
}
[data-theme="light"] .topbar-wa-btn {
    color: #1a9e52;
}

/* دائرة عدد طلبات الإضافة المعلّقة */
.req-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 50px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    margin-right: 0.35rem;
    box-shadow: 0 1px 4px rgba(229, 62, 62, 0.45);
    box-sizing: border-box;
}

/* شارة الطلبات الجديدة فوق زر واتساب */
.nav-wa-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #25D366;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px var(--bg);
}

/* عمود حذف في جدول الطلبات */
.wl-td-del {
    width: 48px;
    text-align: center;
}
.wl-del-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

/* ══════════════════════════════════════════════════════════
   صفحة إعدادات العقار — psettings
   ══════════════════════════════════════════════════════════ */

/* ── شريط التنقل ── */
.psettings-nav {
    margin: 1.25rem 0 0;
    border-bottom: 2px solid var(--border-strong);
}

/* قائمة منسدلة (تظهر على الشاشات الصغيرة) */
.psettings-nav__dropdown-wrap {
    position: relative;
    display: none;
    margin-bottom: .75rem;
}
.psettings-nav__select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: .55rem 2.5rem .55rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: .95rem;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.psettings-nav__select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(var(--gold-rgb, 180,140,60), .25);
}
.psettings-nav__select-icon {
    position: absolute;
    inset-inline-end: .85rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: .75rem;
    color: var(--text-muted);
}

/* تبويبات (تظهر على الشاشات الكبيرة) */
.psettings-nav__tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.psettings-nav__tabs::-webkit-scrollbar { display: none; }

.psettings-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem 1.15rem;
    font-size: .9rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    flex-shrink: 0;
}
.psettings-tab:hover {
    color: var(--gold-bright);
    background: var(--surface-2);
}
.psettings-tab.is-active {
    color: var(--gold-bright);
    border-bottom-color: var(--gold);
    font-weight: 600;
}
.psettings-tab i {
    font-size: .85rem;
}

/* الكرت الخارجي */
.psettings-wrap {
    padding-bottom: 2rem;
}

/* ——— اختيار نوع الحساب (زبون / شركة) ——— */
.acct-type-selector {
    margin-bottom: 1.5rem;
    text-align: center;
}

.acct-type-selector__label {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.acct-type-selector__row {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.acct-type-btn {
    flex: 1;
    max-width: 9rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.acct-type-btn i {
    font-size: 1.75rem;
}

.acct-type-btn:hover {
    border-color: var(--teal);
    color: var(--text);
}

.acct-type-btn--active {
    border-color: var(--accent);
    background: var(--secondary-soft);
    color: var(--accent);
}

[data-theme="dark"] .acct-type-btn--active {
    background: rgba(249, 168, 0, 0.12);
    border-color: var(--gold);
    color: var(--gold-bright);
}

/* ── استجابة الشاشات الصغيرة ── */
@media (max-width: 700px) {
    .psettings-nav__dropdown-wrap { display: block; }
    .psettings-nav__tabs          { display: none; }
    .psettings-nav                { border-bottom: none; }
}

/* ══ طلبات الإضافة — قائمة الإدارة ══ */
.prm-inbox-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
    color: #7f1d1d;
}
[data-theme="dark"] .prm-inbox-banner {
    border-color: rgba(248, 113, 113, 0.35);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.25) 0%, rgba(124, 45, 18, 0.2) 100%);
    color: #fecaca;
}
.prm-inbox-banner__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #e53e3e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.prm-inbox-banner__title { font-weight: 700; margin: 0 0 0.2rem; font-size: 0.95rem; }
.prm-inbox-banner__text { margin: 0; font-size: 0.85rem; line-height: 1.55; opacity: 0.9; }

.prm-list { display: flex; flex-direction: column; gap: 0.75rem; }
.prm-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--surface, #fff);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.prm-card--unread {
    border-color: #fca5a5;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
}
[data-theme="dark"] .prm-card {
    background: var(--surface-dark, #1e293b);
    border-color: var(--border-dark, #334155);
}
.prm-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem 1rem 0.5rem;
}
.prm-card__name { font-weight: 700; font-size: 1rem; margin: 0 0 0.15rem; }
.prm-card__meta { font-size: 0.78rem; color: var(--text-muted, #718096); margin: 0; }
.prm-card__region {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    padding: 0 1rem 0.5rem;
}
.prm-card__msg {
    margin: 0 1rem 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.55rem;
    background: var(--surface-alt, #f8fafc);
    border-right: 3px solid var(--accent, #3b82f6);
    font-size: 0.86rem;
    line-height: 1.55;
}
.prm-card--unread .prm-card__msg {
    background: #fffbeb;
    border-right-color: #e53e3e;
}
[data-theme="dark"] .prm-card__msg { background: rgba(255, 255, 255, 0.04); }
.prm-card__msg-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.35rem;
}
.prm-card--unread .prm-card__msg-label { color: #b45309; }
.prm-card__msg-text {
    margin: 0;
    color: var(--text-primary, #1a202c);
    word-break: break-word;
}
.prm-card__msg-time { font-size: 0.72rem; color: var(--text-muted, #94a3b8); margin-top: 0.35rem; }
.prm-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem 1rem 0.85rem;
    border-top: 1px solid var(--border, #e2e8f0);
    background: var(--surface-alt, #f8fafc);
}
[data-theme="dark"] .prm-card__actions {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-dark, #334155);
}
.prm-card__actions .btn-primary-chat {
    background: var(--accent, #3b82f6);
    color: #fff;
    border: none;
}
.prm-card__actions .btn-primary-chat:hover { filter: brightness(1.05); }
.prm-unread-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53e3e;
    flex-shrink: 0;
    margin-top: 0.35rem;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.25);
}

/* ══ دردشة الطلبات ══ */
.pr-chat-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--surface, #fff);
    overflow: hidden;
}
[data-theme="dark"] .pr-chat-panel {
    background: var(--surface-dark, #1e293b);
    border-color: var(--border-dark, #334155);
}
.pr-chat-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--surface-alt, #f8fafc);
}
[data-theme="dark"] .pr-chat-panel__head {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-dark, #334155);
}
.pr-chat-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.pr-chat-log {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: min(52vh, 480px);
    overflow-y: auto;
    padding: 1rem;
    background: var(--surface-alt, #f1f5f9);
}
[data-theme="dark"] .pr-chat-log {
    background: #0f172a;
}
.pr-chat-compose {
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
}
[data-theme="dark"] .pr-chat-compose {
    background: var(--surface-dark, #1e293b);
    border-color: var(--border-dark, #334155);
}
.pr-chat-compose__row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.pr-chat-compose textarea {
    flex: 1;
    min-width: 200px;
    min-height: 72px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.55rem;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    background: var(--input-bg, #f8fafc);
    color: var(--text-primary, #1a202c);
}
.pr-chat-msg {
    max-width: 88%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.pr-chat-msg--visitor { align-self: flex-start; }
.pr-chat-msg--admin { align-self: flex-end; }
.pr-chat-msg__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}
.pr-chat-msg__avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.pr-chat-msg--visitor .pr-chat-msg__avatar {
    background: #e2e8f0;
    color: #475569;
}
.pr-chat-msg--admin .pr-chat-msg__avatar {
    background: var(--accent, #3b82f6);
    color: #fff;
}
.pr-chat-msg__who { font-weight: 700; color: var(--text-primary, #334155); }
.pr-chat-msg__time { margin-inline-start: auto; }
.pr-chat-msg__new-pill {
    background: #e53e3e;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 1rem;
    line-height: 1.2;
}
.pr-chat-msg__body {
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}
.pr-chat-msg--visitor .pr-chat-msg__body {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-primary, #1a202c);
    border-bottom-right-radius: 0.2rem;
}
.pr-chat-msg--admin .pr-chat-msg__body {
    background: var(--accent, #3b82f6);
    color: #fff;
    border-bottom-left-radius: 0.2rem;
}
.pr-chat-msg--unread.pr-chat-msg--visitor .pr-chat-msg__body {
    border-color: #fca5a5;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.pr-chat-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.88rem;
}
[data-theme="dark"] .pr-chat-alert {
    background: rgba(146, 64, 14, 0.2);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fcd34d;
}
@media (max-width: 520px) {
    .pr-chat-msg { max-width: 94%; }
    .pr-chat-compose { position: sticky; bottom: 0; z-index: 5; }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ——— محرر الكاروسيل ——— */
@font-face {
    font-family: "(A) Arslan Wessam B";
    src:
        url("../fonts/ArslanWessamB.ttf") format("truetype"),
        url("../fonts/AArslanWessamB-AArslanWessamB.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.main-wrap--carousel-editor {
    --carousel-font: "(A) Arslan Wessam B", var(--font);
    max-width: 56rem;
    align-items: center;
    margin-inline: auto;
    width: 100%;
}

.carousel-editor {
    padding: 1rem 1.15rem 1.5rem;
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-editor__topbar,
.carousel-editor__stage {
    width: 100%;
    align-self: stretch;
}

.carousel-editor__topbar {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.carousel-editor__settings-btn,
.carousel-editor__back {
    margin-top: 0.15rem;
}

.carousel-editor__actions-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-block: 0.25rem 0.5rem;
}

.carousel-editor__toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 22rem;
}

.carousel-editor__toolbar .btn {
    width: 100%;
    box-sizing: border-box;
}

.carousel-editor__toolbar .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-editor__counter {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    padding: 0.15rem 0.5rem;
    font-variant-numeric: tabular-nums;
    min-width: 5.5rem;
}

.carousel-editor__slide-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.carousel-editor__slide-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-editor__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.carousel-editor__nav {
    border-radius: 50%;
}

.carousel-editor__nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-editor__preview-wrap {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 22rem;
    margin-inline: auto;
}

.carousel-editor__preview {
    width: 100%;
    max-height: min(72vh, 36rem);
    margin-inline: auto;
}

.carousel-editor__size-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
}

.carousel-slide-canvas {
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: #e8eaef;
    box-shadow: var(--shadow);
    direction: rtl;
    font-family: var(--carousel-font);
}

.carousel-slide-canvas__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.carousel-slide-canvas__bg.has-image {
    opacity: 1;
}

.carousel-slide-canvas__bg.has-image + .carousel-slide-canvas__inner {
    background: transparent;
}

.carousel-slide-canvas__overlay-layer {
    display: none;
}

.carousel-overlay-editor {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.carousel-overlay-editor:not([hidden]) {
    display: block;
}

.carousel-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.carousel-overlay-layer .carousel-overlay-box {
    pointer-events: auto;
}

.carousel-overlay-box {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    touch-action: none;
    box-sizing: content-box;
    border: none;
    border-radius: 0.25rem;
    overflow: visible;
    transition: outline-color 0.15s ease;
}

.carousel-overlay-layer.is-export-measure .carousel-overlay-toolbar,
.carousel-overlay-layer.is-export-measure .carousel-overlay-handle,
.carousel-overlay-layer.is-export-measure .carousel-overlay-box {
    outline: none !important;
}

.carousel-overlay-box__media {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    display: block;
    line-height: 0;
    font-size: 0;
}

.carousel-overlay-box.is-circle {
    border-radius: 50%;
}

.carousel-overlay-box.is-circle .carousel-overlay-box__media {
    border-radius: 50%;
}

.carousel-overlay-box.is-circle .carousel-slide-canvas__overlay {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.carousel-overlay-box.is-active {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
}

.carousel-overlay-box.is-active .carousel-overlay-handle,
.carousel-overlay-box.is-active .carousel-overlay-toolbar {
    opacity: 1;
    visibility: visible;
}

.carousel-slide-canvas__overlay {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.carousel-overlay-handle {
    position: absolute;
    right: -0.55rem;
    bottom: -0.55rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    cursor: nwse-resize;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    z-index: 4;
    pointer-events: auto;
}

.carousel-overlay-toolbar {
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: auto;
    z-index: 2;
}

.carousel-overlay-corner {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: 0.35rem;
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.carousel-overlay-corner:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.carousel-slide-canvas__overlay {
    max-width: none;
    max-height: none;
}

.carousel-slide-canvas__inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 6% 7%;
    color: #111827;
    align-items: stretch;
}

.carousel-slide-canvas__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: clamp(0.55rem, 2.2vw, 0.72rem);
    color: #6b7280;
    margin-bottom: 4%;
}

.carousel-slide-canvas__brand {
    font-weight: 700;
    color: #374151;
}

.carousel-slide-canvas__badge {
    align-self: flex-end;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--carousel-font);
    font-size: clamp(0.58rem, 2.4vw, 0.78rem);
    font-weight: normal;
    padding: 0.35em 1em;
    border-radius: 999px;
    margin-bottom: 3%;
    max-width: 100%;
    box-sizing: border-box;
}

.carousel-slide-canvas__title {
    margin: 0 0 2%;
    font-family: var(--carousel-font);
    font-size: clamp(0.95rem, 4.2vw, 1.35rem);
    font-weight: normal;
    line-height: 1.25;
    text-align: right;
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.9);
}

.carousel-slide-canvas__subtitle {
    margin: 0 0 4%;
    font-size: clamp(0.62rem, 2.6vw, 0.82rem);
    color: #4b5563;
    text-align: right;
}

.carousel-slide-canvas__details-box {
    flex: 0 1 auto;
    display: flex;
    align-items: flex-start;
    margin: 0.5% 0;
    width: 100%;
    border-radius: 0.5rem;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    background: transparent;
}

.carousel-slide-canvas__details-bg {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

.carousel-slide-canvas__details {
    margin: 0;
    width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 0.35em 0.6em 0.4em;
    font-family: var(--carousel-font);
    font-size: clamp(0.62rem, 2.5vw, 0.82rem);
    font-weight: normal;
    line-height: 1.28;
    text-align: right;
    color: #1f2937;
    min-height: 0;
    opacity: 1;
    position: relative;
    z-index: 1;
    white-space: pre-line;
}

.carousel-slide-canvas__footer {
    margin-top: auto;
    padding-top: 4%;
    font-family: var(--carousel-font);
    font-size: clamp(0.62rem, 2.5vw, 0.82rem);
    font-weight: normal;
    color: #6b7280;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35em;
    width: 100%;
}

.carousel-slide-canvas__footer #carouselPreviewFooter {
    display: block;
    width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.35;
    word-break: normal;
}

.carousel-slide-canvas__footer-line {
    display: block;
    width: 100%;
    height: 2px;
    border: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.carousel-editor__form {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
    box-sizing: border-box;
}

.carousel-form-bg-tool {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.carousel-form-bg-tool__pick {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(249, 168, 0, 0.45);
    background: rgba(236, 234, 231, 0.1);
    color: var(--gold);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.carousel-form-bg-tool__pick:hover {
    border-color: var(--gold-bright);
    background: rgba(249, 168, 0, 0.15);
    color: var(--gold-bright);
}

.carousel-form-bg-tool__pick:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.carousel-form-bg-tool__thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.carousel-form-bg-tool__thumb.has-image {
    opacity: 1;
}

.carousel-form-bg-tool__icon {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.carousel-form-bg-tool__pick.has-bg .carousel-form-bg-tool__icon {
    opacity: 0.85;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.carousel-form-bg-tool__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.carousel-form-bg-tool__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.carousel-form-bg-tool__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.carousel-form-bg-tool__reset {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
}

.carousel-form-bg-tool__pick.is-custom {
    border-color: var(--accent);
}

.carousel-editor__form .btn {
    width: 100%;
    box-sizing: border-box;
}

.carousel-editor__form .field label,
.carousel-editor__form .field .field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.carousel-editor__form input[type="text"],
.carousel-editor__form textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: var(--carousel-font);
    font-size: 1.05rem;
    line-height: 1.45;
    direction: rtl;
}

.carousel-editor__form input[type="color"],
.carousel-editor__form select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}

.carousel-editor__form input[type="range"] {
    width: 100%;
    margin-top: 0.25rem;
}

.carousel-overlay-style {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 0.75rem 0.75rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--bg-elevated);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.carousel-overlay-style__legend {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 0 0.45rem;
    margin: 0 0 0.1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.carousel-overlay-style__shape-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.carousel-overlay-style__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.72rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.carousel-overlay-style__toggle:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    color: var(--text);
}

.carousel-overlay-style__toggle:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
    color: var(--text);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.carousel-overlay-style__toggle:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.carousel-overlay-style__toggle input {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.carousel-overlay-style__border-panel {
    padding: 0.55rem 0.6rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.carousel-overlay-style__border-panel[hidden] {
    display: none;
}

.carousel-overlay-style__border-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.45rem 0.55rem;
}

.carousel-overlay-style__border-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.carousel-overlay-style__border-group--width {
    flex: 1 1 5.5rem;
    min-width: 5rem;
    max-width: 8rem;
}

.carousel-overlay-style__border-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
    letter-spacing: 0.02em;
}

.carousel-overlay-style__border-divider {
    align-self: stretch;
    width: 1px;
    min-height: 2rem;
    margin: 0.15rem 0;
    background: var(--border);
    flex-shrink: 0;
}

.carousel-overlay-style__color-swatch-btn {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.carousel-overlay-style__color-swatch {
    display: block;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 5px;
    border: 1px solid var(--border-strong);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    pointer-events: none;
}

.carousel-overlay-style__color-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}

.carousel-overlay-style__color-swatch-btn:hover .carousel-overlay-style__color-swatch,
.carousel-overlay-style__color-swatch-btn:focus-within .carousel-overlay-style__color-swatch {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.carousel-overlay-style__width-control {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

.carousel-overlay-style__width-range {
    flex: 1 1 auto;
    width: 100%;
    min-width: 3.5rem;
    height: 0.28rem;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.carousel-overlay-style__width-range::-webkit-slider-thumb {
    width: 0.75rem;
    height: 0.75rem;
}

.carousel-overlay-style__width-range::-moz-range-thumb {
    width: 0.75rem;
    height: 0.75rem;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.carousel-overlay-style__width-val {
    display: inline-block;
    min-width: 1.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
    flex-shrink: 0;
}

.carousel-overlay-style__border-type {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0;
}

.carousel-overlay-style__border-type-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 1.85rem;
    padding: 0.24rem 0.28rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 3px);
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.carousel-overlay-style__border-type-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.carousel-overlay-style__border-type-btn:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
    color: var(--text);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.carousel-overlay-style__border-type-btn:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.carousel-overlay-style__border-type-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.carousel-overlay-style__border-type-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 0.95rem;
    color: var(--text);
}

.carousel-overlay-style__border-type-preview svg {
    display: block;
    width: 100%;
    height: auto;
}

.carousel-overlay-style__border-type-btn:has(input:checked) .carousel-overlay-style__border-type-preview {
    color: var(--accent);
}

.carousel-overlay-style__actions {
    display: flex;
    justify-content: center;
    margin-top: 0.15rem;
}

.carousel-overlay-style__delete {
    color: #b91c1c;
    border-color: color-mix(in srgb, #dc2626 35%, rgba(249, 168, 0, 0.45));
    background: color-mix(in srgb, #dc2626 6%, rgba(236, 234, 231, 0.1));
}

.carousel-overlay-style__delete:hover {
    border-color: #dc2626;
    background: color-mix(in srgb, #dc2626 12%, rgba(249, 168, 0, 0.15));
    color: #991b1b;
}

.carousel-overlay-style__delete:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .carousel-overlay-style__border-divider {
        display: none;
    }

    .carousel-overlay-style__border-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .carousel-overlay-style__border-group--width {
        max-width: none;
        grid-column: 1 / -1;
    }
}

.carousel-editor__status {
    text-align: center;
    margin: 0.85rem 0 0;
    font-size: 0.88rem;
    color: var(--accent);
    min-height: 1.25em;
    width: 100%;
    max-width: 22rem;
}

.carousel-editor__status.is-error {
    color: var(--danger);
}

.carousel-settings-dialog {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    max-width: 32rem;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 2rem);
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.carousel-settings-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.carousel-settings-dialog__inner {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    box-sizing: border-box;
    overflow: hidden;
}

.carousel-settings-dialog__body {
    overflow-y: auto;
    flex: 1 1 auto;
    padding-inline-end: 0.15rem;
    margin-bottom: 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-muted) 45%, transparent) transparent;
}

.carousel-settings-dialog__body::-webkit-scrollbar {
    width: 8px;
}

.carousel-settings-dialog__body::-webkit-scrollbar-track {
    background: transparent;
}

.carousel-settings-dialog__body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 45%, transparent);
    border-radius: 999px;
}

.carousel-settings-dialog__body::-webkit-scrollbar-button,
.carousel-settings-dialog__body::-webkit-scrollbar-button:single-button,
.carousel-settings-dialog__body::-webkit-scrollbar-button:double-button,
.carousel-settings-dialog__body::-webkit-scrollbar-button:vertical:decrement,
.carousel-settings-dialog__body::-webkit-scrollbar-button:vertical:increment,
.carousel-settings-dialog__body::-webkit-scrollbar-button:horizontal:decrement,
.carousel-settings-dialog__body::-webkit-scrollbar-button:horizontal:increment {
    display: none;
    width: 0;
    height: 0;
}

.carousel-settings-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: var(--surface-2);
    overflow: hidden;
}

.carousel-settings-section__title {
    margin: 0;
    padding: 0.75rem 0.85rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    user-select: none;
}

.carousel-settings-section__title::-webkit-details-marker {
    display: none;
}

.carousel-settings-section__title::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.carousel-settings-section[open] > .carousel-settings-section__title::after {
    transform: rotate(180deg);
}

.carousel-settings-section__title:hover {
    background: var(--bg-elevated);
}

.carousel-settings-section__body {
    padding: 0.75rem 0.85rem 0.85rem;
    border-top: 1px solid var(--border);
}

.carousel-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.75rem;
}

.carousel-settings-grid__full {
    grid-column: 1 / -1;
}

.carousel-settings-dialog select.carousel-font-select {
    font-size: 1.05rem;
    direction: rtl;
}

.carousel-settings-dialog select.carousel-font-select option {
    font-size: 1rem;
    padding: 0.25rem 0;
}

.carousel-settings-dialog .field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.carousel-settings-dialog input[type="text"],
.carousel-settings-dialog input[type="number"],
.carousel-settings-dialog select,
.carousel-settings-dialog textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}

.carousel-settings-dialog input[type="text"],
.carousel-settings-dialog textarea {
    font-family: var(--carousel-font);
    direction: rtl;
}

.carousel-settings-footer-text {
    min-height: 4.5rem;
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.carousel-settings-dialog input[type="color"] {
    width: 100%;
    height: 2.25rem;
    padding: 0.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    cursor: pointer;
    box-sizing: border-box;
}

.carousel-settings-dialog input[type="range"] {
    width: calc(100% - 3rem);
    vertical-align: middle;
}

.carousel-settings-range-val {
    display: inline-block;
    min-width: 2.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: end;
}

.carousel-settings-dialog .field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.carousel-settings-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.carousel-settings-dialog__head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.carousel-settings-dialog__close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
}

.carousel-settings-dialog__actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.5rem 0 0.85rem;
}

.carousel-settings-dialog__actions .btn,
.carousel-settings-dialog__inner > .btn {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .carousel-editor__preview-wrap {
        max-width: 100%;
    }

    .carousel-editor__toolbar {
        width: 100%;
    }
}

