@import url('../fonts/vazir.css');

/* ============================================================
   سیستم طراحی — متغیرها (روشن / تاریک)
   ============================================================ */
:root {
    --brand: #0C1D34;
    /* رنگ کنش واحد: آبیِ متین (جایگزین طلایی و سبزِ قبلی). نام متغیرها برای سازگاری حفظ شده. */
    --gold: #2563eb;
    --gold-dark: #1d4ed8;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eaf2ff;   /* پس‌زمینه‌ی ملایمِ آبی روی سطحِ روشن (هاور، چیپ، برچسب) */
    --on-brand: #eaf0fb;   /* متنِ روشن روی سرمه‌ای (هدر/هیرو) */
    --danger: #dc2626;
    /* رنگِ معناییِ «در انتظار/رزرو/هشدار» (کهربایی) — جدا از رنگ برند */
    --warn: #d97706;
    --warn-text: #b45309;
    --warn-bg: rgba(217,119,6,.14);

    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f3f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e4e8ef;
    --shadow: 0 2px 14px rgba(20, 35, 60, .07);

    /* پوسته (هدر + سایدبار) — سطوحِ تیره‌ی قالب.
       هدر با نخستین توقفِ گرادیانِ سایدبار یکی است تا گوشه‌ی قابِ L بدونِ درز به‌هم برسد. */
    --header-bg: #172033;
    --sidebar-bg: linear-gradient(180deg, #172033 0%, #0f172a 58%, #111827 100%);
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #94a3b8;   /* آیکون و برچسبِ گروه — پوسته همیشه تیره است و از --muted استفاده نمی‌کند */

    --radius: 12px;
    --header-h: 64px;
}

[data-theme="dark"] {
    --bg: #0d1521;
    --surface: #16212f;
    --surface-2: #1b2837;
    --text: #e7ecf3;
    --muted: #8893a4;
    --border: #26344a;
    --accent-soft: rgba(37, 99, 235, .16);
    --warn-text: #fbbf24;
    --warn-bg: rgba(217,119,6,.20);
    --shadow: 0 2px 16px rgba(0, 0, 0, .35);
    /* پوسته در تمِ تیره یک پله عمیق‌تر می‌شود تا از بومِ تیره جدا بماند. */
    --header-bg: #111827;
    --sidebar-bg: linear-gradient(180deg, #111827 0%, #0b1220 100%);
    --sidebar-text: #aab6c9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }   /* صفحه هرگز اسکرول نمی‌شود؛ فقط .main / .auth-panel اسکرول دارند */
html { overscroll-behavior: none; }
body {
    font-family: 'Vazir', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow: hidden;
    transition: background .25s, color .25s;
}

.screen { display: none; }
.screen.active { display: block; }

/* آیکون‌های SVG (خط‌محور، هم‌رنگ متن) — جایگزین ایموجی‌ها */
.ic {
    width: 1.2em; height: 1.2em; display: inline-block; vertical-align: -.22em;
    stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
.ic.fill { fill: currentColor; stroke: none; }

/* ============================================================
   بازخورد فرم‌ها: حالت بارگذاری دکمه + خطای کنار فیلد
   ============================================================ */
button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
button.is-loading > * { visibility: hidden; }
button.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 17px; height: 17px; margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
    animation: btn-spin .6s linear infinite;
}
/* دکمه‌های روشن/بی‌رنگ: کلاس spin-dark اسپینر تیره می‌دهد */
button.is-loading.spin-dark::after { border-color: rgba(30,41,59,.25); border-top-color: var(--accent); }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.is-loading::after { animation-duration: 1.4s; } }

/* خطای اعتبارسنجی زیر فیلد */
.field-err-msg { display: block; color: var(--danger); font-size: 11.5px; font-weight: 600; margin-top: 5px; }
.is-invalid,
input.is-invalid, select.is-invalid, textarea.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}

/* ============================================================
   ورود / ثبت‌نام — چیدمانِ دو‌ستونه‌ی مدرن
   ============================================================ */
.auth-shell {
    height: 100vh; height: 100dvh;
    display: flex;
    background: var(--bg);
    overflow: hidden;
}

/* ---------- پنل نمایشِ برند (سمت راست) ---------- */
.auth-showcase {
    position: relative;
    flex: 1 1 46%;
    max-width: 640px;
    padding: 52px 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #eaf1ff;
    background:
        radial-gradient(1100px 620px at 88% -12%, rgba(47,107,255,.45), transparent 55%),
        radial-gradient(820px 640px at -8% 112%, rgba(56,189,248,.20), transparent 55%),
        linear-gradient(155deg, #0b1a30 0%, #122c50 55%, #0c1f38 100%);
    overflow: hidden;
    isolation: isolate;
}
/* شبکه‌ی نقطه‌چینِ محو + هاله‌ی نورانی */
.auth-showcase::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1.4px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(130% 120% at 82% 4%, #000 28%, transparent 74%);
    mask-image: radial-gradient(130% 120% at 82% 4%, #000 28%, transparent 74%);
}
.auth-showcase::after {
    content: ""; position: absolute; z-index: -1;
    width: 420px; height: 420px; border-radius: 50%;
    left: -140px; bottom: -160px;
    background: radial-gradient(circle, rgba(56,189,248,.32), transparent 66%);
}

/* برندِ بالای پنل */
.sc-brand { display: flex; align-items: center; gap: 13px; }
.sc-badge {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(140deg, #3b78ff, #1d4ed8); color: #fff;
    box-shadow: 0 12px 30px rgba(37,99,235,.5);
}
.sc-badge .ic { width: 26px; height: 26px; }
.sc-brand-tx b { font-size: 25px; font-weight: 800; letter-spacing: .3px; }
.sc-brand-tx small { display: block; font-size: 11.5px; font-weight: 500; color: rgba(234,241,255,.62); margin-top: 2px; }

/* بخشِ میانی (هیرو) */
.sc-hero { margin: 30px 0; }
.sc-hero h2 { font-size: 30px; line-height: 1.55; font-weight: 800; letter-spacing: -.2px; }
.sc-hero h2 span { color: #85b3ff; }
.sc-hero p { margin-top: 16px; font-size: 15px; line-height: 2; color: rgba(234,241,255,.72); max-width: 42ch; }
.sc-features { list-style: none; margin-top: 30px; display: grid; gap: 14px; }
.sc-feature { display: flex; align-items: center; gap: 13px; font-size: 14.5px; font-weight: 600; color: rgba(234,241,255,.94); }
.sc-feature .fi {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13); color: #9cc0ff;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.sc-feature .fi .ic { width: 20px; height: 20px; }

/* پایینِ پنل: کارتِ شیشه‌ای + پشتیبانی */
.sc-foot { display: grid; gap: 16px; }
.sc-card {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 17px; border-radius: 16px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.13);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 16px 40px rgba(3,10,25,.35);
}
.sc-card-ic {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(140deg, rgba(59,120,255,.9), rgba(29,78,216,.9)); color: #fff;
}
.sc-card-ic .ic { width: 22px; height: 22px; }
.sc-card-tx b { display: block; font-size: 14px; font-weight: 700; }
.sc-card-tx span { font-size: 12.5px; color: rgba(234,241,255,.66); }
.sc-support { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(234,241,255,.6); }
.sc-support .ic { width: 16px; height: 16px; }
.sc-support b { color: rgba(234,241,255,.92); font-weight: 700; letter-spacing: .5px; }

/* ---------- پنل فرم (سمت چپ) ---------- */
.auth-panel {
    flex: 1 1 54%;
    height: 100vh; height: 100dvh;
    overflow-y: auto;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
    background: var(--surface);
}
.auth-card {
    width: 100%; max-width: 400px;
    background: transparent; border: none; box-shadow: none; padding: 0;
    text-align: right;
}
#screen-login form { animation: authIn .42s cubic-bezier(.22,.61,.36,1); }
@keyframes authIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.auth-brand { margin-bottom: 20px; }
.auth-brand .brand-mark {
    width: 54px; height: 54px; border-radius: 16px; display: inline-grid; place-items: center;
    background: linear-gradient(140deg, var(--accent), var(--accent-dark)); color: #fff;
    box-shadow: 0 12px 30px rgba(37,99,235,.32);
}
.auth-brand .brand-mark .ic { width: 28px; height: 28px; }
.auth-card h1 { color: var(--text); font-size: 25px; font-weight: 800; margin: 4px 0 7px; letter-spacing: -.2px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; font-size: 14px; line-height: 1.85; }

.auth-field { margin-bottom: 16px; text-align: right; }
.auth-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.auth-field input {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px;
    font-family: 'Vazir'; font-size: 14.5px; background: var(--surface-2); color: var(--text);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.auth-field textarea {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px;
    font-family: 'Vazir'; font-size: 14.5px; line-height: 1.9; background: var(--surface-2); color: var(--text);
    transition: border-color .18s, box-shadow .18s, background .18s;
    resize: vertical; min-height: 92px;
}
.auth-field input::placeholder, .auth-field textarea::placeholder { color: var(--muted); opacity: .7; }
.auth-field input:focus, .auth-field select:focus, .auth-field textarea:focus {
    outline: none; border-color: var(--accent); background: var(--surface);
    box-shadow: 0 0 0 4px rgba(37,99,235,.14);
}
/* فیلد رمز با دکمه‌ی نمایش/مخفی */
.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 66px; }
.pw-toggle { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--accent); font-family: 'Vazir'; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 5px 9px; border-radius: 8px; transition: background .15s; }
.pw-toggle:hover { background: rgba(37,99,235,.10); }
/* جعبه‌ی کد در حالت توسعه */
.auth-dev-code { background: var(--warn-bg); color: var(--warn-text); border: 1px dashed var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 700; margin-bottom: 14px; text-align: center; letter-spacing: 1px; }
.auth-submit {
    width: 100%; border: none; cursor: pointer; font-family: 'Vazir';
    background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
    padding: 14px; border-radius: 12px; font-size: 15.5px; font-weight: 800; margin-top: 8px;
    box-shadow: 0 12px 26px rgba(37,99,235,.3);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(37,99,235,.42); filter: brightness(1.05); }
.auth-submit:active { transform: translateY(0); }
.auth-switch { margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error { background: rgba(220,38,38,.10); color: var(--danger); border: 1px solid rgba(220,38,38,.32); border-radius: 11px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; display: none; text-align: right; line-height: 1.7; }
.auth-error.show { display: block; }

/* ---------- واکنش‌گرا: پنهان‌سازیِ نمایش در صفحه‌های کوچک ---------- */
@media (max-width: 900px) {
    .auth-showcase { display: none; }
    .auth-panel { flex: 1 1 100%; background: var(--bg); padding: 28px 18px; }
    .auth-card {
        max-width: 430px; background: var(--surface); border: 1px solid var(--border);
        border-radius: 20px; padding: 30px 24px; box-shadow: var(--shadow);
    }
}
@media (prefers-reduced-motion: reduce) {
    #screen-login form { animation: none; }
    .auth-submit:hover { transform: none; }
}

/* ============================================================
   هدر
   ============================================================ */
.impersonate-bar {
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 300;
    background: #c98a00; color: #fff; display: flex; align-items: center; justify-content: center;
    gap: 16px; padding: 11px 16px; font-size: 13.5px; font-weight: 700; box-shadow: 0 -2px 14px rgba(0,0,0,.25);
}
.impersonate-bar button {
    background: #fff; color: #8a5e00; border: none; border-radius: 8px; padding: 7px 16px;
    font-family: 'Vazir'; font-weight: 800; font-size: 13px; cursor: pointer;
}
.impersonate-bar button:hover { opacity: .9; }

.app-header {
    position: fixed; top: 0; right: 0; left: 0; height: var(--header-h); z-index: 100;
    background: var(--header-bg); display: flex; align-items: center; gap: 18px;
    padding: 0 20px; box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.hdr-right { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { display: none; background: transparent; border: none; color: var(--on-brand); font-size: 22px; cursor: pointer; }
.hdr-brand { display: flex; align-items: center; gap: 10px; }
.hdr-brand .brand-mark { font-size: 26px; color: var(--on-brand); display: inline-flex; }
.brand-text strong { color: var(--on-brand); font-size: 16px; display: block; line-height: 1.2; }
.brand-text small { color: #8b97ab; font-size: 11px; }

.hdr-search { flex: 1; max-width: 560px; position: relative; }
.hdr-search input {
    width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(37,99,235,.35);
    color: #fff; border-radius: 10px; padding: 10px 38px 10px 14px; font-family: 'Vazir'; font-size: 13px;
}
.hdr-search input::placeholder { color: #8b97ab; }
.hdr-search input:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,.12); }
.hdr-search .search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); opacity: .7; font-size: 14px; }

.hdr-left { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.hdr-icon { position: relative; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #cdd9ee; width: 40px; height: 40px; border-radius: 10px; font-size: 17px; cursor: pointer; transition: .2s; }
.hdr-icon:hover { background: var(--gold); color: #fff; }
.notif-dot { position: absolute; top: 7px; left: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }

/* پروفایل دراپ‌داون */
.profile-menu { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(37,99,235,.3); border-radius: 10px; padding: 5px 10px 5px 8px; cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--accent)); display: inline-block; flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; }
.avatar.xl { width: 86px; height: 86px; }
.profile-name { color: var(--on-brand); font-weight: 600; font-size: 13px; }
.caret { color: #9fb0c9; font-size: 11px; }
.profile-dropdown {
    position: absolute; top: 52px; left: 0; width: 230px; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: none; z-index: 200;
}
.profile-dropdown.open { display: block; }
.pd-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.pd-name { font-weight: 700; font-size: 14px; }
.pd-role { font-size: 12px; color: var(--muted); }
.pd-item { display: block; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; text-decoration: none; color: var(--text); }
.pd-item:hover { background: var(--surface-2); }
.pd-item.danger { color: var(--danger); }

/* ============================================================
   چیدمان اصلی: سایدبار + محتوا
   ============================================================ */
.app-layout { display: flex; margin-top: var(--header-h); height: calc(100vh - var(--header-h)); }

/* ---------- سایدبار — پوسته‌ی تیره، کنشِ آبی، هندسه‌ی قرصی ---------- */
.sidebar {
    width: 248px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
    border-inline-end: 1px solid rgba(255, 255, 255, .07);
    display: flex; flex-direction: column; overflow-y: auto; padding: 18px 14px;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 999px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 999px;
    cursor: pointer; color: var(--sidebar-text); font-size: 14px; font-weight: 700; text-decoration: none;
    transition: background .18s ease, color .18s ease, box-shadow .2s ease;
}
.nav-item .ni-ico { display: inline-flex; justify-content: center; width: 22px; color: var(--sidebar-muted); transition: color .18s ease; }
.nav-item .ni-ico .ic { width: 19px; height: 19px; }
.nav-item:hover:not(.active) { background: rgba(37, 99, 235, .18); color: #fff; }
.nav-item:hover:not(.active) .ni-ico { color: #93b4ff; }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(37, 99, 235, .34); }
.nav-item.active .ni-ico { color: #fff; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 8px 6px; }

.sidebar-foot { margin-top: auto; padding-top: 16px; }
/* دکمه‌ی «راهنما و پشتیبانی» — مقصدش نمای view-support است */
.support-mini {
    display: flex; align-items: center; gap: 11px; cursor: pointer; text-decoration: none;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 58%, #1d4ed8 100%);
    color: #fff; border-radius: 20px; padding: 14px 15px;
    box-shadow: 0 16px 34px rgba(37, 99, 235, .26);
    transition: transform .18s ease, box-shadow .2s ease;
}
.support-mini:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(37, 99, 235, .36); }
.support-mini .sm-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); flex-shrink: 0; }
.support-mini .sm-ico .ic { width: 18px; height: 18px; }
.support-mini .sm-tx { display: flex; flex-direction: column; min-width: 0; }
.support-mini .sm-tx b { font-size: 13px; font-weight: 800; }
.support-mini .sm-tx small { font-size: 11px; color: rgba(255, 255, 255, .78); margin-top: 2px; }
.support-mini .sm-go { margin-right: auto; font-size: 15px; opacity: .8; transition: transform .18s ease; }
.support-mini:hover .sm-go { transform: translateX(-3px); }

.main { flex: 1; overflow-y: auto; padding: 24px 30px; }
.main > .view { max-width: 1280px; margin: 0 auto; }
body.in-form .main { overflow: hidden; padding: 18px 24px; }

.view { display: none; }
.view.active { display: block; }

/* ============================================================
   داشبورد
   ============================================================ */
.hero {
    background: linear-gradient(120deg, var(--brand) 0%, #1d3a5e 100%);
    color: #fff; border-radius: 18px; padding: 38px 34px; text-align: center; margin-bottom: 24px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero h1 { font-size: 26px; color: var(--on-brand); margin-bottom: 10px; }
.hero p { color: #c9d2e0; font-size: 14px; margin-bottom: 20px; }
.hero-btn { background: var(--gold); color: #fff; border: none; padding: 13px 30px; border-radius: 10px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: 'Vazir'; transition: .2s; }
.hero-btn:hover { background: var(--gold-dark); transform: translateY(-2px); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); transition: .2s; }
.stat-card:hover { transform: translateY(-1px); }
.stat-ico { font-size: 26px; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--accent); margin: 6px 0 2px; }
.stat-lbl { font-size: 13px; color: var(--muted); }

.section-title { font-size: 16px; color: var(--text); margin-bottom: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quick-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: .2s; }
.quick-card span { display: block; font-size: 26px; margin-bottom: 8px; }
.quick-card:hover { border-color: var(--gold); transform: translateY(-1px); }

/* ============================================================
   داشبورد / خدماتِ بیشتر / راهنما و پشتیبانی
   لایه‌ی توکن: مقادیرِ --g-* فقط داخلِ این سه نما اعتبار دارند.
   ============================================================ */
#view-dashboard, #view-services, #view-support {
    --g-surface: #ffffff;
    --g-soft: #eaf2ff;
    --g-outline: #dbe4f0;
    --g-on: #172033;
    --g-on-muted: #5b6b85;
    --g-primary: #2563eb;
    --g-primary-strong: #1d4ed8;
    --g-success: #16a34a;
    --g-success-soft: #e9f8ef;
    --g-r-card: 20px;
    --g-r-card-lg: 24px;
    --g-r-panel: 28px;
    --g-sh-card: 0 18px 44px rgba(15, 23, 42, .08);
    --g-sh-panel: 0 22px 54px rgba(15, 23, 42, .24);
    --g-sh-support: 0 22px 52px rgba(37, 99, 235, .2);
    --g-gap: 72px;

    max-width: 1180px;
    color: var(--g-on);
}

[data-theme="dark"] #view-dashboard,
[data-theme="dark"] #view-services,
[data-theme="dark"] #view-support {
    --g-surface: #16212f;
    --g-soft: rgba(37, 99, 235, .16);
    --g-outline: #26344a;
    --g-on: #e7ecf3;
    --g-on-muted: #8893a4;
    --g-success-soft: rgba(22, 163, 74, .16);
    --g-sh-card: 0 18px 44px rgba(0, 0, 0, .32);
}

/* ---------- عناصرِ مشترک ---------- */
.g-sec { margin-top: var(--g-gap); }
.g-sec-head { max-width: 640px; margin-bottom: 26px; }
.g-sec-head h2 { font-size: 36px; font-weight: 900; line-height: 1.15; color: var(--g-on); margin: 10px 0 8px; }
.g-sec-head p { font-size: 16px; line-height: 1.6; color: var(--g-on-muted); }

.g-label {
    display: inline-block; font-size: 12px; font-weight: 800; line-height: 1.2; letter-spacing: .04em;
    color: var(--g-primary); background: var(--g-soft); border-radius: 999px; padding: 6px 12px;
}
.g-label.light { color: #fff; background: rgba(255, 255, 255, .16); }

.g-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
    font-family: 'Vazir'; font-size: 15px; font-weight: 800; cursor: pointer; white-space: nowrap;
    text-decoration: none; transition: transform .18s ease, box-shadow .2s ease, background .2s ease;
}
.g-btn:hover { transform: translateY(-2px); }
.g-btn.primary { background: var(--g-primary); color: #fff; box-shadow: 0 12px 26px rgba(37, 99, 235, .28); }
.g-btn.primary:hover { background: var(--g-primary-strong); }
.g-btn.ghost { background: transparent; color: var(--g-on); border-color: var(--g-outline); }
.g-btn.ghost:hover { border-color: var(--g-primary); color: var(--g-primary); }
.g-btn.light { background: #fff; color: var(--g-primary-strong); }
.g-btn.outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.g-btn.outline:hover { background: rgba(255, 255, 255, .12); }
.g-btn.sm { height: 40px; padding: 0 16px; font-size: 13.5px; }

/* ---------- ① هیرو ---------- */
.g-hero {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center;
    min-height: 468px; padding: 44px;
    background: var(--g-surface); border: 1px solid var(--g-outline);
    border-radius: var(--g-r-panel); box-shadow: var(--g-sh-card);
    position: relative; overflow: hidden;
}
.g-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(680px 420px at 4% 108%, rgba(37, 99, 235, .10), transparent 62%),
        radial-gradient(520px 360px at 96% -14%, rgba(37, 99, 235, .07), transparent 60%);
}
.g-hero > * { position: relative; }
.g-eyebrow {
    display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; letter-spacing: .04em;
    color: var(--g-primary); background: var(--g-soft); border-radius: 999px; padding: 7px 14px;
}
.g-hero h1 { font-size: 56px; font-weight: 900; line-height: 1.04; color: var(--g-on); margin: 18px 0 0; }
.g-hero-lead { font-size: 16px; line-height: 1.6; color: var(--g-on-muted); margin-top: 14px; max-width: 52ch; }
.g-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* هیروِ کوتاه — صفحه‌های خدمات و پشتیبانی (بدونِ ستونِ کناری) */
.g-hero.sm { grid-template-columns: 1fr; min-height: 0; padding: 40px 44px; }
.g-hero.sm h1 { font-size: 42px; }
.g-hero.sm .g-hero-lead { max-width: 62ch; }
/* بخشِ بلافاصله پس از هیروِ کوتاه، فاصله‌ی کمتری می‌گیرد */
.g-hero.sm + .g-sec { margin-top: 34px; }

/* کارتِ «امروز» — ستونِ کناریِ داشبورد (فشرده) */
.g-hero-panel {
    background: linear-gradient(150deg, #172033 0%, #0f172a 58%, #111827 100%);
    color: #fff; border-radius: var(--g-r-card); padding: 15px 17px; box-shadow: var(--g-sh-panel);
}
.g-today-top { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.g-today-top .ic { width: 17px; height: 17px; color: #93b4ff; }
.g-today-top b { font-size: 14px; font-weight: 800; }
.g-today-date { font-size: 11px; color: #cbd5e1; margin-right: auto; }
.g-today-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); cursor: pointer; }
.g-today-row:last-child { border-bottom: none; padding-bottom: 2px; }
.g-today-row[data-nav]:hover { opacity: .85; }
.g-today-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); flex-shrink: 0; }
.g-today-ico .ic { width: 16px; height: 16px; }
.g-today-ico.warn { background: rgba(217, 119, 6, .22); color: #fbbf24; }
.g-today-ico.ok { background: rgba(22, 163, 74, .2); color: #4ade80; }
.g-today-tx { display: flex; flex-direction: column; min-width: 0; }
.g-today-tx b { font-size: 12.5px; font-weight: 800; }
.g-today-tx small { font-size: 11px; color: #cbd5e1; margin-top: 1px; }
.g-today-n { margin-right: auto; font-size: 18px; font-weight: 900; color: #fff; flex-shrink: 0; }
.g-today-n.sm { font-size: 12.5px; }

/* ---------- داشبوردِ فشرده: نوارِ بالا + شبکه‌ی دوستونه ---------- */
#view-dashboard { --g-gap: 16px; max-width: 1320px; }

.d-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    background: var(--g-surface); border: 1px solid var(--g-outline); border-radius: var(--g-r-card);
    padding: 13px 18px; box-shadow: var(--g-sh-card);
}
.d-bar-tx { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.d-bar-tx b { font-size: 16px; font-weight: 900; color: var(--g-on); }
.d-bar-tx span { font-size: 12.5px; color: var(--g-on-muted); }
.d-bar-cta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.d-mini {
    font-family: 'Vazir'; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap;
    padding: 8px 13px; border-radius: 999px; border: 1px solid var(--g-outline);
    background: transparent; color: var(--g-on-muted); transition: .16s;
}
.d-mini:hover { border-color: var(--g-primary); color: var(--g-primary); }

/* دو ستون: اصلی (یادآور + کارهای اخیر) و کناری (امروز/اشتراک + میانبرها).
   «کارهای اخیر» داخلِ ستونِ اصلی است تا فاصله‌ی خالیِ زیرِ یادآورها را پر کند
   و باکسِ بزرگِ انتهای صفحه حذف شود. */
.d-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--g-gap); margin-top: var(--g-gap); align-items: stretch; }
.d-main, .d-side { display: flex; flex-direction: column; gap: var(--g-gap); min-width: 0; }

/* هم‌ترازیِ لبه‌ی پایین: در چیدمانِ دوستونی، باکسِ پایینیِ هر ستون تا کفِ ستونِ
   بلندتر کشیده می‌شود تا انتهای «دسترسیِ سریع» و «کارهای اخیر» روی یک خط بیفتد.
   فقط بالای ۱۱۰۰px که گرید دوستونی است؛ در تبلت/موبایل که تک‌ستون می‌شود اثری ندارد. */
@media (min-width: 1100px) {
    .d-main > :last-child, .d-side > :last-child { flex-grow: 1; }
    /* کاشی‌های میانبر فضای اضافه را یکنواخت پر می‌کنند (به‌جای فاصله‌ی خالیِ ته باکس) */
    .d-side > .d-card:last-child { display: flex; flex-direction: column; }
    .d-side > .d-card:last-child .d-quick { flex: 1; grid-auto-rows: 1fr; }
    .d-side > .d-card:last-child .d-q { justify-content: center; }
}

.d-card {
    background: var(--g-surface); border: 1px solid var(--g-outline); border-radius: var(--g-r-card);
    box-shadow: var(--g-sh-card); padding: 15px 17px;
}
.d-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.d-card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; color: var(--g-on); }
.d-card-head h2 .ic { width: 17px; height: 17px; color: var(--g-primary); }
.d-more { font-size: 12.5px; font-weight: 800; color: var(--g-primary); cursor: pointer; white-space: nowrap; transition: transform .18s ease; }
.d-more:hover { transform: translateX(-4px); }

/* کاشی‌های میانبر — ۲×۲ */
.d-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.d-q {
    display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 8px; cursor: pointer;
    font-family: 'Vazir'; background: transparent; border: 1px solid var(--g-outline); border-radius: 12px;
    transition: .16s;
}
.d-q:hover { border-color: var(--g-primary); background: var(--g-soft); }
.d-q-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--g-soft); color: var(--g-primary); }
.d-q:hover .d-q-ico { background: var(--g-primary); color: #fff; }
.d-q-ico .ic { width: 17px; height: 17px; }
.d-q-tx { font-size: 12px; font-weight: 800; color: var(--g-on); text-align: center; }

/* ---------- ② آمار ---------- */
.g-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g-gap); margin-top: var(--g-gap); }
.g-kpi {
    display: flex; align-items: center; gap: 12px; text-align: right; cursor: pointer; font-family: 'Vazir';
    background: var(--g-surface); border: 1px solid var(--g-outline); border-radius: var(--g-r-card);
    padding: 14px 16px; box-shadow: var(--g-sh-card);
    transition: transform .18s ease, border-color .2s ease;
}
.g-kpi:hover { transform: translateY(-3px); border-color: var(--g-primary); }
.g-kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--g-soft); color: var(--g-primary); }
.g-kpi-ico .ic { width: 20px; height: 20px; }
.g-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.g-kpi-num { font-size: 24px; font-weight: 900; line-height: 1.15; color: var(--g-on); }
.g-kpi-lbl { font-size: 12px; font-weight: 700; color: var(--g-on-muted); margin-top: 2px; }
.g-kpi-go { margin-right: auto; color: var(--g-primary); font-size: 20px; opacity: 0; transition: opacity .18s, transform .18s; }
.g-kpi:hover .g-kpi-go { opacity: 1; transform: translateX(-4px); }
.g-kpi.ok .g-kpi-ico { background: var(--g-success-soft); color: var(--g-success); }
.g-kpi.ok:hover { border-color: var(--g-success); }

/* ---------- ③ یادآورهای نزدیک — ردیف‌های فشرده ---------- */
.g-rems { display: flex; flex-direction: column; gap: 7px; }
.g-rem {
    display: flex; align-items: center; gap: 11px;
    border: 1px solid var(--g-outline); border-right: 3px solid var(--g-outline);
    border-radius: 12px; padding: 9px 12px; transition: background .16s ease;
}
.g-rem:hover { background: var(--g-soft); }
.g-rem.over { border-right-color: #dc2626; }
.g-rem.today { border-right-color: #d97706; }
.g-rem.soon { border-right-color: var(--g-primary); }
.g-rem-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--g-soft); color: var(--g-primary); }
.g-rem-ico .ic { width: 16px; height: 16px; }
.g-rem.over .g-rem-ico { background: rgba(220, 38, 38, .1); color: #dc2626; }
.g-rem.today .g-rem-ico { background: rgba(217, 119, 6, .12); color: #d97706; }
.g-rem-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.g-rem-title { font-size: 13.5px; font-weight: 800; color: var(--g-on); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-rem-sub { font-size: 11.5px; color: var(--g-on-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-rem-due { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; background: var(--g-soft); color: var(--g-primary); }
.g-rem-due.over { background: rgba(220, 38, 38, .1); color: #dc2626; }
.g-rem-due.today { background: rgba(217, 119, 6, .12); color: #b45309; }
.g-rem-acts { display: flex; gap: 5px; flex-shrink: 0; }
.g-rem-act {
    width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
    background: transparent; border: 1px solid var(--g-outline); color: var(--g-on-muted); transition: .16s;
}
.g-rem-act .ic { width: 14px; height: 14px; }
.g-rem-act:hover { border-color: var(--g-primary); color: var(--g-primary); }
.g-rem-act.ok:hover { border-color: var(--g-success); color: var(--g-success); background: var(--g-success-soft); }
.g-rem-empty { text-align: center; padding: 26px 16px; border: 1px dashed var(--g-outline); border-radius: 12px; }
.g-rem-empty p { font-size: 13px; color: var(--g-on-muted); margin-top: 9px; }
.g-rem-empty .g-empty-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--g-success-soft); color: var(--g-success); margin: 0; }
.g-rem-empty .g-empty-ico .ic { width: 20px; height: 20px; }

/* ---------- کارت‌های خدماتِ بیشتر ---------- */
/* هدرِ فشرده‌ی صفحه — بدونِ باکسِ بزرگ و بدونِ متنِ توضیحی */
.g-pagehead { padding: 6px 2px 0; }
.g-pagehead h1 { font-size: 30px; font-weight: 900; line-height: 1.1; color: var(--g-on); margin: 12px 0 0; }
.g-pagehead + .g-sec { margin-top: 22px; }

/* کارت‌های خدمت — ردیفیِ فشرده: آیکون · عنوان · فلش (بدونِ توضیح و برچسبِ وضعیت) */
.g-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g-svc {
    display: flex; align-items: center; gap: 14px; text-align: right; width: 100%;
    cursor: pointer; font-family: 'Vazir';
    background: var(--g-surface); border: 1px solid var(--g-outline); border-radius: var(--g-r-card);
    padding: 16px 18px; box-shadow: var(--g-sh-card);
    transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease;
}
.g-svc:hover { transform: translateY(-3px); border-color: var(--g-primary); box-shadow: var(--g-sh-panel); }
.g-svc-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--g-soft); color: var(--g-primary); flex-shrink: 0; }
.g-svc-ico .ic { width: 24px; height: 24px; }
.g-svc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.g-svc-group { font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: var(--g-primary); }
.g-svc-title { font-size: 16px; font-weight: 900; color: var(--g-on); line-height: 1.3; }
.g-svc-arrow { font-size: 19px; font-weight: 900; color: var(--g-on-muted); flex-shrink: 0; transition: transform .18s ease, color .18s ease; }
.g-svc:hover .g-svc-arrow { transform: translateX(-4px); color: var(--g-primary); }

/* ---------- ④ استانداردها ---------- */
.g-checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g-check {
    background: var(--g-surface); border: 1px solid var(--g-outline); border-radius: var(--g-r-card);
    padding: 24px; box-shadow: var(--g-sh-card);
}
.g-check h3 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; line-height: 1.25; color: var(--g-on); margin-bottom: 16px; }
.g-check-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--g-soft); color: var(--g-primary); flex-shrink: 0; }
.g-check-ico .ic { width: 20px; height: 20px; }
.g-check ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.g-check li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.6; color: var(--g-on-muted); }
.g-check li .ic {
    width: 22px; height: 22px; padding: 4px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
    background: var(--g-success-soft); color: var(--g-success); stroke-width: 3;
}

/* ---------- ④ کارهای اخیر — کارتِ روشن در ستونِ اصلی ---------- */
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.g-chip {
    display: flex; align-items: center; gap: 6px; cursor: pointer; font-family: 'Vazir';
    background: transparent; border: 1px solid var(--g-outline); border-radius: 999px;
    padding: 6px 11px; color: var(--g-on-muted); font-size: 12px; font-weight: 800;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.g-chip .ic { width: 15px; height: 15px; }
.g-chip:hover { border-color: var(--g-primary); color: var(--g-primary); }
.g-chip.active { background: var(--g-primary); border-color: var(--g-primary); color: #fff; }
.g-chip-n { background: rgba(0, 0, 0, .07); border-radius: 999px; padding: 1px 7px; font-size: 11px; }
.g-chip.active .g-chip-n { background: rgba(255, 255, 255, .24); }
[data-theme="dark"] .g-chip-n { background: rgba(255, 255, 255, .1); }

.g-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.g-item:not(:last-child) { border-bottom: 1px solid var(--g-outline); }
.g-item:hover { background: var(--g-soft); }
.g-item-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--g-soft); color: var(--g-primary); }
.g-item-ico .ic { width: 15px; height: 15px; }
.g-item-ico.done { background: var(--g-success-soft); color: var(--g-success); }
.g-item-ico.draft { background: rgba(217, 119, 6, .12); color: #d97706; }
.g-item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.g-item-title { font-size: 13px; font-weight: 800; color: var(--g-on); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-item-sub { font-size: 11.5px; color: var(--g-on-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-item-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.g-item-badge { font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.g-item-badge.done { background: var(--g-success-soft); color: var(--g-success); }
.g-item-badge.draft, .g-item-badge.instant { background: rgba(217, 119, 6, .12); color: #b45309; }
.g-item-badge.over { background: rgba(220, 38, 38, .1); color: #dc2626; }
.g-item-date { font-size: 11px; color: var(--g-on-muted); }

.g-empty { text-align: center; padding: 24px 16px; }
.g-empty-ico { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--g-soft); color: var(--g-on-muted); margin-bottom: 10px; }
.g-empty-ico .ic { width: 20px; height: 20px; }
.g-empty p { color: var(--g-on-muted); font-size: 13px; margin-bottom: 14px; }

/* کارتِ اشتراک — زیرِ کارتِ «امروز»، داخلِ همان پنلِ تیره */
.g-usage { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.us-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.us-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #93b4ff; flex-shrink: 0; }
.us-ico.ok { background: rgba(22, 163, 74, .2); color: #4ade80; }
.us-ico.warn { background: rgba(217, 119, 6, .22); color: #fbbf24; }
.us-ico .ic { width: 17px; height: 17px; }
.us-tx b { display: block; font-size: 13px; font-weight: 900; color: #fff; }
.us-tx small { font-size: 11px; color: #94a3b8; }
.us-days { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.us-days-n { font-size: 26px; font-weight: 900; color: #fff; }
.us-days span:last-child { font-size: 12px; color: #cbd5e1; }
.us-bar { margin-top: 11px; }
.us-bar-top { display: flex; justify-content: space-between; font-size: 11.5px; color: #cbd5e1; font-weight: 700; margin-bottom: 6px; }
.us-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.us-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, var(--g-primary)); transition: width .5s ease; }
.us-track i.full { background: linear-gradient(90deg, #fbbf24, #d97706); }

/* ---------- ⑦ سوالاتِ متداول ---------- */
.g-faq { display: flex; flex-direction: column; gap: 12px; }
.g-faq-item { background: var(--g-surface); border: 1px solid var(--g-outline); border-radius: var(--g-r-card); box-shadow: var(--g-sh-card); overflow: hidden; }
.g-faq-item summary {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer;
    padding: 20px 24px; font-size: 16px; font-weight: 800; color: var(--g-on); list-style: none;
}
.g-faq-item summary::-webkit-details-marker { display: none; }
.g-faq-item summary:hover { color: var(--g-primary); }
.g-faq-sign {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; position: relative;
    background: var(--g-soft); color: var(--g-primary); font-size: 18px; font-weight: 900; line-height: 1;
    display: grid; place-items: center;
}
.g-faq-sign::before { content: "+"; }
.g-faq-item[open] .g-faq-sign { background: var(--g-primary); color: #fff; }
.g-faq-item[open] .g-faq-sign::before { content: "−"; }
.g-faq-body { padding: 0 24px 22px; border-top: 1px solid var(--g-outline); margin-top: -2px; padding-top: 18px; }
.g-faq-body p { font-size: 15px; line-height: 1.7; color: var(--g-on-muted); }
.g-faq-body b { color: var(--g-on); font-weight: 800; }
.g-faq-link { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 800; color: var(--g-primary); cursor: pointer; transition: transform .18s ease; }
.g-faq-link:hover { transform: translateX(-5px); }

/* ---------- ⑧ پشتیبانی ---------- */
.g-support {
    display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
    margin: var(--g-gap) 0 24px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 58%, #172033 100%);
    color: #fff; border-radius: var(--g-r-panel); padding: 40px; box-shadow: var(--g-sh-support);
}
/* داخلِ .g-sec فاصله از خودِ بخش می‌آید، نه از کارت */
.g-sec > .g-support { margin: 0; }
.g-support-tx { max-width: 620px; }
.g-support-tx h2 { font-size: 36px; font-weight: 900; line-height: 1.15; color: #fff; margin: 10px 0 8px; }
.g-support-tx p { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.g-support-list { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.g-support-list li { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .9); }
.g-support-list .ic { width: 17px; height: 17px; flex-shrink: 0; }
.g-support-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* پولیشِ پوسته — استایلِ سایدبار در بخشِ خودش تعریف شده، نه اینجا. */
.profile-btn:hover { background: rgba(255,255,255,.12); }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1179px) {
    .g-services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1099px) {
    /* ستونِ کناری زیرِ ستونِ اصلی می‌رود؛ «امروز» و میانبرها کنارِ هم می‌مانند */
    .d-grid { grid-template-columns: 1fr; }
    .d-side { flex-direction: row; }
    .d-side > * { flex: 1; min-width: 0; }
}
@media (max-width: 989px) {
    #view-services, #view-support { --g-gap: 52px; }
    .g-hero, .g-hero.sm { grid-template-columns: 1fr; min-height: 0; padding: 32px; }
    .g-hero h1, .g-hero.sm h1 { font-size: 40px; }
    .g-sec-head h2, .g-support-tx h2 { font-size: 28px; }
    .g-kpis { grid-template-columns: repeat(2, 1fr); }
    .g-checks { grid-template-columns: repeat(2, 1fr); }
    .g-check:first-child { grid-column: 1 / -1; }
    .g-dark-body { grid-template-columns: 1fr; }
}
@media (max-width: 699px) {
    #view-services, #view-support { --g-gap: 44px; }
    .g-hero, .g-hero.sm { padding: 24px; }
    .g-hero h1, .g-hero.sm h1 { font-size: 32px; }
    .g-hero-cta { flex-direction: column; }
    .g-hero-cta .g-btn { width: 100%; }
    .g-checks, .g-chips, .g-services { grid-template-columns: 1fr; }
    /* چهار کاشیِ آمار در موبایل: دو ردیفِ دوتایی (۲×۲) به‌جای یک ستونِ کشیده */
    .g-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .g-kpi { padding: 12px; gap: 9px; }
    .g-kpi-ico { width: 34px; height: 34px; }
    .g-kpi-ico .ic { width: 17px; height: 17px; }
    .g-kpi-num { font-size: 20px; }
    .g-kpi-go { display: none; }
    .d-side { flex-direction: column; }
    .d-bar { align-items: stretch; }
    .d-bar-cta { width: 100%; }
    .d-bar-cta > * { flex: 1; justify-content: center; }
    .g-dark-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .g-support { padding: 28px; }
    .g-support-cta { width: 100%; flex-direction: column; }
    .g-support-cta .g-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .g-btn:hover, .g-kpi:hover, .g-svc:hover { transform: none; }
}

/* ============================================================
   سرصفحه صفحات + اکشن
   ============================================================ */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; color: var(--text); }
.primary-action { background: var(--gold); color: #fff; border: none; padding: 11px 20px; border-radius: 9px; font-weight: 700; cursor: pointer; font-family: 'Vazir'; font-size: 14px; transition: .2s; }
.primary-action:hover { background: var(--gold-dark); }

/* ============================================================
   آرشیو یکپارچه
   ============================================================ */
.archive-toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ar-search { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.ar-search span { opacity: .6; }
.ar-search input { flex: 1; border: none; background: transparent; padding: 11px 8px; font-family: 'Vazir'; font-size: 13.5px; color: var(--text); }
.ar-search input:focus { outline: none; }
.ar-select { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font-family: 'Vazir'; font-size: 13.5px; color: var(--text); cursor: pointer; }

/* ---- تب‌ها و پنلِ فیلترِ املاک (گروه ۴) ---- */
.listing-tabs { display: flex; gap: 8px; flex-shrink: 0; }
.listing-tabs .ltab { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 9px 20px; font-family: 'Vazir'; font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .15s; }
.listing-tabs .ltab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.filter-toggle-btn { display: none; align-items: center; gap: 6px; background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 0 16px; font-family: 'Vazir'; font-weight: 700; font-size: 13.5px; cursor: pointer; }

.listing-layout { display: flex; gap: 16px; align-items: flex-start; }
.listing-layout .listing-grid { flex: 1; min-width: 0; margin-top: 0; }

.filter-panel { width: 300px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 12px; display: flex; flex-direction: column; overflow: hidden; }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fp-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.fp-close { display: none; background: var(--surface-2); border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: var(--text); font-size: 15px; align-items: center; justify-content: center; }
.fp-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; }
.fp-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fp-field select, .fp-field input { border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 9px 10px; font-family: 'Vazir'; font-size: 13px; color: var(--text); }
.fp-field select:focus, .fp-field input:focus { outline: none; border-color: var(--brand); }
.fp-range { display: flex; align-items: center; gap: 6px; }
.fp-range input { width: 100%; min-width: 0; }
.fp-range span { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.fp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); cursor: pointer; }
.fp-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.fp-foot { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--border); }
.fp-apply { flex: 1; background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 11px; font-family: 'Vazir'; font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s; }
.fp-apply:hover { background: var(--accent); }
.fp-reset { background: var(--surface-2); color: var(--muted); border: none; border-radius: 10px; padding: 11px 14px; font-family: 'Vazir'; font-weight: 700; font-size: 13px; cursor: pointer; }

@media (max-width: 760px) {
    .filter-toggle-btn { display: inline-flex; }
    .listing-layout { display: block; }
    .filter-panel { position: fixed; inset: 0; top: 0; width: auto; z-index: 400; border: none; border-radius: 0; box-shadow: none; transform: translateY(100%); transition: transform .25s ease; }
    .filter-panel.open { transform: none; }
    .fp-close { display: flex; }
    .fp-body { flex: 1; }
}

.archive-head-row, .contract-row {
    display: grid; grid-template-columns: 110px 1fr 130px 180px 320px; align-items: center; gap: 12px;
}
.archive-head-row { padding: 8px 18px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.archive-list { display: flex; flex-direction: column; gap: 10px; }
.contract-row { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); transition: .15s; }
.contract-row:hover { border-color: var(--gold); }
/* ردیفِ درحال‌استفاده (هاور یا منوی بازِ سه‌نقطه) بالاتر می‌نشیند تا منویش روی ردیفِ پایینی بیفتد، نه زیرِ آن */
.contract-row:hover { z-index: 5; }
.contract-row:has(.row-menu-dropdown.open) { z-index: 40; }

.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.status-dot .dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.draft .dot { background: #e0a800; }
.status-dot.completed .dot { background: #2ecc71; }
.status-dot.canceled .dot { background: var(--danger); }
.status-dot.draft { color: #b88600; }
.status-dot.completed { color: #1e9e57; }

.cr-title { font-weight: 700; font-size: 14.5px; color: var(--text); }
.cr-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
/* کدِ قرارداد عدد است و LTR نوشته می‌شود؛ راست‌چین می‌کنیم تا زیرِ سرستونِ «کد» هم‌راستا بیفتد */
.cr-code { font-family: 'Vazir', monospace; direction: ltr; text-align: right; color: var(--accent); font-weight: 700; font-size: 13px; white-space: nowrap; }
.archive-head-row .col-code { text-align: right; }
.cr-dates { font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.cr-dates b { color: var(--text); }
.cr-actions { display: flex; gap: 7px; justify-content: flex-end; align-items: stretch; }
.cr-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: none; padding: 8px 13px; border-radius: 7px; cursor: pointer; font-family: 'Vazir'; font-weight: 600; font-size: 12.5px; transition: .2s; }
.cr-actions .ic { width: 15px; height: 15px; }

/* ── جعبه‌ی طرفینِ قرارداد: دو نیمه‌ی ثابتِ فروشنده | خریدار (خواناترشدنِ تشخیصِ طرفین) ── */
/* سرستونِ «فروشنده | خریدار» — دو نیمه‌ی هم‌اندازه که با نیمه‌های جعبه‌ی هر ردیف هم‌محور می‌افتند */
.col-parties-head { display: flex; align-items: center; }
.col-parties-head span { flex: 1 1 0; text-align: center; }
.col-parties-head .ph-seller { color: var(--accent); }
.col-parties-head .ph-buyer { color: var(--brand); }

.cr-partybox {
    display: flex; align-items: stretch;
    border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
    background: var(--surface-2);
}
/* هر نیمه؛ برچسبِ کوچک بالا + ناحیه‌ی نام‌ها با ارتفاعِ ثابت (دو نفر) در پایین */
.cr-side { flex: 1 1 0; min-width: 0; padding: 6px 11px; display: flex; flex-direction: column; gap: 3px; }
.cr-side-buyer { border-inline-start: 1px solid var(--border); }   /* خطِ جداکننده‌ی وسط */
.cr-side-tag { font-size: 10.5px; font-weight: 800; line-height: 1; letter-spacing: .2px; }
.cr-side-seller .cr-side-tag { color: var(--accent); }
.cr-side-buyer .cr-side-tag { color: var(--brand); }
/* ناحیه‌ی نام‌ها همیشه ثابت است: دقیقاً دو خط دیده می‌شود، بقیه پنهان */
.cr-side-scroll { height: 44px; overflow: hidden; position: relative; }
.cr-side-track { display: flex; flex-direction: column; }
.cr-nm { height: 22px; line-height: 22px; font-size: 13.5px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-nm-empty { font-weight: 600; font-size: 12px; color: var(--muted); }
/* بیش از دو نفر: با هاورِ همان نیمه، مثلِ تابلوی روان به‌آرامی بالا/پایین می‌رود تا بقیه دیده شوند */
.cr-side.cr-scrollable .cr-side-scroll::after {
    content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 14px;
    background: linear-gradient(to top, var(--surface-2), transparent); pointer-events: none;
}
.cr-side.cr-scrollable:hover .cr-side-track {
    animation: crMarquee var(--cr-dur, 3s) ease-in-out infinite alternate;
}
.cr-side.cr-scrollable:hover .cr-side-scroll::after { opacity: 0; }
@keyframes crMarquee {
    from { transform: translateY(0); }
    to   { transform: translateY(calc(var(--cr-extra, 0) * -22px)); }
}

/* ── صفحه‌بندیِ آرشیو ── */
.archive-pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.archive-pager:empty { display: none; }
.archive-pager .pg-nums { display: flex; gap: 6px; }
.archive-pager button {
    min-width: 36px; height: 36px; padding: 0 12px; border-radius: 9px; cursor: pointer;
    font-family: 'Vazir'; font-weight: 700; font-size: 13px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); transition: .15s;
}
.archive-pager button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.archive-pager .pg-num.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.archive-pager button:disabled { opacity: .45; cursor: default; }
.btn-open { background: var(--accent); color: #fff; }
.btn-open:hover { background: var(--accent-dark); }
.btn-print { background: var(--brand); color: var(--on-brand); }
.btn-docs { background: rgba(37,99,235,.12); color: var(--accent); border: 1px solid var(--accent) !important; }
.btn-docs:hover { background: var(--accent); color: #fff; }
.btn-del { background: transparent; color: var(--danger); border: 1px solid var(--danger) !important; }
.btn-del:hover { background: var(--danger); color: #fff; }

/* ---------- آرشیوِ الحاقیه (فهرستِ داخلِ مودال) ----------
   دکمه‌های «نمایش/چاپ» فقط رنگ داشتند و پایه‌ی استایل (padding/گوشه/فونت)
   نمی‌گرفتند، چون آن پایه به `.cr-actions button` محدود بود. اینجا کلِ ردیف‌ها
   و دکمه‌ها به‌سبکِ آرشیوِ قراردادها استایل می‌شوند. */
.add-intro { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 14px; }
.add-list { display: flex; flex-direction: column; gap: 10px; }
.add-row {
    display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 14px; row-gap: 5px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 13px 16px; box-shadow: var(--shadow); transition: border-color .15s;
}
.add-row:hover { border-color: var(--gold); }
.add-r-main { grid-column: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.add-r-main b { font-size: 14px; font-weight: 700; color: var(--text); }
.add-r-code { font-family: 'Vazir', monospace; direction: ltr; color: var(--accent); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.add-r-sub { grid-column: 1; font-size: 12px; color: var(--muted); }
.add-r-act { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 7px; }
.add-r-act button {
    display: inline-flex; align-items: center; gap: 5px; border: none;
    padding: 8px 13px; border-radius: 7px; cursor: pointer; font-family: 'Vazir';
    font-weight: 600; font-size: 12.5px; transition: .2s; white-space: nowrap;
}
.add-r-act .ld-del-btn { padding: 8px 10px; }
.add-r-act .ic { width: 14px; height: 14px; }

/* منوی عملیات بیشتر (⋮) */
/* row-menu یک آیتمِ فلکسِ .cr-actions است و کش می‌آید؛ دکمه‌ی سه‌نقطه ارتفاعش را پر می‌کند
   تا دقیقاً هم‌قدِ بقیه‌ی دکمه‌های نوار باشد */
.row-menu { position: relative; display: flex; align-items: stretch; }
.btn-kebab { height: 100%; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted); border: 1px solid var(--border) !important; padding: 0 12px !important; font-size: 16px; line-height: 1; }
.btn-kebab:hover { color: var(--text); border-color: var(--gold) !important; }
.row-menu-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(20,35,60,.18); padding: 6px; z-index: 100; }
.row-menu-dropdown.open { display: block; }
.rm-item { display: block; padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.rm-item:hover { background: var(--surface-2); }
.rm-item.danger { color: var(--danger); }
.rm-note { display: block; padding: 9px 12px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.empty-state { text-align: center; color: var(--muted); padding: 56px 20px; font-size: 15px; }

/* انتخاب نوع قرارداد */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.type-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 26px; cursor: pointer; text-align: center; transition: .2s; box-shadow: var(--shadow); }
.type-card:hover { background: var(--gold); color: #fff; transform: translateY(-1px); }
.type-card .ticon { font-size: 38px; margin-bottom: 10px; }
.type-card h3 { color: var(--text); margin-bottom: 6px; }
.type-card:hover h3 { color: var(--brand); }
.type-card p { color: var(--muted); font-size: 13px; }

/* ============================================================
   پروفایل + نماهای آینده
   ============================================================ */
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 520px; }
.profile-info { width: 100%; }
.pi-row { display: flex; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.pi-row span { color: var(--muted); }
.soon-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.soon-wrap { text-align: center; padding: 80px 20px; color: var(--muted); }
.soon-ico { font-size: 60px; margin-bottom: 14px; }
.soon-ico .ic { width: 54px; height: 54px; color: var(--accent); opacity: .7; }
.soon-wrap h2 { color: var(--text); margin-bottom: 8px; }
.soon-wrap p { max-width: 52ch; margin: 0 auto; line-height: 1.75; font-size: 14.5px; }
.soon-back { margin-top: 22px; }

/* ============================================================
   فرم قرارداد (چیدمان داخلی + اسکرول)
   ============================================================ */
#view-form.active { display: flex; flex-direction: column; height: 100%; max-width: 1280px; margin: 0 auto; width: 100%; }
.form-column { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.form-container { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }

.form-header { background: var(--brand); padding: 11px 18px; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.form-back-btn { background: rgba(255,255,255,.10); color: var(--on-brand); border: 1px solid rgba(255,255,255,.22); border-radius: 7px; padding: 6px 14px; cursor: pointer; font-family: 'Vazir'; font-weight: 600; font-size: 13px; flex-shrink: 0; transition: .2s; }
.form-back-btn:hover { background: var(--gold); color: #fff; }
.form-header h2 { font-size: 15.5px; font-weight: 600; color: var(--on-brand); flex: 1; }
.form-code { font-family: 'Vazir', monospace; direction: ltr; color: #8b97ab; font-size: 12px; flex-shrink: 0; }

.form-content-wrapper { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; }
.form-content-wrapper::-webkit-scrollbar { width: 8px; }
.form-content-wrapper::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.save-indicator { font-size: 12.5px; color: var(--accent); font-weight: 600; min-width: 110px; }
.nav-buttons { display: flex; gap: 10px; margin-right: auto; }

.progress-container { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); flex-shrink: 0; flex-wrap: wrap; }
.progress-step { width: 32px; height: 6px; background: var(--border); border-radius: 4px; transition: .3s; }
.progress-step.active { background: var(--gold); }

.btn { padding: 10px 22px; border: none; border-radius: 7px; cursor: pointer; font-size: 13.5px; font-weight: 600; transition: .2s; font-family: 'Vazir'; }
.btn-back { background: #6c757d; color: #fff; }
.btn-back:hover { background: #5a6268; }
.btn-continue { background: var(--accent); color: #fff; }
.btn-continue:hover { background: var(--accent-dark); }
.add-seller-btn { background: var(--accent); color: #fff; border: none; padding: 10px 18px; border-radius: 7px; cursor: pointer; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-family: 'Vazir'; transition: .2s; }
.add-seller-btn:hover { background: var(--accent-dark); }

/* ── seller / party / field ── */
.step-content { animation: fadeIn .25s ease-in; }
.step-content.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.seller-box { background: var(--surface-2); border-radius: 10px; padding: 16px; margin-bottom: 16px; border: 1.5px solid var(--border); }
.seller-header { background: var(--gold); color: #fff; padding: 9px 16px; border-radius: 7px; margin-bottom: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.seller-header button { background: rgba(12,29,52,.2); border: none; color: var(--brand); cursor: pointer; padding: 5px 10px; border-radius: 5px; font-family: 'Vazir'; font-weight: 600; }
.seller-header button:hover { background: var(--brand); color: var(--on-brand); }

.form-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; }
.form-group.col-4 { grid-column: span 4; }
.form-group label { font-size: 12.5px; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group select { padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 13px; font-family: 'Vazir'; background: var(--surface); color: var(--text); transition: .2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.date-input { cursor: pointer; }

.inline-text-form { margin: 16px 0; }
.inline-text { font-size: 13.5px; line-height: 2.4; color: var(--text); }
.inline-input { border: none; border-bottom: 2px solid var(--gold); padding: 4px 8px; font-size: 14px; font-family: 'Vazir'; background: transparent; color: var(--text); transition: .2s; }
.inline-input:focus { outline: none; border-bottom-color: var(--accent); background: rgba(37,99,235,.05); }
.inline-input.small { width: 80px; }
.inline-input.medium { width: 150px; }
.inline-input.large { width: 250px; }
.inline-input.xlarge { width: 480px; max-width: 100%; }
.inline-input.date-input { cursor: pointer; }

.payment-fields { margin-top: 16px; padding: 16px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--gold); }

.clause-box { background: var(--surface-2); border-radius: 9px; padding: 14px 16px; margin-bottom: 12px; border: 1.5px solid var(--border); position: relative; }
.fixed-clause { padding-top: 24px; }
.clause-remove-link { position: absolute; top: 7px; left: 12px; background: none; border: none; color: var(--danger); font-family: 'Vazir', sans-serif; font-size: 12px; cursor: pointer; padding: 0; opacity: .7; transition: opacity .2s; }
.clause-remove-link:hover { opacity: 1; text-decoration: underline; }
.clause-box.editable { border-color: var(--accent); background: var(--surface); }
.clause-text { font-size: 13.5px; line-height: 1.9; color: var(--text); min-height: 36px; font-family: 'Vazir'; }
.clause-text[contenteditable]:empty:before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
.clause-text[contenteditable]:focus { outline: none; background: var(--surface-2); border-radius: 4px; padding: 8px; }
.clause-actions { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-direction: row-reverse; }
.clause-btn { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border: none; border-radius: 6px; font-family: 'Vazir'; font-size: 12.5px; cursor: pointer; font-weight: 600; transition: .2s; }
.ai-btn { background: var(--accent); color: #fff; }
.ai-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.delete-btn { background: var(--surface); color: var(--danger); border: 1px solid var(--danger); }
.delete-btn:hover { background: var(--danger); color: #fff; }
.clause-btn:disabled { opacity: .6; cursor: not-allowed; }

.add-box { background: var(--surface); border: 2px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Vazir'; color: var(--text); font-weight: 600; transition: .2s; }
.add-box:hover { background: var(--surface-2); border-color: var(--accent); }
.add-icon { font-size: 22px; color: var(--gold); }

/* شاهدها (اختیاری) + فعلِ جمع/مفرد در متنِ بندها */
.witness-box { background: var(--surface-2); border-radius: 10px; padding: 16px; margin-bottom: 16px; border: 1.5px solid var(--border); }
.verb { font-weight: 700; color: var(--accent); }

/* ============================================================
   مودال مدارک بایگانی
   ============================================================ */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 300;
    background: rgba(8, 16, 28, .6); align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface); color: var(--text); width: 100%; max-width: 620px; max-height: 88vh;
    border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--brand); color: var(--on-brand); }
.modal-head h3 { font-size: 15px; }
.modal-close { background: transparent; border: none; color: var(--on-brand); font-size: 20px; cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; }

.upload-drop {
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    border: 2px dashed var(--border); border-radius: 12px; padding: 26px; cursor: pointer;
    background: var(--surface-2); transition: .2s;
}
.upload-drop:hover, .upload-drop.drag { border-color: var(--accent); background: rgba(37,99,235,.06); }
.upload-drop .ud-ico { font-size: 30px; }
.upload-drop .ud-text { font-weight: 700; font-size: 14px; }
.upload-drop small { color: var(--muted); font-size: 12px; }
.upload-status { text-align: center; font-size: 13px; font-weight: 600; color: var(--accent); min-height: 20px; margin: 12px 0; }

.docs-list { display: flex; flex-direction: column; gap: 10px; }
.docs-empty { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.doc-ico { font-size: 24px; }
.doc-meta { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }
.doc-actions button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-family: 'Vazir'; font-size: 12px; transition: .2s; }
.doc-actions button:hover { border-color: var(--accent); color: var(--accent); }
.doc-actions .doc-del:hover { border-color: var(--danger); color: var(--danger); }

/* ============================================================
   پروفایل کاربر
   ============================================================ */
.profile-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
/* پنل کاربر — چیدمان افقی: عکس سمت چپ، فیلدها سمت راست (بدون اسکرول) */
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: row-reverse; align-items: stretch; gap: 32px; max-width: none; }
.profile-photo { flex: 0 0 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; border-inline-start: 1px solid var(--border); padding-inline-start: 34px; }
.profile-photo-name { font-size: 19px; font-weight: 800; color: var(--text); text-align: center; }
.profile-photo-role { font-size: 13.5px; font-weight: 700; color: var(--accent); background: rgba(37,99,235,.10); padding: 4px 14px; border-radius: 20px; }
.profile-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.pf-actions { margin-top: 18px; }
.pf-actions .auth-submit { max-width: 240px; }
.avatar-wrap { position: relative; width: 250px; height: 250px; }
.avatar-img { width: 250px; height: 250px; border-radius: 30px; object-fit: cover; border: 3px solid var(--gold); }
.avatar-wrap .avatar.xl { width: 250px; height: 250px; border-radius: 30px; font-size: 88px; }
.avatar-edit { position: absolute; bottom: -4px; left: -4px; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 19px; border: 2px solid var(--surface); }
.avatar-edit:hover { background: var(--accent-dark); }
.profile-msg { text-align: right; font-size: 13px; font-weight: 600; margin-top: 10px; min-height: 18px; color: var(--accent); }
.profile-msg.onboard { background: rgba(37,99,235,.12); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; line-height: 1.8; }

.activity-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.activity-card h3 { font-size: 15px; margin-bottom: 14px; color: var(--text); }
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.ai-label { font-size: 13.5px; font-weight: 600; }
.ai-time { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

#view-profile .profile-side { margin-top: 18px; max-width: 420px; }
@media (max-width: 900px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-card { flex-direction: column; align-items: center; gap: 20px; }
    .profile-photo { flex-basis: auto; border-inline-start: none; padding-inline-start: 0; border-bottom: 1px solid var(--border); padding-bottom: 18px; width: 100%; }
    .pf-grid { grid-template-columns: 1fr; }
    .profile-fields { width: 100%; }
}

/* ============================================================
   واکنش‌گرا
   ============================================================ */
@media (max-width: 1100px) { .stat-grid, .quick-grid { grid-template-columns: repeat(2, 1fr); } .form-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
    .hdr-search { display: none; }
    .sidebar { position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 90; transform: translateX(100%); transition: transform .25s; box-shadow: -18px 0 48px rgba(15, 23, 42, .3); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .archive-head-row { display: none; }
    .contract-row { grid-template-columns: 1fr; gap: 8px; }
    .cr-actions { justify-content: flex-start; }
    .form-row { grid-template-columns: 1fr 1fr; }
    .brand-text small { display: none; }

    /* پروفایل در موبایل: فقط عکس + فلش منو داخل باکس */
    .profile-name { display: none; }
    .profile-btn { padding: 5px 8px; gap: 4px; }

    /* پنل اعلان‌ها در موبایل: چسبیده به لبه‌ها که بیرون نزند */
    .notif-panel {
        position: fixed; top: calc(var(--header-h) + 6px); left: 8px; right: 8px;
        width: auto; max-width: none;
    }
}

/* ============================================================
   ماژول فایلینگ (فایل‌های ملک)
   ============================================================ */
.instant-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; cursor: pointer; white-space: nowrap; }
.instant-filter input { width: 16px; height: 16px; accent-color: var(--accent); }

/* فهرست کارت‌ها */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; margin-top: 16px; }
.listing-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.listing-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(20,35,60,.13); }
.lc-cover { height: 150px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lc-cover img { width: 100%; height: 100%; object-fit: cover; }
.lc-noimg { font-size: 44px; opacity: .35; }
.lc-body { padding: 12px 14px; }
.lc-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.lc-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.lc-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lc-code { font-size: 12px; color: var(--muted); font-family: monospace; }
.lc-status { font-size: 11.5px; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.lc-status.st-active { background: rgba(37,99,235,.14); color: var(--accent); }
.lc-status.st-reserved { background: var(--warn-bg); color: var(--warn-text); }
.lc-status.st-sold { background: rgba(231,76,60,.13); color: var(--danger); }
.lc-status.st-archived { background: var(--surface-2); color: var(--muted); }
.lc-foot { display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.lc-agent { font-size: 11.5px; color: var(--muted); }
.badge-instant { font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(90deg,#f39c12,#e67e22); padding: 2px 8px; border-radius: 20px; }

/* انتخاب نوع (chips) */
.lf-chooser { margin-top: 18px; }
.lf-choose-block { margin-bottom: 22px; }
.lf-choose-block h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 9px 20px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 30px; cursor: pointer; font-family: inherit; font-size: 14px; transition: all .15s; }
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* فرم پویا */
.lf-body { max-width: 920px; margin: 0 auto; }
.lf-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 0 20px; margin-bottom: 18px; box-shadow: var(--shadow); overflow: hidden; }
.lf-group-title { font-size: 14.5px; font-weight: 700; color: var(--brand); background: var(--surface-2); border-right: 4px solid var(--gold); padding: 13px 18px; margin-bottom: 18px; }
[data-theme="dark"] .lf-group-title { color: var(--text); }
.lf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; padding: 0 18px; }
@media (max-width: 760px) { .lf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .lf-grid { grid-template-columns: 1fr; } }
.lf-field { display: flex; flex-direction: column; gap: 7px; }
.lf-field.col-wide { grid-column: 1 / -1; }
.lf-field > label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lf-field > label small { font-weight: 400; }
.lf-field input[type=text], .lf-field input[type=tel], .lf-field select, .lf-field textarea,
.lf-field .rial-input, .lf-field .num-input {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14px; transition: border-color .15s;
}
.lf-field textarea { height: auto; min-height: 46px; padding: 10px 12px; resize: vertical; }
.lf-field input:focus, .lf-field select:focus, .lf-field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.num-wrap { position: relative; display: flex; align-items: center; }
.num-suffix { position: absolute; left: 10px; color: var(--muted); font-size: 12px; pointer-events: none; }

/* کلید روشن/خاموش (bool) */
.bool-field { justify-content: center; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .slider { width: 42px; height: 24px; background: var(--border); border-radius: 20px; position: relative; transition: background .2s; flex-shrink: 0; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; right: 3px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(-18px); }
.switch-label { font-size: 14px; color: var(--text); }

/* دکمهٔ افزودنِ گرد (مشترک) */
.ms-add, .mm-addbtn {
    width: 38px; height: 38px; flex-shrink: 0; border: none; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, background .15s;
}
.ms-add:hover, .mm-addbtn:hover { background: var(--accent-dark); transform: scale(1.08); }

/* managed-select */
.managed-select { display: flex; gap: 8px; align-items: center; }
.managed-select select { flex: 1; }

/* managed-multi (چیپ‌ها) */
.managed-multi { display: flex; flex-direction: column; gap: 9px; }
.mm-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.mm-chip { padding: 6px 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 20px; cursor: pointer; font-family: inherit; font-size: 13px; transition: all .12s; }
.mm-chip:hover { border-color: var(--gold); }
.mm-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.mm-add { display: flex; gap: 8px; align-items: center; }
.mm-input { flex: 1; height: 38px; padding: 0 12px; border: 1px dashed var(--border); border-radius: 10px; background: transparent; color: var(--text); font-family: inherit; font-size: 13px; }

/* رسانه */
.media-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mp-item { position: relative; width: 88px; height: 88px; border-radius: 9px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 30px; border: 1px solid var(--border); }
.mp-item img { width: 100%; height: 100%; object-fit: cover; }
.mp-del { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(231,76,60,.9); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }

/* اکشن‌های فرم فایل */
.lf-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 0 30px; }
.lf-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lf-meta label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lf-meta .ar-select { min-width: 150px; }
.lf-actions .btn-continue { margin-right: auto; }
#lfSubmit:disabled, #afSubmit:disabled { opacity: .6; cursor: default; }

/* موقعیت: کمبوباکسِ محله (بند ۳) */
.nb-wrap { position: relative; display: flex; }
.nb-wrap .nb-input { flex: 1; }
/* position:fixed تا کارت/ویزارد (که overflow دارند) منو را نبُرند؛ مختصات را JS می‌دهد */
.nb-menu { position: fixed; z-index: 1200; overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,35,60,.18); display: none; }
.nb-menu.open { display: block; }
.nb-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13.5px;
    cursor: pointer; border-bottom: 1px solid var(--border); }
.nb-item:last-child { border-bottom: none; }
.nb-item:hover { background: var(--surface-2); }
.nb-item .nb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-item.fav .nb-name { color: var(--gold); font-weight: 600; }
.nb-item.nb-new .nb-name { color: var(--muted); font-style: italic; }
/* ستارهٔ منتخب‌کردن — جلوِ هر محله، داخلِ منو */
.nb-fav { flex-shrink: 0; width: 26px; height: 26px; border: 1px solid transparent; border-radius: 7px;
    background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; transition: all .12s; }
.nb-fav:hover { border-color: var(--gold); color: var(--gold); background: var(--surface-2); }
.nb-fav.on { color: var(--gold); }
.nb-empty { padding: 12px; font-size: 13px; color: var(--muted); text-align: center; }

/* اشتراک‌گذاری با همکار (بند ۹) */
.share-modes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.share-mode { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border);
    border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 13.5px; color: var(--text); transition: all .12s; }
.share-mode:hover { border-color: var(--gold); }
.share-mode input { accent-color: var(--accent); }
.share-members { margin-bottom: 14px; }
.share-empty { color: var(--muted); font-size: 13px; }

/* کارت متقاضی */
.applicant-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.applicant-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(20,35,60,.13); }
.ap-ico { font-size: 32px; flex-shrink: 0; }
.ap-body { flex: 1; min-width: 0; }
.ap-name { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.ap-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.ap-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ap-phone { font-size: 12.5px; color: var(--text); }
.ap-visit { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* راهنمای فیلد و پیام دعوت */
.field-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.auth-field select { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14px; }
.invite-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ============================================================
   پنل اعلان (زنگِ هدر)
   ============================================================ */
.notif-menu { position: relative; }
.notif-badge { position: absolute; top: 2px; left: 2px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--danger); color: #fff; border-radius: 10px; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 700; }
.notif-panel { position: absolute; top: 46px; left: 0; width: 330px; max-width: 88vw; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(20,35,60,.18); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .18s; z-index: 60; }
.notif-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.np-head a { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 400; }
.np-list { max-height: 380px; overflow-y: auto; }
.np-empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.np-item { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.np-item.unread { background: var(--surface-2); }
.np-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.np-body { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.np-time { font-size: 11px; color: var(--muted); margin-top: 5px; }
.np-actions { display: flex; gap: 8px; margin-top: 10px; }
.np-accept, .np-reject { padding: 5px 16px; border: none; border-radius: 7px; cursor: pointer; font-family: inherit; font-size: 12.5px; }
.np-accept { background: var(--accent); color: #fff; }
.np-reject { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ============================================================
   مدیریت مشاورها
   ============================================================ */
.advisor-invite { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.ai-form { display: flex; gap: 10px; }
.ai-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14px; }
.ai-form .btn-continue { white-space: nowrap; }
.ai-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.advisor-list { display: flex; flex-direction: column; gap: 10px; }
.advisor-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.adv-ico { font-size: 28px; }
.adv-info { flex: 1; }
.adv-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.adv-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.adv-pending { font-size: 11px; font-weight: 600; color: var(--warn-text); background: var(--warn-bg); padding: 2px 9px; border-radius: 20px; }
.adv-active { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(37,99,235,.14); padding: 2px 9px; border-radius: 20px; }
.adv-remove { padding: 7px 16px; border: 1px solid var(--border); background: transparent; color: var(--danger); border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 13px; }
.adv-remove:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ───── مدیریت اعضای آژانس — طرحِ فشرده ───── */
.team-invite { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 8px; }
.team-invite input[type="tel"] { flex: 1 1 200px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14px; }
.team-role { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14px; }
.team-invite .btn-continue { white-space: nowrap; }
.team-msg { font-size: 12.5px; font-weight: 700; flex-basis: 100%; min-height: 16px; }
.team-msg.ok { color: var(--accent); }
.team-msg.err { color: var(--danger); }
.team-hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 14px; line-height: 1.8; }

.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.tm-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tm-card:hover { border-color: rgba(37,99,235,.35); transform: translateY(-1px); }
.tm-ico {
    width: 44px; height: 44px; border-radius: 13px; flex: 0 0 auto; display: grid; place-items: center;
    font-size: 17px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.tm-card.is-owner .tm-ico { background: linear-gradient(135deg, #6366f1, #4338ca); }
.tm-card.is-pending .tm-ico { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tm-card.is-adv .tm-ico { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.tm-ico .ic { width: 20px; height: 20px; }
.tm-body { flex: 1; min-width: 0; }
.tm-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tm-sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.tm-sub .ic { width: 13px; height: 13px; flex-shrink: 0; }
.tm-badge { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.tm-owner { color: #4338ca; background: rgba(99,102,241,.15); }
.tm-mgr { color: var(--accent); background: rgba(37,99,235,.14); }
.tm-adv { color: #0369a1; background: rgba(14,165,233,.14); }
.tm-pending { color: var(--warn-text); background: var(--warn-bg); }
.tm-remove { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid var(--border); background: transparent; color: var(--danger); border-radius: 9px; cursor: pointer; font-size: 12px; font-family: inherit; display: grid; place-items: center; transition: .15s; }
.tm-remove:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.tm-remove .ic { width: 15px; height: 15px; }

/* گروه‌بندی سایدبار */
.nav-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-label { font-size: 12px; color: var(--sidebar-muted); font-weight: 800; padding: 0 14px 9px; letter-spacing: .04em; line-height: 1.2; }

/* ============================================================
   صفحه‌ی آژانس املاک — طراحیِ حرفه‌ای (بنر + سطوحِ متنوع)
   ============================================================ */
#view-agency .section-title { display: flex; align-items: center; gap: 8px; margin-top: 26px; font-size: 16px; font-weight: 800; }
#view-agency .section-title .ic { width: 18px; height: 18px; color: var(--accent); }

/* ── بنرِ پروفایل: کارتِ تیره با متنِ روشن (خوانا) ── */
.ag-hero {
    display: flex; align-items: center; gap: 18px; margin-bottom: 16px; padding: 22px 24px;
    border-radius: 20px; overflow: hidden; position: relative; color: #fff;
    background:
        radial-gradient(120% 180% at 92% -20%, rgba(37,99,235,.55), transparent 58%),
        radial-gradient(90% 150% at 6% 120%, rgba(59,130,246,.28), transparent 55%),
        linear-gradient(120deg, #172033, #0f172a 72%);
    box-shadow: 0 12px 30px rgba(15,23,42,.28);
}
@media (max-width: 620px) { .ag-hero { flex-direction: column; align-items: center; text-align: center; padding: 22px 18px; } }
.ag-logo-wrap { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.ag-logo {
    width: 84px; height: 84px; border-radius: 20px; object-fit: cover;
    border: 3px solid rgba(255,255,255,.9); background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.ag-logo-fb { display: flex; align-items: center; justify-content: center; background: #fff; color: var(--accent); }
.ag-logo-fb .ic { width: 36px; height: 36px; }
.ag-logo-edit {
    position: absolute; bottom: -4px; left: -4px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 3px solid #172033; transition: transform .15s, background .15s;
}
.ag-logo-edit:hover { background: var(--accent-dark); transform: scale(1.08); }
.ag-logo-edit .ic { width: 14px; height: 14px; }
.ag-hero-info { flex: 1; min-width: 0; }
.ag-hero-info h3 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; line-height: 1.5; color: #fff; }
.ag-slogan { font-size: 13.5px; color: rgba(255,255,255,.75); margin-top: 3px; }
.ag-hero-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
@media (max-width: 620px) { .ag-hero-meta { justify-content: center; } }
.ag-meta-chip {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
    color: #eaf0fb; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16);
    padding: 5px 11px; border-radius: 20px;
}
.ag-meta-chip .ic { width: 13px; height: 13px; color: #93b4ff; }
.ag-edit-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; align-self: center;
    background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2);
    border-radius: 11px; padding: 9px 16px; font-family: inherit; font-weight: 700; font-size: 13px;
    cursor: pointer; transition: background .15s;
}
.ag-edit-btn:hover { background: rgba(255,255,255,.24); }
.ag-edit-btn .ic { width: 15px; height: 15px; }

/* فرمِ ویرایش — کارتِ جدا و روشن */
.ag-edit-form { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.ag-edit-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; margin-bottom: 16px; }
.ag-edit-title .ic { width: 16px; height: 16px; color: var(--accent); }
.ag-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 620px) { .ag-edit-grid { grid-template-columns: 1fr; } }
.ag-edit-grid .col-full { grid-column: 1 / -1; }
.ag-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ag-edit-actions .profile-msg { margin: 0; }

/* ── ردیفِ اشتراک + پرتال ── */
.ag-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
@media (max-width: 720px) { .ag-row { grid-template-columns: 1fr; } }
.ag-row .ag-sub-card, .ag-row .portal-card { margin-bottom: 0; }

/* ── کارتِ اشتراک: بنرِ رنگیِ افقی ── */
.ag-sub-card {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px;
    border-radius: 18px; padding: 20px 24px; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(120deg, var(--accent), var(--accent-dark));
    box-shadow: 0 12px 26px rgba(37,99,235,.28);
}
.ag-sub-card.warn { background: linear-gradient(120deg, #f59e0b, #d97706); box-shadow: 0 12px 26px rgba(217,119,6,.28); }
.ag-sub-card.expired { background: linear-gradient(120deg, #ef4444, #b91c1c); box-shadow: 0 12px 26px rgba(220,38,38,.26); }
.ag-sub-card.free { background: linear-gradient(120deg, #0d9488, #0f766e); box-shadow: 0 12px 26px rgba(13,148,136,.26); }
.ag-sub-face { display: flex; align-items: center; gap: 16px; }
.ag-sub-ico { width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex-shrink: 0; }
.ag-sub-ico .ic { width: 26px; height: 26px; color: #fff; }
.ag-sub-num { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.ag-sub-lbl { font-size: 13px; opacity: .95; margin-top: 3px; font-weight: 600; }
.ag-sub-date { font-size: 11.5px; opacity: .82; margin-top: 3px; }

/* سقفِ رایگان — کارتِ شیشه‌ای داخلِ بنر */
.ag-quota { margin-right: auto; }
.ag-quota:empty { display: none; }
.ag-quota .q-title { font-size: 11px; opacity: .85; margin-bottom: 5px; font-weight: 700; }
.ag-quota .q-line { font-size: 12.5px; margin: 3px 0; opacity: .96; }
.ag-quota .q-line b { font-weight: 800; }
.ag-quota .q-line.full { font-weight: 800; }
.ag-quota .q-note { margin-top: 7px; font-size: 11px; background: rgba(255,255,255,.16); padding: 6px 10px; border-radius: 8px; }
.ag-quota.active { background: rgba(255,255,255,.16); border-radius: 12px; padding: 10px 16px; }
.ag-quota .q-badge.ok { font-weight: 800; font-size: 13px; }

/* ── نمودارها ── */
.agency-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
@media (max-width: 760px) { .agency-charts { grid-template-columns: 1fr; } }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.chart-card h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.chart-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { width: 120px; flex-shrink: 0; color: var(--muted); }
.bar-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; min-width: 3px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar-val { width: 34px; text-align: left; font-weight: 800; color: var(--text); }

/* ── کارت‌های آماری (فقط در صفحه‌ی آژانس؛ داشبورد دست‌نخورده) ── */
.ag-stat-grid { margin-bottom: 4px; }
.ag-stat-grid .stat-card {
    display: flex; align-items: center; gap: 13px; text-align: right; padding: 16px 18px;
    border-radius: 16px; position: relative; overflow: hidden;
}
.ag-stat-grid .stat-card::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--sc, var(--accent));
}
.ag-stat-grid .stat-ico {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center;
    background: var(--sc-soft, var(--accent-soft)); color: var(--sc, var(--accent));
}
.ag-stat-grid .stat-ico .ic { width: 22px; height: 22px; }
.ag-stat-grid .stat-txt { min-width: 0; }
.ag-stat-grid .stat-num { font-size: 24px; font-weight: 800; color: var(--text); margin: 0; line-height: 1.2; }
.ag-stat-grid .stat-lbl { font-size: 12.5px; color: var(--muted); }

/* ============================================================
   کارت فایل (بازطراحی) + نشان‌های روی کاور
   ============================================================ */
.lc-cover { position: relative; }
.lc-cover .lc-status { position: absolute; top: 8px; right: 8px; }
.lc-cover .badge-instant { position: absolute; top: 8px; left: 8px; }
.lc-price { font-size: 14px; font-weight: 700; color: var(--accent); margin: 2px 0 9px; }
.lc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.lc-foot .lc-agent { font-weight: 600; color: var(--text); }

/* ============================================================
   صفحه نمایش فایل
   ============================================================ */
/* صفحه نمایش فایل — ثابت، بدون اسکرولِ صفحه؛ همه‌چیز در یک نما */
body.in-detail .main { overflow: hidden; }
.ld-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ld-head-titles { flex: 1; min-width: 0; }
.ld-head-titles h2 { font-size: 18px; }
.ld-owner-actions { position: relative; }
.ld-menu { position: absolute; top: 40px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,35,60,.16); min-width: 150px; padding: 6px; display: none; z-index: 30; }
.ld-menu.open { display: block; }
.ld-menu a { display: block; padding: 9px 12px; border-radius: 7px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.ld-menu a:hover { background: var(--surface-2); }
.ld-menu a.danger { color: var(--danger); }
.ld-grid { display: grid; grid-template-columns: 42% 1fr; gap: 18px; align-items: stretch; height: calc(100vh - var(--header-h) - 104px); min-height: 360px; }
@media (max-width: 900px) {
    body.in-detail .main { overflow: auto; }
    .ld-grid { grid-template-columns: 1fr; height: auto; }
    .ld-media { order: -1; min-height: 240px; }   /* موبایل: تصویر بالا، مشخصات پایین */
    .ld-specwrap { column-width: auto; }
}
.ld-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.ld-toprow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ld-deal { color: var(--muted); font-size: 13px; }
.ld-price { font-size: 20px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.ld-agent { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ld-specwrap { flex: 1; min-height: 0; column-width: 195px; column-gap: 22px; overflow: hidden; }
.ld-specgroup { break-inside: avoid; margin-bottom: 14px; }
.ld-specgroup h4 { font-size: 12.5px; color: var(--gold-dark); font-weight: 700; margin-bottom: 7px; }
.ld-specs { display: flex; flex-direction: column; gap: 6px; }
.ld-spec { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.lds-ico { width: 18px; text-align: center; flex-shrink: 0; }
.lds-lbl { color: var(--muted); white-space: nowrap; }
.lds-val { margin-right: auto; font-weight: 600; color: var(--text); text-align: left; }

/* گالری رسانه (مربعِ بزرگِ چپ) */
.ld-media { display: flex; flex-direction: column; min-height: 0; }
.ld-main { flex: 1; min-height: 0; background: #000; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ld-main img, .ld-main video { width: 100%; height: 100%; object-fit: contain; }
.ld-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; flex-shrink: 0; padding-bottom: 4px; }
.ld-thumb { flex-shrink: 0; }
.ld-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.ld-thumb.active { border-color: var(--gold); }
.ld-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ld-noimg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 48px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.ld-noimg span { font-size: 13px; }

/* ============================================================
   کارت متقاضی (بزرگ‌تر) + منوی ۳نقطه
   ============================================================ */
/* کارتِ متقاضی: هم‌اندازه‌ی کارتِ فایل (همان .listing-card) با آواتارِ حرفِ اول */
#applicantGrid { grid-template-columns: 1fr; }
@media (min-width: 820px)  { #applicantGrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { #applicantGrid { grid-template-columns: 1fr 1fr 1fr; } }
.applicant-card .ap-media { background: rgba(37,99,235,.1); }
.ap-initial { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }

/* پاپ‌آپِ جزئیاتِ متقاضی */
.ap-detail-ov { z-index: 340; }
.ap-detail {
    position: relative; background: var(--surface); color: var(--text); width: 100%; max-width: 480px;
    max-height: 88vh; overflow-y: auto; border-radius: 18px; padding: 22px 20px 20px;
    box-shadow: 0 24px 70px rgba(0,0,0,.4);
}
.apd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-left: 34px; }
.apd-avatar {
    width: 54px; height: 54px; border-radius: 15px; flex-shrink: 0; display: grid; place-items: center;
    background: rgba(37,99,235,.12); color: var(--accent); font-size: 22px; font-weight: 800;
}
.apd-name { font-size: 17px; font-weight: 800; }
.apd-sub { font-size: 12.5px; color: var(--muted); }
.apd-rows { display: flex; flex-direction: column; }
.apd-row { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.apd-row:last-child { border-bottom: none; }
.apd-row .l { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.apd-row .l .ic { width: 15px; height: 15px; opacity: .7; }
.apd-row .v { margin-right: auto; font-weight: 700; text-align: left; word-break: break-word; }
.apd-row .v a { color: var(--accent); text-decoration: none; }
.apd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.apd-actions .btn { flex: 1 1 auto; justify-content: center; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 10px 14px; }
.apd-actions .btn .ic { width: 15px; height: 15px; }
.ap-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ap-head-txt { flex: 1; min-width: 0; }
.ap-rows { display: flex; flex-direction: column; gap: 7px; }
.ap-row { font-size: 13px; color: var(--text); }
.ap-row.muted { color: var(--muted); font-size: 12px; margin-top: 3px; }
.ap-menu { position: absolute; top: 10px; left: 10px; }
.ap-kebab { background: transparent; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 2px 7px; border-radius: 6px; line-height: 1; }
.ap-kebab:hover { background: var(--surface-2); color: var(--text); }
.ap-menu-dd { position: absolute; top: 28px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,35,60,.16); min-width: 132px; padding: 6px; display: none; z-index: 20; }
.ap-menu-dd.open { display: block; }
.ap-menu-dd a { display: block; padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text); }
.ap-menu-dd a:hover { background: var(--surface-2); }
.ap-menu-dd a.danger { color: var(--danger); }

/* دکمه «خواندن» اعلان + جعبه خروج از آژانس */
.np-read { padding: 5px 16px; border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer; font-family: inherit; font-size: 12.5px; }
.profile-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); height: fit-content; }
.profile-side h3 { font-size: 15px; margin-bottom: 12px; color: var(--text); }
.profile-side p { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 14px; }

/* اشتراک‌گذاری */
.share-note { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; line-height: 1.8; }
.share-text { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 13px; line-height: 2; padding: 12px; resize: vertical; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.share-link-box { display: flex; gap: 8px; margin-top: 12px; }
.share-link-box input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 12px; direction: ltr; }
.share-msg { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 10px; min-height: 18px; }

/* ============================================================
   کارت فایل — طراحی افقیِ موبایل‌محور (تصویر کنار، مشخصاتِ آیکونی، قیمتِ کل)
   همین سبک در پرتالِ عمومی (portal.php) هم استفاده می‌شود.
   ============================================================ */
.listing-grid { grid-template-columns: 1fr; }
@media (min-width: 820px)  { .listing-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .listing-grid { grid-template-columns: 1fr 1fr 1fr; } }

.listing-card {
    display: flex; gap: 12px; padding: 10px; align-items: stretch;
    border-radius: 16px; overflow: hidden; cursor: pointer;
}
.listing-card:hover { border-color: rgba(37,99,235,.4); }
.lc-media {
    position: relative; width: 122px; height: 122px; flex-shrink: 0; border-radius: 12px;
    overflow: hidden; background: var(--surface-2); display: grid; place-items: center;
}
.lc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-media .lc-ph { width: 30px; height: 30px; color: var(--muted); opacity: .5; }
.lc-badges { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.lc-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.lc-badge.tag-instant { color: #fff; background: linear-gradient(90deg,#f39c12,#e67e22); }
.lc-badge.st-reserved { background: var(--warn-bg); color: var(--warn-text); }
.lc-badge.st-sold { background: rgba(231,76,60,.14); color: var(--danger); }
.lc-badge.st-archived { background: var(--surface-2); color: var(--muted); }

.listing-card .lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 2px 0; }
.listing-card .lc-title {
    font-weight: 800; font-size: 14.5px; color: var(--text); line-height: 1.6; margin: 0; padding: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-loc {
    display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-loc .ic { width: 13px; height: 13px; }
.lc-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.lc-facts span { display: inline-flex; align-items: center; gap: 4px; }
.lc-facts .ic { width: 14px; height: 14px; opacity: .7; }
.listing-card .lc-price { margin-top: auto; padding: 8px 0 0; display: block; }
.listing-card .lc-price b { display: block; font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -.2px; }
.listing-card .lc-price small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.listing-card .lc-price .none { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.lc-agent {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px;
    color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-agent .ic { width: 12px; height: 12px; }

/* برچسب‌ها و ردیفِ امکانات — در صفحه‌ی جزئیاتِ فایل استفاده می‌شوند */
.lc-tag { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; flex-shrink: 0; }
.lc-tag.tag-instant { color: #fff; background: linear-gradient(90deg,#f39c12,#e67e22); }
.lc-tag.st-reserved { background: var(--warn-bg); color: var(--warn-text); }
.lc-tag.st-sold { background: rgba(231,76,60,.14); color: var(--danger); }
.lc-tag.st-archived { background: var(--surface-2); color: var(--muted); }
.lc-amen { display: flex; gap: 6px; padding: 12px 14px 0; }
.lc-amen .am { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 16px; flex: 1; padding: 6px 2px; border-radius: 9px; background: var(--surface-2); color: var(--muted); opacity: .45; filter: grayscale(1); }
.lc-amen .am small { font-size: 9.5px; }
.lc-amen .am.on { opacity: 1; filter: none; color: var(--accent); background: rgba(37,99,235,.1); }

/* ============================================================
   صفحه‌ی جزئیات فایل (تمام‌صفحه — نه پاپ‌آپ)
   ============================================================ */
body.modal-open { overflow: hidden; }
#shareOverlay { z-index: 360; }   /* روی صفحه‌ی جزئیات */

.detail-page { display: none; }
.detail-page.open {
    display: block; position: fixed; inset: 0; z-index: 320;
    background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.detail-modal {
    background: var(--surface); color: var(--text); width: 100%; max-width: 980px;
    margin: 0 auto; display: flex; flex-direction: column; min-height: 100%;
}
.detail-topnav {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.dt-back { flex-shrink: 0; }
.dt-navgroup { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.dt-nav { background: var(--brand); color: #fff; border: none; border-radius: 9px; padding: 8px 18px; font-family: 'Vazir'; font-weight: 700; font-size: 13px; cursor: pointer; }
.dt-nav:disabled { opacity: .4; cursor: default; }
.dt-deal { font-weight: 800; color: var(--gold-dark); background: rgba(37,99,235,.16); padding: 6px 16px; border-radius: 20px; font-size: 14px; }
.detail-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px; }
.dt-similar { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 18px; }
.dt-similar .section-title { margin-bottom: 12px; }
.dt-similar .listing-card { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
@media (max-width: 560px) {
    .detail-topnav { padding: 10px 12px; }
    .dt-deal { font-size: 12.5px; padding: 5px 12px; }
    .dt-nav { padding: 7px 13px; font-size: 12.5px; }
    .detail-body { padding: 14px 12px; }
}

/* ============================================================
   هماهنگ‌سازیِ نماها با سبکِ مدرن (آرشیو / املاک / متقاضیان / زونکن)
   — فقط لایه‌ی بصری؛ ساختار HTML و اسکریپت‌ها دست‌نخورده می‌مانند
   ============================================================ */
/* سرصفحه‌ی نما */
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.2px; }

/* دکمه‌ی کنشِ اصلی — گرادیانِ آبی هماهنگ با داشبورد/لندینگ */
.primary-action {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
    padding: 12px 22px; border-radius: 12px; font-weight: 800;
    box-shadow: 0 10px 22px rgba(37,99,235,.28); transition: transform .15s, box-shadow .2s, filter .2s;
}
.primary-action:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(37,99,235,.4); filter: brightness(1.05); }

/* نوار جستجو/فیلتر */
.archive-toolbar { gap: 10px; margin-bottom: 18px; }
.ar-search { border-radius: 12px; border-width: 1.5px; transition: border-color .18s, box-shadow .18s; }
.ar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.13); }
.ar-search input { padding: 12px 8px; font-size: 14px; }
.ar-select { border-radius: 12px; border-width: 1.5px; min-height: 44px; padding: 0 16px; font-size: 14px; transition: border-color .18s, box-shadow .18s; }
.ar-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.13); }

/* تب‌ها + دکمه‌ی فیلتر */
.listing-tabs .ltab { border-radius: 12px; border-width: 1.5px; padding: 10px 20px; }
.listing-tabs .ltab.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; box-shadow: 0 8px 18px rgba(37,99,235,.3); }
.filter-toggle-btn { background: var(--surface); color: var(--accent); border: 1.5px solid var(--border); border-radius: 12px; transition: border-color .18s, background .18s; }
.filter-toggle-btn:hover { border-color: var(--accent); background: rgba(37,99,235,.06); }

/* ردیف‌های آرشیو */
.archive-list { gap: 12px; }
.contract-row { border-radius: 14px; border-width: 1.5px; transition: transform .16s, box-shadow .2s, border-color .2s; }
.contract-row:hover { transform: translateY(-2px); border-color: rgba(37,99,235,.4); box-shadow: 0 12px 28px rgba(20,35,60,.12); }
.cr-actions button { border-radius: 9px; padding: 8px 14px; }
.cr-actions button:hover { transform: translateY(-1px); }

/* بَجِ وضعیت (نقطه → کپسولِ رنگی) */
.status-dot { padding: 5px 12px; border-radius: 20px; font-size: 12px; }
.status-dot.draft { background: var(--warn-bg); }
.status-dot.completed { background: rgba(22,163,74,.12); }
.status-dot.canceled { background: rgba(220,38,38,.1); }

/* کارت‌های ملک/متقاضی */
.listing-card { border-radius: 16px; border-width: 1.5px; transition: transform .18s, box-shadow .2s, border-color .2s; }
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20,35,60,.16); border-color: rgba(37,99,235,.3); }

/* کارت‌های انتخابِ نوعِ قرارداد — هاورِ نرم‌تر (بدون پرشدنِ کامل) */
.type-card { border-radius: 14px; border-width: 1.5px; transition: transform .18s, box-shadow .2s, border-color .2s, background .2s; }
.type-card:hover { background: var(--surface); color: inherit; transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 34px rgba(20,35,60,.14); }
.type-card:hover h3 { color: var(--accent); }

/* حالتِ خالی */
.empty-state { padding: 60px 20px; font-size: 14.5px; }

/* ============================================================
   بازطراحیِ مراحلِ ثبتِ قرارداد — هماهنگ با سبکِ مدرن
   ============================================================ */
.form-container { border-radius: 16px; border: 1px solid var(--border); }
.form-header { background: linear-gradient(135deg, var(--brand) 0%, #17335a 100%); padding: 14px 20px; gap: 14px; }
.form-header h2 { font-size: 16px; font-weight: 700; }
.form-back-btn { border-radius: 10px; padding: 8px 15px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24); }
.form-back-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.form-actions { padding: 12px 20px; }

/* نوارِ پیشرفت → استپرِ شماره‌دار + برچسبِ «مرحله X از Y» */
.progress-container { justify-content: flex-start; gap: 14px; padding: 12px 20px; border-radius: 16px; flex-wrap: nowrap; overflow-x: auto; }
.progress-container::-webkit-scrollbar { height: 0; }
.progress-label { font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.progress-track { display: flex; align-items: center; gap: 9px; counter-reset: pstep; flex-wrap: nowrap; }
.progress-step {
    width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2);
    border: 1.5px solid var(--border); color: var(--muted);
    display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; transition: .25s;
}
.progress-step::before { counter-increment: pstep; content: counter(pstep); }
.progress-step.active { background: rgba(37,99,235,.14); border-color: rgba(37,99,235,.4); color: var(--accent); }
.progress-step.current { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(37,99,235,.4); transform: scale(1.14); }

/* باکس‌های طرفین / بند / شاهد */
.seller-box, .witness-box, .payment-box { border-radius: 14px; }
.seller-header { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 10px; padding: 10px 16px; }
.seller-header button { background: rgba(255,255,255,.18); color: #fff; border-radius: 8px; }
.seller-header button:hover { background: rgba(255,255,255,.3); color: #fff; }

/* فیلدها */
.form-group input, .form-group select { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.inline-input { border-radius: 6px 6px 0 0; }
.inline-input:focus { background: rgba(37,99,235,.07); }

/* بندها + دکمه‌ی هوش مصنوعی */
.clause-box { border-radius: 12px; }
.ai-btn { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 9px; box-shadow: 0 6px 14px rgba(37,99,235,.25); }
.ai-btn:hover { filter: brightness(1.05); }

/* افزودن */
.add-box { border-radius: 12px; }
.add-box:hover { border-color: var(--accent); background: rgba(37,99,235,.05); }
.add-seller-btn { border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 8px 18px rgba(37,99,235,.25); }
.add-seller-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* دکمه‌های ناوبریِ فرم (و همه‌ی .btn برای هماهنگی) */
.btn { border-radius: 10px; padding: 11px 24px; font-size: 14px; }
.btn-continue { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 8px 18px rgba(37,99,235,.28); }
.btn-continue:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(37,99,235,.42); filter: brightness(1.04); }
.btn-back { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border); }
.btn-back:hover { background: var(--surface); border-color: var(--muted); }
/* صفحه‌ی فایل: در موبایل تک‌ستونی (هم‌چیدمانِ share.php)؛ در دسکتاپ دوستونی — پایین‌تر */
.dt-top { display: block; }
.dt-gallery { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.dt-count {
    position: absolute; bottom: 10px; right: 10px; z-index: 3; background: rgba(15,23,42,.72); color: #fff;
    font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 9px;
    display: inline-flex; align-items: center; gap: 5px;
}
.dt-count .ic { width: 14px; height: 14px; }
/* صحنه‌ی تصویر: ارتفاع فقط از aspect-ratio می‌آید و لایه‌ی داخلی absolute است،
   تا زنجیره‌ی «height:100% روی height:auto» تصویر را به ارتفاعِ صفر نبَرد. */
.dt-main { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0b1420; border-radius: 14px; overflow: hidden; }
.dt-main #dtMain { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dt-main img, .dt-main video { width: 100%; height: 100%; object-fit: contain; display: block; }
.dt-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 100%; border: none; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0)); color: #fff; font-size: 28px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; z-index: 2; }
.dt-arrow.right { right: 0; }
.dt-arrow.left { left: 0; background: linear-gradient(270deg, rgba(0,0,0,.45), rgba(0,0,0,0)); }
.dt-arrow:hover { background: rgba(0,0,0,.55); }
.dt-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.dt-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--surface-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.dt-thumb.active { border-color: var(--gold); }
.dt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dt-noimg { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 48px; color: var(--muted); background: var(--surface-2); border-radius: 12px; }
.dt-noimg span { font-size: 13px; }
.dt-info { min-width: 0; }

/* ---- کارت‌های صفحه‌ی فایل (هم‌سبک با share.php) ----
   پیشوندِ fd- (file detail) — عمداً fp- نیست چون fp- برای پنلِ فیلتر است. */
.fd-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; padding: 16px;
}
.fd-card.fd-hero { padding: 0; }          /* کارتِ قیمت پدینگِ داخلیِ خودش را دارد */
.fd-head { padding: 16px 16px 4px; }
.fd-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.fd-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; background: rgba(37,99,235,.1); color: var(--accent); }
.fd-badge.alt { background: var(--surface-2); color: var(--muted); }
.fd-price { font-size: 25px; font-weight: 800; letter-spacing: -.5px; line-height: 1.5; color: var(--text); }
.fd-price.none { font-size: 18px; color: var(--muted); }
.fd-price-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: -2px; }
.fd-title { font-size: 18px; font-weight: 800; line-height: 1.65; margin: 12px 0 0; }
.fd-place { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.fd-place .ic { width: 15px; height: 15px; }
.fd-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.fd-meta span { display: inline-flex; align-items: center; gap: 4px; }
.fd-meta .ic { width: 13px; height: 13px; }
.fd-keyfacts { display: flex; gap: 6px; margin: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.fd-kf { flex: 1; min-width: 0; text-align: center; }
.fd-kf .ic { width: 19px; height: 19px; color: var(--accent); }
.fd-kf b { display: block; font-size: 15px; font-weight: 800; line-height: 1.7; }
.fd-kf span { font-size: 11px; color: var(--muted); }
.fd-kf.off { opacity: .45; }
.fd-kf.off .ic { color: var(--muted); }
.fd-kf.off b { font-size: 13px; color: var(--muted); }

.fd-sec { font-size: 14.5px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.fd-sec .ic { width: 17px; height: 17px; color: var(--accent); }
.fd-specs { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
@media (min-width: 560px) { .fd-specs { grid-template-columns: 1fr 1fr; } }
.fd-spec { display: flex; gap: 10px; align-items: center; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.fd-spec .l { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.fd-spec .l .ic { width: 15px; height: 15px; opacity: .8; }
.fd-spec .v { margin-right: auto; font-weight: 700; text-align: left; word-break: break-word; }
.fd-spec .v a { color: var(--accent); text-decoration: none; }
.fd-desc { font-size: 14px; line-height: 2.1; color: var(--text); white-space: pre-line; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fd-chip {
    font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 9px; padding: 5px 11px;
    display: inline-flex; align-items: center; gap: 5px;
}
.fd-chip .ic { width: 13px; height: 13px; color: var(--accent); }

/* بلوکِ محرمانه و تماس */
.fd-private { border-color: rgba(37,99,235,.4); background: rgba(37,99,235,.05); }
.fd-private .fd-sec { color: var(--gold-dark); }
.fd-contact { text-align: center; }
.fd-contact-t { font-size: 13px; color: var(--muted); }
.fd-contact-n { font-size: 15px; font-weight: 800; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; }
.fd-call {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; background: var(--accent); color: #fff;
    text-decoration: none; padding: 11px 26px; border-radius: 12px; font-weight: 800; font-size: 15px;
    box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

.dt-title { font-size: 18px; font-weight: 800; line-height: 1.6; }
.dt-metaline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.dt-price { display: flex; gap: 18px; flex-wrap: wrap; font-size: 16px; font-weight: 800; color: var(--accent); margin: 14px 0; padding: 12px 14px; background: rgba(37,99,235,.08); border-radius: 12px; }
.dt-owner { margin: 14px 0; padding: 12px 14px; background: rgba(37,99,235,.12); border: 1px solid rgba(37,99,235,.4); border-radius: 12px; }
.dt-owner h4 { font-size: 13px; color: var(--gold-dark); margin: 0 0 8px; }
.dt-owner-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 4px 0; }
.dt-owner-row span { color: var(--muted); font-weight: 700; flex-shrink: 0; }
.dt-owner-row b { color: var(--text); text-align: left; }
.dt-owner-row a { color: var(--accent); text-decoration: none; }
.dt-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 14px; }
.dt-spec { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.dt-spec .i { width: 20px; text-align: center; flex-shrink: 0; }
.dt-spec .l { color: var(--muted); }
.dt-spec .v { margin-right: auto; font-weight: 700; }
.dt-info .lc-amen { padding: 0 0 6px; }
.dt-desc { margin-top: 8px; }
.dt-desc h4 { font-size: 13px; color: var(--gold-dark); margin-bottom: 5px; }
.dt-desc p { font-size: 13px; line-height: 1.9; color: var(--text); }
.dt-contact { margin-top: 14px; padding: 12px 14px; background: rgba(37,99,235,.08); border-radius: 10px; font-size: 14px; }
.dt-contact a { color: var(--accent); font-weight: 800; text-decoration: none; }
.dt-more { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.dt-more summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--gold-dark); }
.dt-more .ld-specgroup { margin-top: 12px; }
/* بخشِ تمام‌عرضِ پایینِ پاپ‌آپ: توضیحات + همهٔ ویژگی‌ها (چند ستونی برای پرکردنِ فضا و کاهشِ اسکرول) */
.dt-allwrap:not(:empty) { border-top: 1px solid var(--border); padding-top: 16px; }
.dt-allwrap .dt-desc { margin: 0 0 16px; }
.dt-allspecs { column-width: 215px; column-gap: 28px; }
.dt-allspecs .ld-specgroup { break-inside: avoid; margin: 0 0 16px; }
.detail-foot { position: sticky; bottom: 0; z-index: 4; background: var(--surface); margin-top: auto; display: flex; align-items: center; gap: 7px; padding: 11px 16px; border-top: 1px solid var(--border); flex-wrap: nowrap; overflow-x: auto; }
.detail-foot::-webkit-scrollbar { height: 5px; }
.detail-foot .btn { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; font-size: 12.5px; gap: 5px; display: inline-flex; align-items: center; }
.detail-foot .btn .ic { width: 15px; height: 15px; }
.dt-owner-actions { display: flex; gap: 7px; margin-right: auto; flex-shrink: 0; }
.dt-notes { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.dt-notes h4 { font-size: 13px; margin-bottom: 8px; }
.dt-notes textarea { width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-family: 'Vazir'; font-size: 13px; background: var(--surface); color: var(--text); resize: vertical; }
.dt-note-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ============================================================
   موتور تطبیق — مودالِ «منطبق‌ها» + دکمه‌ی کارت متقاضی
   ============================================================ */
.match-overlay { z-index: 340; }
.match-modal { background: var(--surface); color: var(--text); width: 100%; max-width: 640px; max-height: 88vh; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; overflow: hidden; }
.mt-sub { padding: 9px 20px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.match-modal .modal-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mt-empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13.5px; }
.mt-row { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; transition: .15s; cursor: pointer; }
.mt-row:hover { border-color: var(--accent); transform: translateY(-1px); }
.mt-thumb { width: 62px; height: 62px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--surface); display: grid; place-items: center; }
.mt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mt-noimg { color: var(--muted); }
.mt-main { flex: 1; min-width: 0; }
.mt-title { font-weight: 800; font-size: 14px; }
.mt-code { font-size: 11px; color: var(--muted); font-weight: 600; margin-right: 6px; }
.mt-meta { font-size: 12.5px; color: var(--muted); margin: 3px 0 6px; }
.mt-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mt-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.mt-chip.ok { background: rgba(16,185,129,.14); color: #059669; }
.mt-chip.gap { background: var(--warn-bg); color: var(--warn-text); }
.mt-contact { margin-top: 7px; min-height: 1px; }
.mt-call { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.mt-owner { font-size: 12px; color: var(--muted); }
.mt-score { flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; line-height: 1; }
.mt-score b { font-size: 16px; font-weight: 800; }
.mt-score small { font-size: 9px; opacity: .9; }
.mt-score.high { background: #059669; }
.mt-score.mid { background: var(--accent); }
.mt-score.low { background: var(--warn); }
.ap-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.ap-match-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(37,99,235,.10); color: var(--accent); border: 1px solid rgba(37,99,235,.28); border-radius: 9px; padding: 8px 14px; font-family: 'Vazir'; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: .15s; }
.ap-match-btn:hover { background: var(--accent); color: #fff; }
.ap-match-btn.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.ap-match-btn.ghost:hover { background: var(--surface-2); color: var(--accent); border-color: var(--accent); }
.np-clickable { cursor: pointer; }
.np-clickable:hover { background: var(--surface-2); }

/* پرتال عمومی آژانس (کارت در پنل آژانس) */
.portal-card {
    display: flex; flex-direction: column;
    background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
    border: 1px solid rgba(37,99,235,.22); border-radius: 18px; padding: 20px 22px; margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.portal-head { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 16px; }
.portal-ico { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.3); }
.portal-ico .ic { width: 20px; height: 20px; }
.portal-head h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 3px; }
.portal-head p { color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.portal-actions { display: flex; gap: 9px; margin-top: auto; flex-wrap: wrap; }
.portal-actions .btn { flex: 1; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 14px; }
.portal-actions .btn .ic { width: 15px; height: 15px; }

/* ── پاپ‌آپِ اشتراک‌گذاری با QR ── */
.qr-overlay { z-index: 340; }
.qr-modal {
    position: relative; width: 100%; max-width: 380px; background: var(--surface); color: var(--text);
    border-radius: 22px; padding: 26px 22px 22px; box-shadow: 0 24px 70px rgba(0,0,0,.4); text-align: center;
}
.qr-modal h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.qr-modal .qr-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.qr-frame {
    width: 232px; height: 232px; margin: 0 auto 8px; padding: 16px; border-radius: 20px; background: #fff;
    box-shadow: 0 8px 24px rgba(37,99,235,.16); border: 1px solid var(--border);
}
.qr-frame svg { display: block; width: 100%; height: 100%; }
.qr-name { font-size: 14px; font-weight: 800; color: var(--accent); margin: 8px 0 16px; letter-spacing: .01em; }
.qr-link {
    display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 11px; padding: 9px 12px; margin-bottom: 14px;
}
.qr-link input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--muted); font-family: 'Vazir'; font-size: 12px; direction: ltr; text-align: left; }
.qr-link button { flex-shrink: 0; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 7px 12px; font-family: 'Vazir'; font-weight: 700; font-size: 12px; cursor: pointer; }
.qr-actions { display: flex; flex-direction: column; gap: 9px; }
.qr-actions .btn { justify-content: center; display: inline-flex; align-items: center; gap: 7px; padding: 12px; font-size: 14px; }
.qr-actions .btn .ic { width: 16px; height: 16px; }
.qr-msg { min-height: 16px; font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 4px; }

/* ============================================================
   دفترچه مخاطبین
   ============================================================ */
.contact-card { position: relative; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: .15s; }
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ct-kind { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.ct-kind.lg { width: 54px; height: 54px; }
.ct-kind.ct-owner { background: rgba(37,99,235,.12); color: var(--accent); }
.ct-kind.ct-buyer { background: rgba(5,150,105,.12); color: #059669; }
.ct-kind.ct-tenant { background: rgba(217,119,6,.14); color: #d97706; }
.ct-main { flex: 1; min-width: 0; }
.ct-name { font-weight: 800; font-size: 14.5px; }
.ct-kindlbl { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 20px; margin-inline-start: 4px; }
.ct-phone { font-size: 13px; color: var(--muted); direction: ltr; text-align: right; margin-top: 3px; }
.ct-rels { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ct-rel { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: rgba(37,99,235,.08); padding: 3px 9px; border-radius: 20px; }
.ct-edit { position: absolute; top: 12px; left: 12px; background: var(--surface-2); border: 1px solid var(--border); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.ct-edit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ct-overlay { z-index: 345; }
.ct-modal { background: var(--surface); color: var(--text); width: 100%; max-width: 520px; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; overflow: hidden; max-height: 88vh; }
.ct-modal.ct-prof { max-width: 560px; }
.ct-modal .modal-body { display: block; overflow-y: auto; }
.ct-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.ctp-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ctp-name { font-size: 17px; font-weight: 800; }
.ctp-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ctp-sub a { color: var(--accent); font-weight: 700; direction: ltr; text-decoration: none; }
.ctp-actions { margin-inline-start: auto; display: flex; gap: 6px; }
.ctp-actions .btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; font-size: 12.5px; }
.ctp-note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text); margin: 12px 0; line-height: 1.8; }
.ctp-sec { margin-top: 16px; }
.ctp-sec h4 { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.ctp-sec h4 span { background: var(--accent); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 20px; }
.ctp-list { display: flex; flex-direction: column; gap: 6px; }
.ctp-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; transition: .15s; }
.ctp-item:not(.static):hover { border-color: var(--accent); }
.ctp-item.static { cursor: default; }
.ctp-item b { font-size: 13.5px; display: block; }
.ctp-item small { font-size: 11.5px; color: var(--muted); }

/* گزینه‌ی «عمومی» فرمِ فایل + دکمه‌ی پرتال در جزئیات */
.share-mode-public { display: inline-flex; align-items: center; gap: 5px; }
.share-mode-public .ic { width: 14px; height: 14px; }
.share-public-hint { font-size: 11.5px; color: var(--muted); line-height: 1.75; margin-top: 9px; background: rgba(37,99,235,.06); border-radius: 9px; padding: 8px 11px; }
#dtPortalBtn.portal-on { background: rgba(5,150,105,.14); color: #059669; border-color: rgba(5,150,105,.4); }

/* ============================================================
   پیگیری‌ها و یادآورها
   ============================================================ */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 20px; font-size: 11px; font-weight: 800; }
.reminder-list { display: flex; flex-direction: column; gap: 10px; }
.rem-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.rem-card.overdue { border-inline-start-color: var(--danger); }
.rem-card.done { opacity: .62; border-inline-start-color: #059669; }
.rem-kind { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.rem-main { flex: 1; min-width: 0; }
.rem-title { font-weight: 800; font-size: 14px; }
.rem-kindlbl { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 20px; margin-inline-start: 6px; }
.rem-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.rem-badge { background: rgba(220,38,38,.14); color: var(--danger); font-weight: 800; font-size: 10.5px; padding: 2px 7px; border-radius: 20px; }
.rem-note { font-size: 12.5px; color: var(--text); margin-top: 6px; line-height: 1.7; }
.rem-entity { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; background: rgba(37,99,235,.10); color: var(--accent); border: 1px solid rgba(37,99,235,.24); border-radius: 8px; padding: 5px 10px; font-family: 'Vazir'; font-weight: 700; font-size: 12px; cursor: pointer; }
.rem-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.rem-act { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 10px; font-family: 'Vazir'; font-weight: 700; font-size: 12px; cursor: pointer; transition: .15s; white-space: nowrap; }
.rem-act:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.rem-act.ok:hover { background: #059669; color: #fff; border-color: #059669; }
.rem-act.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.rem-overlay { z-index: 350; }
.rem-modal { background: var(--surface); color: var(--text); width: 100%; max-width: 520px; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; overflow: hidden; }
.rem-modal .modal-body { display: block; }
.rem-frow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.rem-linkchip { display: inline-flex; align-items: center; gap: 6px; background: rgba(37,99,235,.10); color: var(--accent); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 12px; }

/* ============================================================
   وبلاگ (CMS داخلِ پنل) — مدیریت + ویرایشگر
   ============================================================ */
.blog-head-actions { display: flex; gap: 8px; }

/* آمار */
.blog-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.bstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.bs-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; }
.bstat-blue .bs-ico { background: rgba(37,99,235,.12); color: #2563eb; }
.bstat-teal .bs-ico { background: rgba(13,148,136,.12); color: #0d9488; }
.bstat-amber .bs-ico { background: var(--warn-bg); color: var(--warn); }
.bstat-violet .bs-ico { background: rgba(124,58,237,.12); color: #7c3aed; }
.bs-num { font-size: 24px; font-weight: 800; }
.bs-lbl { font-size: 12.5px; color: var(--muted); }

/* تب‌ها */
.blog-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.blog-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 18px; font-family: 'Vazir'; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.blog-tab:hover { color: var(--text); }
.blog-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge { background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; }

/* فهرستِ مطالب */
.blog-post-list { display: flex; flex-direction: column; gap: 10px; }
.bpl-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: .15s; }
.bpl-row:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.bpl-cover { width: 64px; height: 48px; border-radius: 8px; background: var(--surface-2) center/cover no-repeat; flex-shrink: 0; }
.bpl-ph { display: grid; place-items: center; color: #94a3b8; }
.bpl-main { flex: 1; min-width: 0; }
.bpl-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.bpl-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bpl-sub .ic { width: 1em; height: 1em; }
.bpl-pend { background: var(--warn-bg); color: var(--warn-text); padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.bstatus { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.bstatus-published { background: rgba(5,150,105,.14); color: #059669; }
.bstatus-draft { background: var(--surface-2); color: var(--muted); }
.bstatus-scheduled { background: var(--warn-bg); color: var(--warn-text); }
.bpl-actions { display: flex; gap: 4px; flex-shrink: 0; }
.bpl-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: .15s; }
.bpl-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.bpl-btn.danger:hover { background: var(--danger); border-color: var(--danger); }

/* دسته‌ها */
.bcat-add { display: flex; gap: 8px; margin-bottom: 16px; }
.bcat-add input { flex: 1; font-family: 'Vazir'; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.bcat-list { display: flex; flex-direction: column; gap: 8px; }
.bcat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.bcat-slug { color: var(--muted); font-size: 12px; margin-inline-start: 8px; direction: ltr; display: inline-block; }
.bcat-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.bcat-actions { display: flex; align-items: center; gap: 8px; }
.bcat-count { font-size: 12px; color: var(--muted); }

/* دیدگاه‌ها */
.bcm-filter { display: flex; gap: 6px; margin-bottom: 14px; }
.bcm-fbtn { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 16px; font-family: 'Vazir'; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.bcm-fbtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bcm-list { display: flex; flex-direction: column; gap: 10px; }
.bcm-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.bcm-head { display: flex; align-items: center; gap: 10px; }
.bcm-head b { font-size: 14px; }
.bcm-mail { font-size: 12px; color: var(--muted); direction: ltr; }
.bcm-date { font-size: 12px; color: var(--muted); margin-inline-start: auto; }
.bcm-on { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.bcm-on a { color: var(--accent); }
.bcm-body { font-size: 14px; margin: 8px 0 12px; line-height: 1.9; }
.bcm-actions { display: flex; gap: 8px; }
.btn.sm { padding: 6px 14px; font-size: 12.5px; }

/* خواننده (بدونِ دسترسی) */
.blog-reader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.blog-reader-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; display: flex; flex-direction: column; }
.blog-reader-card:hover { transform: translateY(-3px); }
.brc-img { aspect-ratio: 16/9; background: var(--surface-2) center/cover no-repeat; }
.brc-ph { display: grid; place-items: center; color: #94a3b8; font-size: 34px; }
.brc-tx { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.brc-cat { font-size: 11px; font-weight: 700; color: var(--accent); }
.brc-tx h3 { font-size: 16px; line-height: 1.6; }
.brc-tx p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.brc-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- ویرایشگر ---------- */
.blog-editor { display: flex; flex-direction: column; }
.be-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.be-top-actions { display: flex; gap: 8px; }
.be-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.be-main { min-width: 0; }
.be-title { width: 100%; font-family: 'Vazir'; font-weight: 800; font-size: 26px; border: 0; border-bottom: 2px solid var(--border); background: transparent; color: var(--text); padding: 8px 2px; outline: none; }
.be-title:focus { border-bottom-color: var(--accent); }
.be-slug { display: flex; align-items: center; gap: 8px; margin: 10px 0 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.be-slug code { background: var(--surface-2); padding: 3px 8px; border-radius: 6px; direction: ltr; color: var(--accent); }
.be-slug-edit { background: none; border: 0; color: var(--accent); cursor: pointer; font-family: 'Vazir'; font-size: 12px; }
.be-slug input { font-family: 'Vazir'; direction: ltr; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }

.be-toolbar { display: flex; flex-wrap: wrap; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px 10px 0 0; border-bottom: 0; padding: 7px; position: sticky; top: 0; z-index: 5; }
.tb-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--text); cursor: pointer; transition: .12s; }
.tb-btn:hover { background: var(--surface-2); color: var(--accent); }
.tb-btn.sm .ic { width: .95em; height: .95em; }
.tb-sep { width: 1px; background: var(--border); margin: 4px 4px; }
.be-editor { min-height: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 20px 22px; outline: none; font-size: 16px; line-height: 2; color: var(--text); }
.be-editor:focus { border-color: var(--accent); }
.be-editor h2 { font-size: 22px; margin: 22px 0 10px; color: var(--text); }
.be-editor h3 { font-size: 19px; margin: 18px 0 8px; }
.be-editor p { margin: 0 0 12px; }
.be-editor ul, .be-editor ol { padding-inline-start: 26px; margin: 0 0 12px; }
.be-editor blockquote { border-inline-start: 4px solid var(--accent); background: var(--surface-2); padding: 10px 16px; margin: 14px 0; border-radius: 0 10px 10px 0; }
.be-editor pre { background: #0f1b2d; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; direction: ltr; text-align: left; font-size: 14px; }
.be-editor img { max-width: 100%; border-radius: 10px; }
.be-editor figure { margin: 16px 0; }
.be-editor a { color: var(--accent); }
.be-editor:empty::before, .be-editor p:only-child:empty::before { content: 'متن مطلب را اینجا بنویسید...'; color: var(--muted); }
.be-count { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: left; direction: ltr; }

/* ستونِ کناری */
.be-side { display: flex; flex-direction: column; gap: 14px; }
.be-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; }
.be-card h4 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.be-card h4 .ic { color: var(--accent); }
.be-field { display: block; margin-bottom: 12px; }
.be-field:last-child { margin-bottom: 0; }
.be-field > span { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.be-field > span em { font-style: normal; direction: ltr; }
.be-field > span em.over { color: var(--danger); }
.be-field input, .be-field textarea, .be-field select { width: 100%; font-family: 'Vazir'; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); resize: vertical; }
.be-field input:focus, .be-field textarea:focus, .be-field select:focus { outline: 0; border-color: var(--accent); background: var(--surface); }
.be-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 10px; cursor: pointer; }
.be-sched { padding: 10px; background: var(--surface-2); border-radius: 9px; margin-bottom: 10px; }
.be-card textarea { width: 100%; font-family: 'Vazir'; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); resize: vertical; }

/* کاور */
.be-cover { position: relative; border: 2px dashed var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.be-cover.has { border-style: solid; }
.be-cover img { width: 100%; display: block; }
.be-cover-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; color: var(--muted); cursor: pointer; font-size: 13px; }
.be-cover-drop .ic { width: 26px; height: 26px; }
.be-cover-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }

/* برچسب‌ها */
.be-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); padding: 7px; }
.be-tags input { flex: 1; min-width: 90px; border: 0; background: transparent; outline: 0; font-family: 'Vazir'; font-size: 13px; color: var(--text); padding: 3px; }
.be-tag { display: inline-flex; align-items: center; gap: 5px; background: rgba(37,99,235,.12); color: var(--accent); border-radius: 7px; padding: 3px 9px; font-size: 12.5px; font-weight: 700; }
.be-tag b { cursor: pointer; opacity: .7; }
.be-tag b:hover { opacity: 1; }

/* سئو‌پرِویو (SERP) */
.be-seo .serp-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; margin-bottom: 14px; }
.serp-title { color: #1a0dab; font-size: 15px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.serp-url { color: #006621; font-size: 12px; direction: ltr; margin: 2px 0; }
.serp-desc { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
[data-theme="dark"] .serp-title { color: #8ab4f8; }
[data-theme="dark"] .serp-url { color: #6ee7a8; }

.be-msg { margin-top: 14px; font-size: 13.5px; font-weight: 700; text-align: center; min-height: 20px; }
.be-msg.ok { color: #059669; }
.be-msg.err { color: var(--danger); }

/* پیش‌نمایش */
.blog-preview-modal { position: relative; background: var(--surface); width: 100%; max-width: 800px; max-height: 90vh; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.bp-scroll { overflow-y: auto; padding: 40px; }
.blog-preview-modal .modal-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3; }
.blog-preview-modal .post-article { max-width: 680px; margin: 0 auto; }
.blog-preview-modal .post-title { font-size: 30px; font-weight: 800; line-height: 1.5; margin-bottom: 20px; color: var(--text); }
.blog-preview-modal .post-body { font-size: 16px; line-height: 2.1; }
.blog-preview-modal .post-body h2 { font-size: 23px; margin: 26px 0 12px; }
.blog-preview-modal .post-body h3 { font-size: 20px; margin: 22px 0 10px; }
.blog-preview-modal .post-body p { margin-bottom: 14px; }
.blog-preview-modal .post-body ul, .blog-preview-modal .post-body ol { padding-inline-start: 26px; margin-bottom: 14px; }
.blog-preview-modal .post-body img { max-width: 100%; border-radius: 12px; margin: 18px 0; }
.blog-preview-modal .post-body blockquote { border-inline-start: 4px solid var(--accent); background: var(--surface-2); padding: 12px 18px; border-radius: 0 12px 12px 0; margin: 16px 0; }
.blog-preview-modal .post-body pre { background: #0f1b2d; color: #e2e8f0; padding: 16px; border-radius: 12px; overflow-x: auto; direction: ltr; text-align: left; }

@media (max-width: 900px) {
    .be-grid { grid-template-columns: 1fr; }
    .blog-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   وبلاگ — ویرایشگرِ کامل، دیالوگ‌ها، توست، تنظیمات، پروفایل
   ============================================================ */

/* ---------- توست ---------- */
.blog-toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.blog-toast { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid #059669; color: var(--text); padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 26px rgba(0,0,0,.18); font-size: 13.5px; font-weight: 600; animation: bt-in .22s ease; }
.blog-toast.err { border-inline-start-color: var(--danger); }
.blog-toast .ic { color: #059669; }
.blog-toast.err .ic { color: var(--danger); }
.blog-toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes bt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- دیالوگ (تأیید/فرم) ---------- */
.blog-dlg-ov { z-index: 800; }
.blog-dlg { background: var(--surface); color: var(--text); width: 100%; max-width: 460px; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); overflow: hidden; }
.blog-dlg-body { padding: 18px 20px; max-height: 60vh; overflow-y: auto; }
.blog-confirm { text-align: center; padding: 26px 24px 20px; max-width: 400px; }
.bc-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: rgba(37,99,235,.12); color: var(--accent); }
.bc-ico .ic { width: 26px; height: 26px; }
.bc-ico.danger { background: rgba(220,38,38,.12); color: var(--danger); }
.blog-confirm h3 { font-size: 17px; margin-bottom: 6px; }
.blog-confirm p { font-size: 14px; color: var(--muted); line-height: 1.8; }
.bc-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.blog-confirm .bc-actions { justify-content: center; margin-top: 18px; border-radius: 0; }
.be-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 400; }

/* ---------- نوارِ ابزارِ ویرایشگر ---------- */
.be-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px 10px 0 0; border-bottom: 0; padding: 6px; position: sticky; top: 0; z-index: 5; }
.tb-btn.active { background: var(--accent); color: #fff; }
.tb-btn.off { opacity: .35; pointer-events: none; }
.tb-btn:disabled { opacity: .35; }
.tb-select { font-family: 'Vazir'; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 7px; padding: 6px 8px; cursor: pointer; }
.tb-color { position: relative; overflow: hidden; }
.tb-color input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* منبعِ HTML */
.be-source { width: 100%; min-height: 340px; background: #0f1b2d; color: #cfe3ff; border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7; resize: vertical; outline: none; }
.be-editor.drag { border-color: var(--accent); background: rgba(37,99,235,.05); box-shadow: inset 0 0 0 2px rgba(37,99,235,.25); }
.be-editor table, .blog-preview-modal .post-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.be-editor td, .be-editor th, .blog-preview-modal .post-body td, .blog-preview-modal .post-body th { border: 1px solid var(--border); padding: 8px 10px; text-align: right; }
.be-editor th, .blog-preview-modal .post-body th { background: var(--surface-2); font-weight: 700; }
.be-editor figcaption { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.be-editor mark { background: #fff3a3; color: #1e293b; }

/* تمام‌صفحه */
body.blog-fs { overflow: hidden; }
.blog-editor.fs { position: fixed; inset: 0; z-index: 700; background: var(--bg); padding: 16px; overflow-y: auto; }
.blog-editor.fs .be-grid { max-width: 1400px; margin: 0 auto; }

/* ---------- راهنمای سئو ---------- */
.seo-checks { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.seo-chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.seo-chk .ic { width: 1em; height: 1em; flex-shrink: 0; }
.seo-chk.ok { color: #059669; }
.seo-chk.no { color: var(--warn-text); }

/* ---------- تنظیمات ---------- */
.bset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.bset-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.bset-img { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.bset-img img { height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.bset-img .btn { cursor: pointer; }
.be-field textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- پروفایل نویسنده ---------- */
.bprof-head { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; }
.bprof-head b { font-size: 14px; }
.bprof-head span { font-size: 12px; color: var(--muted); }

/* ---------- منو ---------- */
.bmenu-type { font-size: 11px; font-weight: 700; background: rgba(37,99,235,.12); color: var(--accent); border-radius: 6px; padding: 2px 8px; margin-inline-start: 8px; }

/* ---------- دسته: ردیفِ کشویی + دکمه‌ی ساختِ سریع ---------- */
.be-catrow { display: flex; gap: 6px; }
.be-catrow select { flex: 1; min-width: 0; }
.be-catnew { flex-shrink: 0; background: rgba(37,99,235,.10); color: var(--accent); border: 1px solid rgba(37,99,235,.28); border-radius: 9px; padding: 0 12px; font-family: 'Vazir'; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: .15s; white-space: nowrap; }
.be-catnew:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- حالتِ خالیِ دسته‌ها ---------- */
.bcat-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; }
.bcat-empty .ic { width: 40px; height: 40px; color: #94a3b8; }
.bcat-empty b { font-size: 15px; color: var(--text); }
.bcat-empty span { font-size: 13px; color: var(--muted); line-height: 1.9; }

@media (max-width: 700px) {
    .be-toolbar { gap: 1px; }
    .tb-btn { width: 30px; height: 30px; }
    .blog-toasts { inset-inline: 12px; }
}
.rem-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 14px; font-size: 12px; color: var(--muted); }
.rem-quick button { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 20px; padding: 5px 12px; font-family: 'Vazir'; font-size: 12px; cursor: pointer; }
.rem-quick button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.rem-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 600px) { .rem-frow { grid-template-columns: 1fr; } .rem-actions { flex-direction: row; } }
.dt-note-msg { font-size: 12.5px; color: var(--accent); font-weight: 600; }

/* ============================================================
   بازطراحی پنل کاربر + پاپ‌آپ جزئیات فایل — هماهنگ با سبک مدرن
   ============================================================ */
/* --- پنل کاربر --- */
.profile-card { border-radius: 20px; padding: 30px; box-shadow: var(--shadow); }
.profile-photo-name { font-size: 20px; }
.profile-photo-role { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; font-weight: 800; box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.avatar-img { border: 5px solid var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,.5), 0 18px 40px rgba(37,99,235,.2); }
.avatar-wrap .avatar.xl { box-shadow: 0 0 0 3px rgba(37,99,235,.5), 0 18px 40px rgba(37,99,235,.2); }
.avatar-edit { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 8px 18px rgba(37,99,235,.35); transition: transform .15s, filter .2s; }
.avatar-edit:hover { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); filter: brightness(1.06); transform: translateY(-1px); }
#view-profile .profile-side { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; }
#view-profile .profile-side h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }

/* --- پاپ‌آپ جزئیات فایل --- */
/* گِردی/سایه فقط در حالتِ پاپ‌آپ (≥900px) معنا دارد و همان‌جا تعریف شده؛
   در موبایل صفحه تمام‌بلید است. .dt-x حذف شد (دکمه‌ی بسته‌ی قدیمی، دیگر در HTML نیست). */
.detail-topnav { padding: 14px 18px; }
.dt-nav { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border); border-radius: 10px; transition: .15s; }
.dt-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: rgba(37,99,235,.06); }
.dt-deal { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.dt-main { border-radius: 14px; }
.dt-thumb { border-radius: 10px; border-width: 2px; }
.dt-thumb.active { border-color: var(--accent); }
.dt-owner, .dt-price { border-radius: 14px; }
.dt-notes textarea { border-radius: 12px; border-width: 1.5px; transition: border-color .18s, box-shadow .18s; }
.dt-notes textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.13); }

/* ============================================================
   بازطراحی ویزارد ثبت فایل + متقاضی — هماهنگ با سبک مدرن
   (کلاس‌های wz-*/lf-*/chip مشترک‌اند؛ هر دو ویزارد با هم به‌روز می‌شوند)
   ============================================================ */
/* استپر شماره‌دار: مرحله جاری گرادیانی و برجسته، مراحل انجام‌شده تینت، خطوط اتصال پرشونده */
.wz-progress { padding: 8px 2px 18px; gap: 4px; }
.wz-progress::-webkit-scrollbar { height: 0; }
.wz-n { width: 30px; height: 30px; border-width: 1.5px; font-size: 12.5px; transition: .25s; }
.wz-dot:not(:last-child)::after { width: 22px; transition: background .25s; }
.wz-dot.done:not(:last-child)::after { background: var(--accent); }
.wz-dot.done .wz-n { background: rgba(37,99,235,.14); color: var(--accent); border-color: rgba(37,99,235,.4); }
.wz-dot.active .wz-n { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(37,99,235,.42); transform: scale(1.12); }

/* کارت هر مرحله + انیمیشن ورود نرم */
.lf-group { border-radius: 16px; }
.lf-group-title { font-size: 15px; font-weight: 800; color: var(--text); background: linear-gradient(90deg, rgba(37,99,235,.10), rgba(37,99,235,.02)); border-right-color: var(--accent); padding: 14px 18px; }
.wz-step:not(.wz-hidden) { animation: wzIn .35s ease; }
@keyframes wzIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* فیلدها: حلقه فوکوس هماهنگ */
.lf-field input:focus, .lf-field select:focus, .lf-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.13); }

/* چیپ‌های انتخاب نوع معامله/ملک → پیل گرادیانی */
.chip { border-width: 1.5px; padding: 10px 22px; font-weight: 600; transition: .18s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(37,99,235,.3); }
.chip.active:hover { color: #fff; }

/* چیپ‌های چندانتخابی (managed-multi) */
.mm-chip:hover { border-color: var(--accent); }
.mm-chip.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; }

/* کلید روشن/خاموش → گرادیانی */
.switch input:checked + .slider { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }

/* حالت انتخاب‌شده کارت‌های اشتراک‌گذاری */
.share-mode { border-width: 1.5px; border-radius: 12px; transition: .15s; }
.share-mode:hover { border-color: var(--accent); }
.share-mode:has(input:checked) { border-color: var(--accent); background: rgba(37,99,235,.08); color: var(--accent); font-weight: 700; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* آپلود و پیش‌نمایش رسانه */
.upload-drop { border-radius: 14px; border-width: 2px; }
.mp-item { border-radius: 12px; }

/* نوار ثابت دکمه‌های پایین */
.wz-foot { border-radius: 14px; }

@media (prefers-reduced-motion: reduce) { .wz-step:not(.wz-hidden) { animation: none; } }
.ld-del-btn { background: rgba(231,76,60,.12); color: var(--danger); }
.ld-del-btn:hover { background: rgba(231,76,60,.2); }

/* ============================================================
   زونکن (پوشه‌ها)
   ============================================================ */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.folder-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px 18px; text-align: center; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.folder-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(20,35,60,.13); }
.folder-card.fixed { border-style: dashed; border-color: var(--accent); background: rgba(37,99,235,.05); }
.fk-ico { font-size: 42px; line-height: 1; margin-bottom: 10px; }
.fk-name { font-weight: 800; font-size: 15px; color: var(--text); }
.fk-count { font-size: 12px; color: var(--muted); margin-top: 5px; }
.fk-menu-wrap { position: absolute; top: 8px; right: 10px; }
.fk-kebab { background: transparent; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 2px 7px; border-radius: 6px; line-height: 1; }
.fk-kebab:hover { background: var(--surface-2); color: var(--text); }
.fk-menu { position: absolute; top: 28px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,35,60,.16); min-width: 140px; padding: 6px; display: none; z-index: 20; text-align: right; }
.fk-menu.open { display: block; }
.fk-menu a { display: block; padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text); }
.fk-menu a:hover { background: var(--surface-2); }
.fk-menu a.danger { color: var(--danger); }
.zk-crumb { display: flex; align-items: center; gap: 7px; font-size: 15px; flex-wrap: wrap; }
.zk-crumb a { cursor: pointer; color: var(--accent); font-weight: 700; }
.zk-crumb a:hover { text-decoration: underline; }
.zk-crumb .cur { font-weight: 800; color: var(--text); }
.zk-crumb .sep { color: var(--muted); }

/* ============================================================
   ویزارد ثبت فایل/متقاضی (مرحله‌به‌مرحله)
   ============================================================ */
.wz-progress { display: flex; gap: 2px; overflow-x: auto; padding: 6px 2px 16px; margin-bottom: 4px; }
.wz-dot { display: flex; align-items: center; gap: 6px; flex-shrink: 0; cursor: pointer; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.wz-dot:not(:last-child)::after { content: ''; width: 16px; height: 2px; background: var(--border); margin: 0 6px; flex-shrink: 0; }
.wz-n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.wz-dot.active { color: var(--text); font-weight: 700; }
.wz-dot.active .wz-n, .wz-dot.done .wz-n { background: var(--accent); color: #fff; border-color: var(--accent); }
.wz-dot.done .wz-t { color: var(--accent); }
.wz-hidden { display: none !important; }
.lf-group.wz-step { min-height: 180px; }
#lfTypeStep .lf-choose-block { padding: 4px 18px 10px; }
#lfTypeStep h4 { font-size: 13.5px; margin: 8px 0; color: var(--muted); font-weight: 700; }
.media-split { display: flex; gap: 14px; padding: 4px 18px 0; }
.media-col { flex: 1; }
.upload-drop.sm { padding: 20px 14px; }
@media (max-width: 560px) { .media-split { flex-direction: column; } }
/* فرم‌های ویزارد کلِ ارتفاع را پر می‌کنند تا نوارِ دکمه‌ها حتی با فیلدهای کم هم پایینِ صفحه بماند */
#view-listing-form.active, #view-applicant-form.active { display: flex; flex-direction: column; min-height: 100%; }
#lfForm, #afForm { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* نوارِ ثابتِ دکمه‌های مرحله در پایین صفحه — همیشه در دسترس بدونِ نیاز به اسکرول */
.wz-foot { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
    margin: auto 0 0; padding: 10px 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 18px rgba(20,35,60,.12); }
[data-theme="dark"] .wz-foot { box-shadow: 0 -4px 18px rgba(0,0,0,.4); }
.wz-foot .btn { padding-top: 9px; padding-bottom: 9px; }
.wz-foot .save-indicator { flex: 1; text-align: center; }
.wz-foot #lfNext, .wz-foot #afNext { min-width: 130px; }
@media (max-width: 640px) {
    .dt-top { grid-template-columns: 1fr; }
    .dt-specs { grid-template-columns: 1fr; }
    .detail-topnav { padding: 12px 14px; }
    .dt-deal { font-size: 12.5px; }
}

/* ============================================================
   فاز ۰ — محاسبه‌ی کمیسیون / فاکتور / بندسازِ حقوقی
   ============================================================ */

/* زیرعنوانِ سرصفحه‌ی این سه نما */
.svc-sub { font-size: 13px; color: var(--muted); margin-top: 5px; max-width: 640px; line-height: 1.85; }
.svc-head-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- تب‌های نوعِ معامله/حالت ---------- */
.cm-tabs { display: inline-flex; gap: 4px; background: var(--soft, rgba(37,99,235,.07)); border-radius: 11px; padding: 4px; margin-bottom: 16px; }
.cm-tab {
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    font-family: 'Vazir'; font-weight: 700; font-size: 13px; padding: 8px 18px; border-radius: 8px; transition: .15s;
}
.cm-tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 8px rgba(20,35,60,.1); }
.cm-tabs.sm .cm-tab { padding: 6px 13px; font-size: 12.5px; }

/* ---------- چیدمانِ محاسبه‌گر ---------- */
.cm-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 18px; align-items: start; }
.cm-form, .cm-result {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px;
}
.cm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cm-form .lf-field { margin-bottom: 14px; }
.cm-words { font-size: 11.5px; color: var(--accent); font-weight: 600; min-height: 15px; }
.cm-actions { display: flex; gap: 10px; margin-top: 18px; }
.cm-manual-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; margin: 6px 0 12px; }
.cm-manual-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- هشدارِ نرخ ---------- */
.cm-notice { font-size: 12.5px; line-height: 1.8; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; border: 1px solid; }
.cm-notice { background: rgba(37,99,235,.07); border-color: rgba(37,99,235,.25); color: var(--text); }
.cm-notice.ok { background: rgba(43,182,115,.09); border-color: rgba(43,182,115,.3); }
.cm-notice.warn { background: rgba(201,138,0,.1); border-color: rgba(201,138,0,.35); }

/* ---------- نتیجه ---------- */
.cm-res-head { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 14px; }
.cm-res-src { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(37,99,235,.1); border-radius: 6px; padding: 2px 9px; }
.cm-res-head h3 { font-size: 16px; margin: 8px 0 4px; font-weight: 700; }
.cm-res-head h3 b { color: var(--accent); font-size: 20px; }
.cm-res-base { font-size: 12px; color: var(--muted); }
.cm-tier-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }
.cm-tier-table th, .cm-tier-table td { border-bottom: 1px solid var(--border); padding: 7px 6px; text-align: right; }
.cm-tier-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.cm-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cm-side { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.cm-side-head { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cm-side-head span { font-size: 11px; color: var(--muted); font-weight: 600; }
.cm-side-li { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; color: var(--muted); }
.cm-side-li b { color: var(--text); }
.cm-side-li.total { border-top: 1px dashed var(--border); margin-top: 5px; padding-top: 7px; color: var(--text); font-weight: 700; }
.cm-side-li.total b { color: var(--accent); }
.cm-grand { margin-top: 14px; padding: 11px 13px; border-radius: 10px; background: rgba(37,99,235,.08); font-size: 13px; font-weight: 600; }
.cm-grand b { color: var(--accent); font-size: 15px; }
.cm-hint { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.cm-res-actions { margin-top: 14px; }

/* ---------- فاکتور: فهرست ---------- */
.inv-list { display: flex; flex-direction: column; gap: 10px; }
.inv-row {
    display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 14px; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 13px 16px;
}
.inv-c-num { display: flex; flex-direction: column; }
.inv-c-num b { font-size: 14px; color: var(--accent); }
.inv-c-num small, .inv-c-amt small { font-size: 10.5px; color: var(--muted); }
.inv-r-who { font-weight: 700; font-size: 13.5px; }
.inv-r-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.inv-c-amt { text-align: left; }
.inv-c-amt b { font-size: 14px; }
.inv-c-date { font-size: 12px; color: var(--muted); }
.inv-c-act { display: flex; gap: 6px; }
/* دکمه‌های نوارِ فاکتور فقط رنگ داشتند و پایه‌ی استایل (padding/گوشه/فونت/آیکون)
   نمی‌گرفتند، چون آن پایه به `.cr-actions button` محدود بود. مثلِ آرشیوِ الحاقیه اینجا
   کلِ دکمه‌های نوار استایلِ پایه می‌گیرند. */
.inv-c-act button {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: none;
    padding: 8px 13px; border-radius: 7px; cursor: pointer; font-family: 'Vazir';
    font-weight: 600; font-size: 12.5px; transition: .2s; white-space: nowrap;
}
.inv-c-act .ld-del-btn { padding: 8px 10px; }
.inv-c-act .ic { width: 14px; height: 14px; }
.inv-c-act button:hover { transform: translateY(-1px); }

/* ---------- فاکتور: مودال ---------- */
.modal-lg { max-width: 920px; }
.inv-mode-hint { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.8; }
.inv-sec-title { font-size: 13.5px; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.inv-party-row {
    display: grid; grid-template-columns: 110px 1.4fr 1fr 1fr 1.1fr auto; gap: 10px; align-items: end;
    border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.inv-party-row .lf-field { gap: 5px; }
.ip-calc { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 11.5px; margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border); }
.ip-calc-li { display: flex; gap: 6px; color: var(--muted); padding: 1px 0; }
.ip-calc-li b { color: var(--text); }
.ip-calc-li.total b { color: var(--accent); }
.ip-calc-empty { color: var(--muted); }
.ip-del { padding: 8px 10px; }
.inv-add-party { margin-bottom: 12px; }
.inv-total { margin-top: 12px; padding: 11px 13px; border-radius: 10px; background: rgba(37,99,235,.08); font-size: 13px; min-height: 20px; }
.inv-total b { color: var(--accent); font-size: 15px; }
.inv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.inv-foot .um-msg { margin: 0; font-size: 12.5px; font-weight: 700; }
.inv-foot .um-msg.ok { color: #2bb673; }
.inv-foot .um-msg.err { color: #d64535; }

/* ---------- بندسازِ حقوقی ---------- */
.cl-wrap { max-width: 860px; }
.cl-input-box, .cl-out-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.cl-input {
    width: 100%; min-height: 140px; resize: vertical; border: 1.5px solid var(--border); border-radius: 11px;
    padding: 13px 14px; font-family: 'Vazir'; font-size: 14px; line-height: 1.9;
    background: var(--bg, transparent); color: var(--text);
}
.cl-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.13); }
.cl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.cl-count { font-size: 12px; color: var(--muted); }
.cl-foot-btns { display: flex; gap: 8px; }
.cl-out-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cl-out-head h4 { font-size: 13.5px; }
.cl-out {
    font-size: 14px; line-height: 2.1; text-align: justify; white-space: pre-wrap;
    background: rgba(37,99,235,.05); border: 1px solid rgba(37,99,235,.18); border-radius: 11px; padding: 14px 16px;
}
.cl-history { display: flex; flex-direction: column; gap: 8px; }
.cl-hist-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px;
    font-size: 12.5px; color: var(--muted); cursor: pointer; transition: .15s;
}
.cl-hist-item:hover { border-color: var(--accent); color: var(--text); }
.cl-hist-q { font-weight: 700; color: var(--text); margin-bottom: 3px; }

@media (max-width: 900px) {
    .cm-grid { grid-template-columns: 1fr; }
    .inv-party-row { grid-template-columns: 1fr 1fr; }
    .ip-calc { grid-column: 1 / -1; }
    .inv-row { grid-template-columns: 1fr auto; gap: 8px; }
    .inv-c-num, .inv-c-date { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .cm-sides { grid-template-columns: 1fr; }
    .cm-actions { flex-direction: column; }
    .cm-actions .btn { width: 100%; }
}

/* ============================================================
   پاپ‌آپ متنِ آگهیِ حرفه‌ای (#۳۱)
   z-index بالاتر از detail-page چون روی آن باز می‌شود.
   ============================================================ */
.ad-overlay {
    display: none; position: fixed; inset: 0; z-index: 420;
    background: rgba(8, 16, 28, .62); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; padding: 20px;
}
.ad-overlay.open { display: flex; animation: adFade .18s ease; }
@keyframes adFade { from { opacity: 0; } to { opacity: 1; } }

.ad-modal {
    background: var(--surface); color: var(--text);
    width: 100%; max-width: 680px; max-height: 88vh;
    border-radius: 16px; border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    display: flex; flex-direction: column; overflow: hidden;
    animation: adRise .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes adRise { from { transform: translateY(14px) scale(.985); } to { transform: none; } }

.ad-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; background: var(--brand); color: var(--on-brand); flex-shrink: 0;
}
.ad-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 0; }
.ad-head .ic { width: 18px; height: 18px; }
.ad-close {
    background: rgba(255, 255, 255, .1); border: none; color: var(--on-brand);
    width: 30px; height: 30px; border-radius: 8px; font-size: 15px; cursor: pointer;
    line-height: 1; transition: .2s; flex-shrink: 0;
}
.ad-close:hover { background: rgba(255, 255, 255, .22); }

.ad-body { padding: 18px; overflow-y: auto; flex: 1; background: var(--surface-2); }

/* متنِ آگهی: pre برای حفظِ خط‌بندی مدل، ولی با فونت و کشش فارسی */
.ad-text {
    font-family: 'Vazir', sans-serif; font-size: 14px; line-height: 2.15;
    white-space: pre-wrap; word-break: break-word; direction: rtl; text-align: right;
    margin: 0; padding: 20px 22px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.ad-placeholder { text-align: center; padding: 42px 20px; color: var(--muted); }
.ad-placeholder .ic { width: 34px; height: 34px; color: var(--accent); opacity: .8; }
.ad-placeholder p { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 12px 0 8px; }
.ad-placeholder small { font-size: 12.5px; line-height: 1.9; }

.ad-foot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 18px; border-top: 1px solid var(--border);
    background: var(--surface); flex-shrink: 0;
}
.ad-msg { flex: 1; min-width: 140px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ad-foot-btns { display: flex; gap: 8px; }
.ad-foot .btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 600px) {
    .ad-overlay { padding: 0; }
    .ad-modal { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; border: none; }
    .ad-body { padding: 12px; }
    .ad-text { padding: 16px; font-size: 13.5px; }
    .ad-foot-btns { width: 100%; }
    .ad-foot-btns .btn { flex: 1; justify-content: center; }
}

/* ============================================================
   مراحلِ قرارداد در موبایل (استپر + فرم + نوارِ دکمه‌ها)
   ------------------------------------------------------------
   چیدمانِ دسکتاپ: [هدر] [محتوا] [دکمه‌ها] و استپر زیرِ باکس.
   در موبایل: استپر می‌رود بالا (چسبان)، دکمه‌ها می‌شوند نوارِ
   پایینِ تمام‌عرض، و فیلدها تک‌ستونی می‌شوند.
   ============================================================ */
@media (max-width: 860px) {
    /* فرم تمام‌قدِ صفحه باشد تا نوارِ دکمه‌ها همیشه پایین بچسبد */
    .main:has(#view-form.active) { padding: 12px; }
    #view-form.active { height: 100%; }
    .form-container { margin-bottom: 0; border-radius: 14px; }

    /* استپر → بالای فرم، چسبان و قابلِ اسکرولِ افقی */
    .progress-container {
        order: -1; margin-bottom: 10px;
        padding: 9px 12px; gap: 10px; border-radius: 12px;
        scroll-padding-inline: 40px;
    }
    .progress-label {
        font-size: 12px; position: sticky; inset-inline-start: 0;
        background: var(--surface); padding-inline-end: 8px; z-index: 1;
    }
    .progress-track { gap: 7px; }
    .progress-step { width: 26px; height: 26px; font-size: 11.5px; }
    .progress-step.current { transform: scale(1.1); }

    /* هدرِ فرم: عنوان کوتاه‌شونده، دکمه و کد جمع‌وجور */
    .form-header { padding: 10px 12px; gap: 9px; }
    .form-header h2 {
        font-size: 14px; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .form-back-btn { padding: 8px 11px; font-size: 12.5px; }
    .form-code { font-size: 11px; }

    .form-content-wrapper { padding: 12px; }
    .seller-box, .witness-box, .payment-box { padding: 12px; margin-bottom: 12px; }
    .payment-fields { padding: 12px; margin-top: 12px; }
    .seller-header { padding: 9px 12px; margin-bottom: 12px; font-size: 13.5px; }
    .seller-header button { min-height: 34px; padding: 6px 12px; }

    /* ── نوارِ دکمه‌ها: سه ردیفِ تمام‌عرض ── */
    .form-actions {
        flex-wrap: wrap; gap: 8px; padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 18px rgba(15, 23, 42, .07);
    }
    .add-seller-btn {
        order: 1; flex: 1 1 100%; margin: 0;
        justify-content: center; min-height: 46px; font-size: 14px;
    }
    .save-indicator {
        order: 2; flex: 1 1 100%; min-width: 0;
        text-align: center; font-size: 12px;
    }
    .save-indicator:empty { display: none; }
    .nav-buttons { order: 3; flex: 1 1 100%; margin: 0; gap: 8px; }
    .nav-buttons .btn {
        min-height: 48px; padding: 11px 12px; font-size: 14.5px;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    }
    #continueBtn { flex: 2 1 0; }
    #backBtn { flex: 1 1 0; }
    #previewBtn { flex: 1 1 0; }

    /* بندها: دکمه‌ها تمام‌عرض و قابلِ لمس */
    .clause-actions { gap: 8px; }
    .clause-btn { flex: 1; justify-content: center; min-height: 42px; font-size: 13px; }
    .clause-remove-link { top: 4px; left: 6px; padding: 6px 8px; }
    .add-box { min-height: 52px; }
}

@media (max-width: 600px) {
    /* فیلدها تک‌ستونی + جلوگیری از زومِ خودکارِ iOS (فونت ≥ ۱۶px) */
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .form-group.col-4 { grid-column: 1 / -1; }
    .form-group input, .form-group select { font-size: 16px; padding: 11px 12px; }
    .form-group label { font-size: 13px; }

    /* ورودی‌های درون‌متنی: عرضِ ثابت نداشته باشند تا سرریز نکنند */
    .inline-text { font-size: 14px; line-height: 2.6; }
    .inline-input { font-size: 16px; padding: 5px 6px; max-width: 100%; }
    .inline-input.small { width: 78px; }
    .inline-input.medium { width: 120px; }
    .inline-input.large, .inline-input.xlarge { width: 100%; }

    .clause-text { font-size: 14px; }
}

@media (max-width: 430px) {
    /* در صفحه‌های خیلی باریک، «پیش‌نمایش» فقط آیکون شود */
    #previewBtn { flex: 0 0 52px; padding: 11px 0; }
    #previewBtn .btn-lbl { display: none; }
}

/* ============================================================
   بهینه‌سازیِ نمایش در ابعادِ دسکتاپ
   ------------------------------------------------------------
   مشکل‌هایی که حل می‌شود:
   ۱) صفحه‌ی فایل تک‌ستونی بود → گالری تمام‌عرض و کشیده، بقیه‌ی
      اطلاعات زیرِ آن ⇒ اسکرولِ زیاد. حالا دوستونی می‌شود.
   ۲) عرضِ محدودِ ۱۲۸۰px روی مانیتورهای بزرگ ⇒ کناره‌های خالی.
   ============================================================ */
/* ---------- موبایل: صفحه‌ی اختصاصیِ تمام‌صفحه (حالتِ پایه) ---------- */
/* مرزِ ۸۹۹.۹۸ (نه ۸۹۹) تا در عرض‌های اعشاری — بزرگ‌نماییِ مرورگر — هیچ بازه‌ای بی‌قانون نماند */
@media (max-width: 899.98px) {
    .dt-lbl-close, .dt-ic-close { display: none; }
    /* صفحه‌ی اختصاصی: تمام‌بلید، بدون گِردی و سایه‌ی کارتی */
    .detail-modal { border-radius: 0; box-shadow: none; border: none; }
    /* تک‌ستونی: جلوگیری از قدکشیدنِ بیش از حدِ کادرِ تصویر (aspect-ratio روی عرضِ زیاد) */
    .dt-main, .dt-noimg { max-height: 460px; }
}

/* ---------- لپ‌تاپ و مانیتور: همان محتوا، ولی به شکلِ پاپ‌آپ ---------- */
@media (min-width: 900px) {
    .dt-lbl-back, .dt-ic-back { display: none; }

    /* پس‌زمینه‌ی تیره‌ی پاپ‌آپ؛ اسکرولِ صفحه‌ای حذف و به داخلِ کارت منتقل می‌شود */
    .detail-page.open {
        display: flex; align-items: center; justify-content: center;
        padding: 26px; overflow: hidden;
        background: rgba(8, 16, 28, .62);
        backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
        animation: dtFade .16s ease;
    }
    .detail-modal {
        max-width: 1240px; min-height: 0; max-height: 100%;
        border-radius: 20px; overflow: hidden;
        border: 1px solid var(--border);
        box-shadow: 0 30px 80px rgba(9, 20, 42, .5);
        animation: dtRise .22s cubic-bezier(.2, .8, .3, 1);
    }
    /* سربرگ و پابرگ ثابت؛ فقط بدنه اسکرول می‌شود */
    .detail-topnav, .detail-foot { position: static; flex-shrink: 0; }
    .detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; gap: 18px; }
    .dt-notes { flex-shrink: 0; max-height: 40vh; overflow-y: auto; }

    /* گالری کنارِ اطلاعات، نه بالای آن (چسبان نسبت به بدنه‌ی اسکرول‌شونده) */
    .dt-top {
        display: grid; gap: 22px; align-items: start;
        grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    }
    .dt-gallery { position: sticky; top: 0; margin-bottom: 0; }
    .dt-thumb { width: 62px; height: 62px; }
    .dt-info > .fd-card:last-child { margin-bottom: 0; }

    /* بخشِ تمام‌عرضِ پایین: مشخصات سه‌ستونه تا اسکرول کم شود */
    .dt-allwrap .fd-specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dt-allwrap .fd-card { margin-bottom: 16px; }

    /* «فایل‌های مشابه» داخلِ پاپ‌آپ باریک‌تر است، پس کارت‌ها کوچک‌تر بچینند */
    .dt-similar .listing-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
}

/* ============================================================
   لایت‌باکسِ تصویر — کلیک روی تصویرِ اصلی ⇒ نمایشِ کاملِ تمام‌صفحه
   z-index از همه بالاتر (جزئیات ۳۲۰، اشتراک ۳۶۰، آگهی ۴۲۰)
   ============================================================ */
.lb-overlay { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(6, 10, 18, .96); }
.lb-overlay.open { display: flex; flex-direction: column; animation: dtFade .15s ease; }

.lb-stage {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    padding: 58px 18px 6px;
}
.lb-stage img, .lb-stage video {
    max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain; display: block; border-radius: 6px;
}

.lb-close, .lb-arrow {
    position: absolute; z-index: 3; border: none; cursor: pointer; color: #fff;
    background: rgba(255, 255, 255, .13); backdrop-filter: blur(6px); transition: background .15s;
}
.lb-close:hover, .lb-arrow:hover { background: rgba(255, 255, 255, .28); }
.lb-close { top: 14px; left: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.lb-close .ic { width: 19px; height: 19px; }
.lb-arrow {
    top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
    font-size: 27px; line-height: 1; font-family: 'Vazir', sans-serif;
}
.lb-arrow.right { right: 16px; }
.lb-arrow.left { left: 16px; }

.lb-bar { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px 14px 16px; }
.lb-count { color: rgba(255, 255, 255, .78); font-size: 12.5px; font-weight: 700; }
.lb-count:empty { display: none; }
.lb-thumbs { display: flex; gap: 7px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.lb-thumbs::-webkit-scrollbar { height: 0; }
.lb-thumbs button {
    width: 60px; height: 46px; flex-shrink: 0; padding: 0; border: 2px solid transparent; border-radius: 9px;
    overflow: hidden; background: #1a2636; cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s;
}
.lb-thumbs button.on { opacity: 1; border-color: #fff; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-vico { display: grid; place-items: center; height: 100%; color: #fff; }

/* تصویرِ اصلیِ گالری قابلِ بزرگ‌نمایی است (ویدیو نه — کنترل‌های خودش را دارد) */
.dt-main img { cursor: zoom-in; }

@media (max-width: 600px) {
    .lb-stage { padding: 56px 8px 4px; }
    .lb-arrow { width: 40px; height: 40px; font-size: 23px; }
    .lb-arrow.right { right: 8px; }
    .lb-arrow.left { left: 8px; }
    .lb-thumbs button { width: 52px; height: 40px; }
}

@keyframes dtFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dtRise { from { transform: translateY(16px) scale(.985); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .detail-page.open, .detail-modal { animation: none; }
}

@media (min-width: 1600px) {
    /* استفاده از عرضِ واقعیِ مانیتورهای بزرگ به‌جای نوارهای خالیِ کناری */
    .main { padding: 24px 40px; }
    .main > .view { max-width: 1520px; }
    .detail-modal { max-width: 1400px; }
    /* فرمِ قرارداد عمداً پهن نمی‌شود: متنِ حقوقیِ درون‌خطی در خطوطِ خیلی بلند بد خوانده می‌شود */
}

@media (min-width: 1700px) {
    /* چهار کارت در هر ردیف: یک‌چهارم اسکرولِ کمتر در فهرستِ فایل‌ها */
    .listing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    #applicantGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
