/* ============================================================
   ثبت مشترک در طرح کارور — استایل اصلی (RTL) با تم روشن/تیره
   ============================================================ */

/* فونت وزیرمتن */
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
    font-weight: 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --violet: #7c3aed;
    --teal: #0d9488;
    --amber: #d97706;
    --bg: #f1f4f9;
    --card: #ffffff;
    --surface-2: #f8fafc;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --ring: rgba(79, 70, 229, .12);

    /* رنگ‌های نشان‌ها */
    --badge-code-bg: #e0e7ff;
    --badge-code-text: #4f46e5;
    --badge-sub-bg: #fef3c7;
    --badge-sub-text: #b45309;
    --badge-child-bg: #ccfbf1;
    --badge-child-text: #0f766e;

    /* رنگ‌های آیکون‌های آمار */
    --icon-indigo-bg: #eef2ff;
    --icon-indigo-text: #4f46e5;
    --icon-teal-bg: #ccfbf1;
    --icon-teal-text: #0d9488;
    --icon-amber-bg: #fef3c7;
    --icon-amber-text: #d97706;
    --icon-violet-bg: #ede9fe;
    --icon-violet-text: #7c3aed;
}

/* ============ تم تیره ============ */
html[data-theme="dark"] {
    color-scheme: dark;
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #272e5c;
    --violet: #a78bfa;
    --teal: #2dd4bf;
    --amber: #fbbf24;
    --bg: #0b1220;
    --card: #141d33;
    --surface-2: #0e1729;
    --text: #e2e8f0;
    --text-muted: #93a5c4;
    --border: #2b3a58;
    --border-strong: #3d4f75;
    --success: #34d399;
    --success-bg: #06281d;
    --success-border: #14634a;
    --danger: #f87171;
    --danger-bg: #2c1214;
    --danger-border: #7a2b2b;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --ring: rgba(129, 140, 248, .2);

    --badge-code-bg: #272e5c;
    --badge-code-text: #a5b4fc;
    --badge-sub-bg: #3d2f10;
    --badge-sub-text: #fcd34d;
    --badge-child-bg: #0d3a33;
    --badge-child-text: #5eead4;

    --icon-indigo-bg: #272e5c;
    --icon-indigo-text: #a5b4fc;
    --icon-teal-bg: #0d3a33;
    --icon-teal-text: #5eead4;
    --icon-amber-bg: #3d2f10;
    --icon-amber-text: #fcd34d;
    --icon-violet-bg: #32245c;
    --icon-violet-text: #c4b5fd;
}

/* در تم تاریک، هاور آیتم‌های منو باید روشن و خوانا بماند (پس‌زمینه‌ی روشن + متن تیره ممنوع) */
/* کلاس .dropdown-item-text با کامپوننت بوت‌استرپ هم‌نام است و رنگ تیره به آن تحمیل می‌کند؛ در تم تاریک از رنگ والد ارث می‌برد */
[data-theme="dark"] .dropdown-item { color: var(--text); }

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

[data-theme="dark"] .dropdown-item-text,
[data-theme="dark"] .dropdown-item:hover .dropdown-item-text { color: inherit; }

[data-theme="dark"] .dropdown-item:hover .dropdown-item-text small { color: var(--text-muted); }

[data-theme="dark"] .dropdown-item-active,
[data-theme="dark"] .dropdown-item-active:hover {
    background: var(--badge-code-bg);
    color: var(--badge-code-text);
}

[data-theme="dark"] .status-admin {
    background: var(--badge-code-bg);
    color: var(--badge-code-text);
}

[data-theme="dark"] .thumb-more {
    background: var(--badge-code-bg);
    color: var(--badge-code-text);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    transition: background .25s, color .25s;
}

.app-body {
    background: var(--bg);
}

/* ============ دکمه تم ============ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background .15s;
}

.theme-toggle:hover { background: rgba(255, 255, 255, .26); }

html[data-theme="dark"] .theme-toggle .icon-moon,
html:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }

.theme-toggle-float {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
}

/* ============ هدر ============ */
.app-header {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(49, 46, 129, .35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.brand-logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .3));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 11px; opacity: .8; }

.main-nav {
    display: flex;
    gap: 6px;
    margin-inline-start: 12px;
}

.nav-link-app {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-link-app:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.nav-link-app.active {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-weight: 700;
}

.header-user {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 30px;
    padding: 4px 12px 4px 16px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name { font-size: 13px; font-weight: 600; }

/* ============ منوی کشویی کاربر ============ */
.user-menu { position: relative; }

.user-chip-btn {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 30px;
    padding: 4px 12px 4px 16px;
    cursor: pointer;
    font-family: inherit;
    color: #fff;
    transition: background .15s;
}

.user-chip-btn:hover { background: rgba(255, 255, 255, .2); }

.user-chevron {
    opacity: .8;
    transition: transform .18s;
}

.user-menu.open .user-chevron { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 200px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .25);
    padding: 8px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: dropIn .15s ease-out;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: 0;
    border-radius: 9px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: right;
    transition: background .12s, color .12s;
}

.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

.dropdown-logout { color: var(--danger); }
.dropdown-logout:hover { background: var(--danger-bg); color: var(--danger); }

/* ============ مودال تغییر رمز عبور ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 41, .6);
    backdrop-filter: blur(3px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    padding: 24px;
    animation: dropIn .18s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.modal-close {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.modal-close:hover { border-color: var(--danger); color: var(--danger); }

.modal-subtitle {
    color: var(--text-muted);
    font-size: 12.5px;
    margin: 0 0 16px;
    line-height: 1.9;
}

.nav-burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 0;
    padding: 8px;
    margin-inline-start: auto;
    cursor: pointer;
}

.nav-burger span {
    width: 22px;
    height: 2.5px;
    border-radius: 2px;
    background: #fff;
}

/* ============ محتوای اصلی ============ */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 14px;
    border-top: 1px solid var(--border);
    background: var(--card);
}

/* ============ سربرگ صفحه ============ */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.referral-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 10px 14px;
}

.referral-label { font-size: 13px; color: var(--text-muted); }

.referral-code {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.btn-copy {
    background: var(--primary-light);
    color: var(--primary);
    border: 0;
    border-radius: 8px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.btn-copy:hover { opacity: .85; }

.referral-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.referral-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    direction: ltr;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
}

/* ============ کارت آمار ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text);
    transition: transform .15s, box-shadow .15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .1);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-indigo { background: var(--icon-indigo-bg); color: var(--icon-indigo-text); }
.stat-icon-teal { background: var(--icon-teal-bg); color: var(--icon-teal-text); }
.stat-icon-amber { background: var(--icon-amber-bg); color: var(--icon-amber-text); }
.stat-icon-violet { background: var(--icon-violet-bg); color: var(--icon-violet-text); }

.stat-info { display: flex; flex-direction: column; }

.stat-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ============ کارت‌ها و فرم‌ها ============ */
.content-grid {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 20px;
    align-items: start;
}

.card-app {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: background .25s;
}

.card-head { margin-bottom: 18px; }

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 4px;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    line-height: 1.9;
}

.tree-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-ghost {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    transition: all .15s;
}

.btn-ghost:hover, .btn-ghost.active {
    border-color: var(--primary);
    color: var(--primary);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group-app { margin-bottom: 16px; }

.form-group-app label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-control-app {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.form-control-app::placeholder { color: var(--text-muted); opacity: .7; }

.form-control-app:focus {
    border-color: var(--primary);
    background: var(--card);
    box-shadow: 0 0 0 4px var(--ring);
}

/* فیلد کد معرفِ قفل‌شده (پرشده از طریق لینک دعوت) */
.form-control-app[readonly] {
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.8;
}

.form-hint.hint-ok { color: var(--success); font-weight: 600; }
.form-hint.hint-error { color: var(--danger); font-weight: 600; }

.btn-primary-app {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--violet) 100%);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
    transition: transform .15s, box-shadow .15s, opacity .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-app:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, .45);
    color: #fff;
}

.btn-primary-app:disabled { opacity: .65; cursor: not-allowed; }

.btn-lg-app { padding: 14px 24px; font-size: 15px; }

.w-100 { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.d-inline { display: inline; }

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ آپلود تصاویر مشترک ============ */
.upload-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--surface-2);
    transition: border-color .15s, background .15s;
}

.upload-area:focus-within {
    border-color: var(--primary);
    background: var(--card);
}

.upload-summary {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}

/* راهنمای فرمت و محدودیت‌ها در سطر جداگانه */
.upload-area .form-hint {
    flex-basis: 100%;
    margin-top: 0;
}

/* شبکه‌ی بندانگشتی‌ها: اندازه‌ی یکسان، چیدمان مرتب و شکستن خودکار در چند سطر */
.upload-previews {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-previews:empty { display: none; }

.upload-thumb {
    position: relative;
    width: 92px;
    height: 92px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card);
}

.upload-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-remove {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 21px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.thumb-remove:hover { background: var(--danger); }

/* ============ پیام‌ها ============ */
.alert-app {
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.9;
}

.alert-success-app,
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.alert-error-app,
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.alert-info-app,
.alert-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.9;
}

.text-danger-app {
    display: block;
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 5px;
}

.validation-summary-errors {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger) !important;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 600;
    list-style: none;
    margin: 0 0 14px;
    padding-inline-start: 30px;
}

/* ============ جدول ============ */
.table-responsive { overflow-x: auto; }

.table-app {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table-app thead th {
    text-align: right;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12.5px;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table-app tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-app tbody tr:last-child td { border-bottom: 0; }
.table-app tbody tr:hover { background: var(--surface-2); }
.td-num { font-weight: 600; letter-spacing: .5px; }

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

.empty-state span { font-size: 13px; }

/* بندانگشتی تصاویر مشترک در جدول مدیریت */
.cell-thumbs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cell-thumb {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 7px;
    transition: border-color .15s;
}

.cell-thumbs a:hover .cell-thumb { border-color: var(--primary); }

.thumb-more {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
}

/* ============ کارت خروجی اکسل ============ */
.export-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-export {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(5, 150, 105, .35);
    min-width: 200px;
}

.btn-export:hover {
    box-shadow: 0 6px 18px rgba(5, 150, 105, .5);
}

/* ============ سوییچ نمای درخت ============ */
.view-toggle {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 4px;
    gap: 4px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}

.view-btn.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--violet));
    color: #fff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, .35);
}

/* ============ درخت — نمای فهرستی ============ */
.tree-root,
.tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-children {
    margin-inline-start: 21px;
    padding-inline-start: 20px;
    border-inline-start: 2px solid var(--border);
    display: none;
}

li.tree-item.expanded > .tree-children { display: block; }

.tree-item { margin: 8px 0; }

.tree-node {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    transition: border-color .15s, background .15s;
}

.tree-node:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.tree-toggle {
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--primary);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.tree-toggle:hover { border-color: var(--primary); }

li.tree-item.expanded > .tree-node .chevron { transform: rotate(90deg); }
.chevron { transition: transform .18s; }

.tree-node > .avatar,
.org-node > .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark), var(--violet));
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tree-node-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tree-node-name { font-weight: 700; font-size: 14px; }
.tree-node-meta { font-size: 12px; color: var(--text-muted); direction: ltr; text-align: right; }

.tree-node-badges {
    margin-inline-start: auto;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}

.badge-code { background: var(--badge-code-bg); color: var(--badge-code-text); }
.badge-sub { background: var(--badge-sub-bg); color: var(--badge-sub-text); }
.badge-child { background: var(--badge-child-bg); color: var(--badge-child-text); }

/* ============ درخت — نمای گرافیکی (چارت سازمانی) ============ */
/* خطوط اتصال با SVG و توسط اسکریپت رسم می‌شوند تا در RTL هم دقیق باشند */
.org-viewport {
    overflow: auto;
    padding: 12px 4px 20px;
}

.org-inner {
    position: relative;
    display: inline-block;
    min-width: 100%;
    transform-origin: top center;
    padding: 6px 30px;
}

.org-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.org-lines path {
    stroke: var(--border-strong);
    stroke-width: 2;
    fill: none;
}

.org-root-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.org-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    padding-top: 32px;
}

.org-li {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 10px 0;
}

.org-node {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px 16px;
    min-width: 158px;
    max-width: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: transform .15s, border-color .15s;
}

.org-node:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.org-node .avatar { margin-bottom: 2px; }

.org-name { font-weight: 700; font-size: 13.5px; line-height: 1.6; }

.org-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    direction: ltr;
}

.org-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.org-zoom-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-label {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 42px;
    text-align: center;
    font-weight: 700;
}

/* ============ صفحات ورود/ثبت‌نام ============ */
.auth-body {
    background:
        radial-gradient(1200px 600px at 90% -10%, rgba(124, 58, 237, .5), transparent 60%),
        radial-gradient(1000px 500px at 10% 110%, rgba(13, 148, 136, .45), transparent 60%),
        linear-gradient(135deg, #312e81 0%, #4f46e5 60%, #6d28d9 100%);
}

html[data-theme="dark"] .auth-body {
    background:
        radial-gradient(1200px 600px at 90% -10%, rgba(124, 58, 237, .35), transparent 60%),
        radial-gradient(1000px 500px at 10% 110%, rgba(13, 148, 136, .25), transparent 60%),
        linear-gradient(135deg, #0b1029 0%, #1e1b4b 60%, #2e1065 100%);
}

.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    padding: 34px 30px;
    color: var(--text);
}

.auth-card-wide { max-width: 520px; }

/* ============ کپچا ============ */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-row img {
    height: 54px;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

.captcha-input { flex: 1; }

.auth-head { text-align: center; margin-bottom: 24px; }

.auth-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    filter: drop-shadow(0 10px 24px rgba(22, 163, 74, .35));
}

.auth-head h1 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }

.auth-head p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0;
    line-height: 2;
}

.auth-foot {
    text-align: center;
    margin-top: 20px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.auth-foot-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-foot a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-foot a:hover { text-decoration: underline; }

/* ============ ریسپانسیو ============ */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-burger { display: flex; }

    .main-nav {
        position: absolute;
        top: 100%;
        inset-inline: 0;
        flex-direction: column;
        background: #312e81;
        padding: 10px 16px 16px;
        gap: 4px;
        display: none;
        box-shadow: 0 12px 24px rgba(15, 23, 42, .3);
    }

    .main-nav.open { display: flex; }
    .nav-link-app { padding: 12px 16px; }

    .header-user { margin-inline-start: 0; }
    .user-name { display: none; }

    .page-title { font-size: 20px; }

    .referral-area { width: 100%; }
    .referral-box { width: 100%; justify-content: center; }
    .referral-link { max-width: none; }

    .form-row-2 { grid-template-columns: 1fr; }

    .tree-node { flex-wrap: wrap; }
    .tree-node-badges {
        margin-inline-start: 46px;
        justify-content: flex-start;
    }

    .export-btns { flex-direction: column; }
    .btn-export { width: 100%; }

    .card-head-row { flex-direction: column; align-items: stretch; }
    .view-toggle { align-self: flex-start; }
}

@media (max-width: 420px) {
    .auth-card { padding: 26px 20px; }
    .card-app { padding: 18px 16px; }
    .brand-text small { display: none; }
    .upload-thumb { width: 74px; height: 74px; }
    .cell-thumb { width: 32px; height: 32px; }
    .thumb-more { height: 32px; padding: 0 6px; font-size: 11px; }
}

/* ============ نشان وضعیت تایید ============ */
.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 3px 10px;
    line-height: 1.8;
    white-space: nowrap;
}

.status-pending { background: #fef3c7; color: #b45309; }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }
.status-admin { background: var(--primary-light); color: var(--primary); margin-inline-start: 6px; }

[data-theme="dark"] .status-pending { background: #3d2f10; color: #fcd34d; }

.text-muted-app { color: var(--text-muted); }

/* ============ فرم فیلتر مدیریت ============ */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px 14px;
}

.filter-grid .form-group-app { margin-bottom: 0; }

.filter-grid .form-control-app { padding: 9px 12px; font-size: 13px; }

.filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.filter-count { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.filter-btns { display: flex; gap: 8px; }

/* ============ قرص «در انتظار تایید» در سرصفحه ============ */
.pending-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fef3c7;
    color: #b45309;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    padding: 8px 14px;
    text-decoration: none;
    transition: opacity .15s;
}

[data-theme="dark"] .pending-pill { background: #3d2f10; color: #fcd34d; }

.pending-pill:hover { opacity: .85; }

.pending-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pending-pulse 1.6s infinite;
}

@keyframes pending-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* ============ جدول مدیریت: دکمه‌های عملیات ============ */
.table-actions { white-space: nowrap; }

.btn-mini {
    border: 0;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
    margin-inline-end: 4px;
    transition: opacity .15s;
}

.btn-mini:hover { opacity: .85; }
.btn-mini:disabled { opacity: .5; cursor: default; }

.btn-approve { background: var(--success-bg); color: var(--success); }
.btn-reject { background: var(--danger-bg); color: var(--danger); }

/* ============ صفحه‌بندی ============ */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}

.pager-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    min-width: 34px;
    padding: 6px 10px;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

a.pager-item:hover { border-color: var(--primary); color: var(--primary); }

.pager-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    cursor: default;
}

.pager-dots { color: var(--text-muted); padding: 0 2px; }

/* ============ مگا منوی مدیریت سیستم ============ */
.nav-item-admin { position: relative; display: flex; }

.nav-admin-btn { cursor: pointer; border: 0; font-family: inherit; background: transparent; }
.nav-item-admin.open .nav-admin-btn,
.nav-item-admin.active .nav-admin-btn,
.nav-admin-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-weight: 700;
}

.admin-chevron { opacity: .8; transition: transform .18s; }
.nav-item-admin.open .admin-chevron { transform: rotate(180deg); }

/* پنل مگا منو: دو ستون (صفحات مدیریت و خروجی اکسل) */
.admin-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    width: 480px;
    max-width: calc(100vw - 32px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .25);
    padding: 14px;
    z-index: 300;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    animation: dropIn .15s ease-out;
}

.admin-mega-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-mega-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: .3px;
    padding: 2px 10px 8px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 6px;
}

/* آیتم‌های مگا منو با آیکون، عنوان و توضیح کوتاه */
.admin-dropdown .dropdown-item {
    padding: 10px 12px;
    align-items: flex-start;
}

.admin-dropdown .dropdown-item > svg { flex-shrink: 0; margin-top: 2px; }

.dropdown-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.5;
}

.dropdown-item-text strong { font-size: 13.5px; }
.dropdown-item-text small { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

.dropdown-item:hover .dropdown-item-text small { color: inherit; opacity: .85; }

.dropdown-item-active {
    background: var(--primary-light);
    color: var(--primary);
}

@media (max-width: 768px) {
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .filter-footer { flex-direction: column; align-items: stretch; }
    .filter-btns { justify-content: flex-end; }
    .table-actions { min-width: 110px; }

    /* مگا منو در موبایل: درون منوی باز شده، تک‌ستونه و تمام‌عرض */
    .nav-item-admin { flex-direction: column; width: 100%; }
    .nav-admin-btn { width: 100%; justify-content: flex-start; }

    .admin-dropdown {
        position: static;
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
        box-shadow: none;
        border: 1px dashed var(--border);
        border-radius: 10px;
        margin: 4px 0 8px;
        padding: 10px;
    }
}


@media (max-width: 420px) {
    .filter-grid { grid-template-columns: 1fr; }
}

.settings-card { max-width: 720px; }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.settings-grid .form-group-app { margin-bottom: 0; }

.input-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-suffix .suffix {
    position: absolute;
    inset-inline-end: 12px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.settings-save { margin-top: 6px; }

/* ============ فرم بزرگ ثبت مشترک (دوستونه، کم‌اسکرول) ============ */
.sub-form-card { padding: 26px 30px; }

.sub-form-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 14px 28px;
    align-items: start;
    margin-bottom: 18px;
}

.sub-form-sec {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

/* ---------- چیپ‌های چندانتخابی اقدامات ---------- */
.action-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.action-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1.5px solid var(--border-strong);
    border-radius: 30px;
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 15px;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.action-chip:hover { border-color: var(--primary); color: var(--primary); }

.action-chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---------- پنل‌های شرطی اقدامات ---------- */
.conditional-panel {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-title { font-size: 13px; font-weight: 700; color: var(--text); }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }

.radio-pill { position: relative; cursor: pointer; }

.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }

.radio-pill span {
    display: inline-block;
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    background: var(--card);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: border-color .15s, background .15s, color .15s;
}

.radio-pill input:checked + span {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .radio-pill input:checked + span {
    background: var(--badge-code-bg);
    color: var(--badge-code-text);
}

/* ---------- چک‌لیست با آپلود اختیاری ---------- */
.checklist-list { display: flex; flex-direction: column; gap: 8px; }

.checklist-row {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.check-pick {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
}

.check-pick input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

.cl-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cl-preview {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    display: block;
}

.btn-cl-upload { padding: 6px 12px; font-size: 12px; }

/* ---------- نشان کوچک اقدامات در جدول‌ها ---------- */
.mini-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    margin: 1px 0 1px 3px;
    white-space: nowrap;
}

[data-theme="dark"] .mini-badge { background: var(--badge-code-bg); color: var(--badge-code-text); }

/* ---------- مدیریت چک‌لیست در تنظیمات ---------- */
.checklist-add-row { display: flex; gap: 10px; margin-bottom: 14px; }

.checklist-add-row .form-control-app { flex: 1; }

.inline-form { display: inline; }

/* ============ لایت‌باکس تصاویر ============ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 24, .92);
    backdrop-filter: blur(4px);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn .15s ease-out;
}

.lb-figure {
    margin: 0;
    max-width: min(1100px, 92vw);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lb-image {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    object-fit: contain;
}

.lb-caption { color: #e2e8f0; font-size: 14px; font-weight: 600; }

.lb-counter { color: #94a3b8; font-size: 12px; }

.lb-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 18px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background .15s;
}

.lb-close:hover { background: rgba(255, 255, 255, .25); }

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.lb-nav:hover { background: rgba(255, 255, 255, .25); }

.lb-prev { inset-inline-start: 18px; }
.lb-next { inset-inline-end: 18px; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 900px) {
    .sub-form-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    .sub-form-card { padding: 18px 16px; }
    .checklist-add-row { flex-direction: column; }
    .lb-nav { width: 38px; height: 38px; font-size: 22px; }
    .lb-prev { inset-inline-start: 8px; }
    .lb-next { inset-inline-end: 8px; }
}

/* ============ بنر حالت ویرایش اشتراک ============ */
.edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--badge-sub-bg);
    color: var(--badge-sub-text);
    border: 1px dashed var(--amber);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
}

.locked-hint { cursor: help; opacity: .7; }

/* ============ دکمه «حذف فیلترها» ============ */
.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s, transform .15s;
}

.btn-reset:hover { filter: brightness(.96); transform: translateY(-1px); }

[data-theme="dark"] .btn-reset { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

/* ============ دکمه جزئیات و مودال مشخصات ============ */
.btn-details {
    background: var(--badge-code-bg);
    color: var(--badge-code-text);
}

.modal-box-wide {
    max-width: 640px;
    max-height: 86vh;
    overflow-y: auto;
}

.details-body { display: flex; flex-direction: column; gap: 16px; }

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.details-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.dt-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

.dt-value { font-size: 14px; font-weight: 700; word-break: break-word; }

.details-sec {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--primary);
    margin: 6px 0 0;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
}

[data-theme="dark"] .details-sec { color: var(--badge-code-text); }

.details-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.details-checklist li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
}

.details-checklist .cell-thumb { flex-shrink: 0; cursor: zoom-in; }

@media (max-width: 640px) {
    .details-grid { grid-template-columns: 1fr; }
}

/* دکمه درخواست برداشت داخل کارت امتیاز */
.stat-card .btn-mini { margin-inline-start: auto; flex-shrink: 0; }

/* ============ وضعیت «تایید شد - در انتظار پرداخت» ============ */
.status-awaiting { background: var(--badge-code-bg); color: var(--badge-code-text); }

/* ============ مبلغ‌های مثبت/منفی در گزارش تراکنش‌ها ============ */
.amount-pos { color: var(--success); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }

.ledger-desc { font-size: 12.5px; color: var(--text-muted); max-width: 260px; }

.form-select-compact { width: auto; min-width: 130px; padding: 8px 12px; font-size: 13px; }

/* ============ جستجوی زنده‌ی کاربر در فیلترها ============ */
.user-picker { position: relative; }

.user-picker-clear {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.user-picker-list {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .2);
    z-index: 400;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: right;
    transition: background .12s;
}

.user-picker-item:hover { background: var(--primary-light); color: var(--primary); }

[data-theme="dark"] .user-picker-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.user-picker-empty {
    padding: 10px 12px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}

/* ============ آیکون راهنما (؟) و حباب توضیح ============ */
.field-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    margin-inline-start: 6px;
    cursor: help;
    vertical-align: middle;
    transition: background .15s, color .15s;
}

.field-help:hover,
.field-help.active {
    background: var(--primary);
    color: #fff;
}

.help-bubble {
    position: fixed;
    z-index: 900;
    max-width: 290px;
    background: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--text);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
    animation: fadeIn .15s ease-out;
}

/* ============ اعتبارسنجی پیامکی اشتراک (سامانه کاروران) ============ */
.verify-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.verify-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.verify-otp {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px dashed var(--border-strong);
    padding-top: 12px;
}

.verify-otp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.otp-input {
    width: 120px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 8px;
    direction: ltr;
}

.verify-done {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
}
/* ویژگی hidden همیشه بر display کلاس‌ها اولویت دارد (صفحات بدون Bootstrap) */
[hidden] {
    display: none !important;
}
