/* فونت IRAN (همان فونت قبلی سایت) برای همه‌ی متن‌ها؛ block: تا آماده شدن فونت متن مخفی می‌ماند و عوض نمی‌شود */
@font-face {
    font-family: "IRAN";
    src: url("../fonts/iran/IRANSansFaNum.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}
/* ظاهر جدید پنل شجره‌نامه (رنگ سرمه‌ای)
   فقط وقتی کلاس hui روی <html> است اعمال می‌شود؛ ظاهر قدیم دست نمی‌خورد.
   کدهای شجره عوض نشده‌اند؛ این‌جا فقط جای قاب و ابزارهای شجره با منوی جدید هماهنگ می‌شود. */

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/Vazirmatn-wght.woff2") format("woff2-variations"),
         url("../fonts/vazirmatn/Vazirmatn-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

html.hui {
    --hui-accent: #3346a8;
    --hui-accent-hover: #283a91;
    --hui-accent-soft: #eceffb;
    --hui-accent-text: #26358a;
    --hui-ring: rgba(51, 70, 168, .18);
    --hui-bg: #f3f4f8;
    --hui-surface: #ffffff;
    --hui-subtle: #f7f8fb;
    --hui-border: #e3e6ee;
    --hui-border-strong: #cfd4e0;
    --hui-text: #1d2433;
    --hui-text-2: #3b4252;
    --hui-muted: #5f6779;
    --hui-side-w: 248px;
    --hui-top-h: 64px;
    --hui-font: "IRAN", Tahoma, sans-serif;
}

/* قالب قدیمی (Limitless) کل صفحه را ثابت و بدون اسکرول می‌کرد */
html.hui { display: block; height: auto; overflow: auto; }
html.hui body {
    display: block; height: auto; min-height: 100vh; overflow: visible;
    background: var(--hui-bg); color: var(--hui-text); font-size: 14px; line-height: 1.7;
    padding: calc(var(--hui-top-h) + 24px) calc(var(--hui-side-w) + 24px) 32px 24px;
}
html.hui body, html.hui button, html.hui input, html.hui select, html.hui textarea, html.hui optgroup,
html.hui .btn, html.hui .form-control, html.hui .dropdown-menu, html.hui .modal, html.hui .popover,
html.hui .tooltip, html.hui h1, html.hui h2, html.hui h3, html.hui h4, html.hui h5, html.hui h6,
html.hui .swal-modal, html.hui .select2-container, html.hui .bootstrap-select .btn {
    font-family: var(--hui-font);
}
html.hui a { color: var(--hui-accent); }
html.hui a:hover { color: var(--hui-accent-hover); }
html.hui h1, html.hui h2, html.hui h3, html.hui h4, html.hui h5, html.hui h6 { color: var(--hui-text); font-weight: 700; }

/* صفحه‌ی شجره تمام‌صفحه می‌ماند */
html.hui.hui-fixed, html.hui.hui-fixed body { height: 100%; overflow: hidden; }
html.hui.hui-fixed body { padding: 0; }

/* ---------- منوی کناری ---------- */
.hui-side {
    position: fixed; top: 0; right: 0; bottom: 0; width: var(--hui-side-w); box-sizing: border-box;
    background: var(--hui-surface); border-left: 1px solid var(--hui-border);
    display: flex; flex-direction: column; gap: 16px; padding: 18px 14px; z-index: 1040; overflow-y: auto;
}
.hui-brand {
    display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--hui-border);
    color: var(--hui-text) !important; text-decoration: none !important;
}
.hui-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--hui-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hui-logo svg { width: 22px; height: 22px; }
.hui-brand-txt { display: flex; flex-direction: column; line-height: 1.45; }
.hui-brand-txt b { font-size: 16px; font-weight: 700; }
.hui-brand-txt small { font-size: 12px; color: var(--hui-muted); }
.hui-nav { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.hui-nav-group { display: flex; flex-direction: column; gap: 2px; }
.hui-nav-title { font-size: 11px; font-weight: 600; color: var(--hui-muted); padding: 0 10px 6px; }
.hui-nav-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
    color: var(--hui-text-2) !important; text-decoration: none !important; font-size: 14px; line-height: 1.5;
}
.hui-nav-link:hover { background: #f2f3f8; }
.hui-nav-link.active { background: var(--hui-accent-soft); color: var(--hui-accent-text) !important; font-weight: 600; }
.hui-ico { width: 18px; height: 18px; flex-shrink: 0; }
.hui-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--hui-subtle); border: 1px solid var(--hui-border); }
.hui-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--hui-accent-soft); color: var(--hui-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.hui-user-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.45; }
.hui-user-txt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hui-user-txt small { font-size: 11px; color: var(--hui-muted); }
.hui-icon-btn {
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: var(--hui-muted) !important; flex-shrink: 0;
}
.hui-icon-btn:hover { background: #eceef4; color: var(--hui-text) !important; }
.hui-icon-btn svg { width: 20px; height: 20px; }

/* ---------- نوار بالا ---------- */
.hui-top {
    position: fixed; top: 0; right: var(--hui-side-w); left: 0; height: var(--hui-top-h); box-sizing: border-box;
    display: flex; align-items: center; gap: 12px; padding: 0 24px; z-index: 1030;
    background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--hui-border);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hui-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--hui-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hui-spacer { flex: 1; }
.hui-chip {
    display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px;
    background: var(--hui-surface); border: 1px solid var(--hui-border); color: var(--hui-muted) !important; text-decoration: none !important; white-space: nowrap;
}
.hui-chip:hover { border-color: var(--hui-border-strong); color: var(--hui-text) !important; }
.hui-burger { display: inline-flex; }
.hui-overlay { display: none; }
/* منوی جمع‌شده (فقط آیکون) روی صفحه‌های بزرگ */
html.hui-side-collapsed { --hui-side-w: 68px; }
html.hui-side-collapsed .hui-side { padding: 18px 10px; align-items: stretch; }
html.hui-side-collapsed .hui-brand { justify-content: center; padding: 4px 0 14px; }
html.hui-side-collapsed .hui-brand-txt, html.hui-side-collapsed .hui-nav-title, html.hui-side-collapsed .hui-nav-link span,
html.hui-side-collapsed .hui-user-txt, html.hui-side-collapsed .hui-user .hui-icon-btn, html.hui-side-collapsed .hui-chip { display: none; }
html.hui-side-collapsed .hui-nav-link { justify-content: center; padding: 11px 0; }
html.hui-side-collapsed .hui-nav-group { gap: 4px; }
html.hui-side-collapsed .hui-user { justify-content: center; padding: 8px 0; background: transparent; border: 0; }
html.hui-side-collapsed .hui-nav-group + .hui-nav-group::before { content: ""; display: block; height: 1px; background: var(--hui-border); margin: 4px 8px; }
.hui-skip { position: absolute; right: -9999px; }
.hui-skip:focus { right: 16px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }

@media (max-width: 991.98px) {
    html.hui { --hui-side-w: 0px; }
    .hui-side { width: 280px; transform: translateX(100%); transition: transform .2s ease; }
    html.hui-side-open .hui-side { transform: none; box-shadow: -8px 0 30px rgba(15, 23, 42, .18); }
    html.hui-side-open .hui-overlay { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 1035; }
    .hui-burger { display: inline-flex; }
    .hui-top { padding: 0 12px; }
    html.hui body { padding: calc(var(--hui-top-h) + 16px) 16px 24px; }
    html.hui.hui-fixed body { padding: 0; }
}

/* ---------- صفحه‌ی شجره: فقط جای قاب و ابزارها (کد شجره عوض نشده) ---------- */
html.hui #FamilyChart { top: var(--hui-top-h); right: var(--hui-side-w); }
html.hui .ft-search { top: calc(var(--hui-top-h) + 14px); right: calc(var(--hui-side-w) + 16px); }
html.hui .ft-tools { top: calc(var(--hui-top-h) + 14px); }
html.hui .ft-addmsg { top: calc(var(--hui-top-h) + 66px); }
html.hui .page-header { top: calc(var(--hui-top-h) + 66px); right: calc(var(--hui-side-w) + 16px); }
html.hui .ft-search .form-control { background: #fff; }
html.hui .ft-tools .btn, html.hui .ft-zoom .btn { background: #fff; border-color: var(--hui-border) !important; }
html.hui.hui-fixed body > .alert { position: fixed; top: calc(var(--hui-top-h) + 10px); left: 24px; z-index: 1031; max-width: 420px; }

/* صفحه‌ی افراد تکراری اسکرول جدای خودش را داشت */
html.hui .md-scroll { position: static; overflow: visible; }
html.hui .md-wrap { margin-top: 0; }

/* ---------- اجزای Bootstrap ---------- */
html.hui .card { background: var(--hui-surface); border: 1px solid var(--hui-border); border-radius: 16px; box-shadow: none; }
html.hui .card-header { background: transparent; border-bottom: 1px solid var(--hui-border); font-weight: 700; }
html.hui .card-header.bg-light, html.hui .bg-light { background: var(--hui-subtle) !important; }
html.hui .card-footer { background: transparent; border-top: 1px solid var(--hui-border); }

html.hui .btn { border-radius: 10px; font-weight: 500; box-shadow: none !important; transition: background-color .15s, border-color .15s, color .15s; }
html.hui .btn-primary, html.hui .btn-info, html.hui .bg-primary { background-color: var(--hui-accent) !important; border-color: var(--hui-accent) !important; color: #fff !important; }
html.hui .btn-primary:hover, html.hui .btn-info:hover { background-color: var(--hui-accent-hover) !important; border-color: var(--hui-accent-hover) !important; }
html.hui .btn-outline-primary { color: var(--hui-accent); border-color: var(--hui-accent); }
html.hui .btn-outline-primary:hover { background: var(--hui-accent); color: #fff; }
html.hui .btn-light, html.hui .btn-default, html.hui .btn-outline-secondary { background: #fff; border: 1px solid var(--hui-border-strong); color: var(--hui-text-2); }
html.hui .btn-light:hover, html.hui .btn-default:hover, html.hui .btn-outline-secondary:hover { background: var(--hui-subtle); color: var(--hui-text); }
html.hui .btn-success { background: #16a34a; border-color: #16a34a; }
html.hui .btn-danger { background: #dc2626; border-color: #dc2626; }

html.hui .form-control, html.hui .custom-select {
    min-height: 42px; border-radius: 10px; border: 1px solid var(--hui-border-strong); background-color: #fff;
    color: var(--hui-text); font-size: 14px; box-shadow: none;
}
html.hui textarea.form-control { min-height: 84px; }
html.hui .form-control-sm { min-height: 34px; border-radius: 8px; font-size: 13px; }
html.hui .form-control:focus, html.hui .custom-select:focus { border-color: var(--hui-accent); box-shadow: 0 0 0 3px var(--hui-ring); }
html.hui .form-control::placeholder { color: #9aa1b0; }
html.hui label, html.hui .control-label { color: var(--hui-text-2) !important; font-weight: 500; font-size: 13px; }
html.hui .text-muted { color: var(--hui-muted) !important; }

html.hui .table { color: var(--hui-text); background: var(--hui-surface); margin-bottom: 0; }
html.hui .table thead th { background: var(--hui-subtle); color: var(--hui-muted); font-size: 12px; font-weight: 600; border-top: 0; border-bottom: 1px solid var(--hui-border); white-space: nowrap; }
html.hui .table th, html.hui .table td { padding: .75rem .9rem; vertical-align: middle; border-top: 1px solid #eef0f5; }
html.hui .table-striped tbody tr:nth-of-type(odd) { background: #fafbfd; }
html.hui .table-hover tbody tr:hover, html.hui .table tbody tr:hover { background: #f5f7fc; }
html.hui .table-responsive { border-radius: 12px; }

html.hui .badge { border-radius: 999px; padding: .38em .75em; font-weight: 600; }
html.hui .badge-success { background: #e7f6ec; color: #166534; }
html.hui .badge-warning { background: #fff4e0; color: #9a4b00; }
html.hui .badge-danger { background: #fdecec; color: #991b1b; }
html.hui .badge-primary, html.hui .badge-info { background: var(--hui-accent-soft); color: var(--hui-accent-text); }

html.hui .alert { border-radius: 12px; border: 1px solid transparent; }
html.hui .alert-success { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
html.hui .alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
html.hui .alert ul { margin: 0; padding-right: 18px; }

html.hui .modal-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .22); }
html.hui .modal-header { border-bottom: 1px solid var(--hui-border); }
html.hui .modal-footer { border-top: 1px solid var(--hui-border); }
html.hui .modal-backdrop.show { opacity: .4; }

html.hui .dropdown-menu { border: 1px solid var(--hui-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 6px; }
html.hui .dropdown-item { border-radius: 8px; }
html.hui .dropdown-item:active { background: var(--hui-accent); }

html.hui .pagination .page-link { border-radius: 8px !important; margin: 0 2px; border: 1px solid var(--hui-border); color: var(--hui-text-2); min-width: 36px; text-align: center; }
html.hui .pagination .page-item.active .page-link { background: var(--hui-accent); border-color: var(--hui-accent); color: #fff; }

html.hui .nav-tabs { border-bottom: 1px solid var(--hui-border); }
html.hui .nav-tabs .nav-link.active { color: var(--hui-accent); border-color: var(--hui-border) var(--hui-border) #fff; }

/* select2 و bootstrap-select */
html.hui .select2-container--default .select2-selection--single,
html.hui .select2-container--default .select2-selection--multiple { min-height: 42px; border-radius: 10px; border: 1px solid var(--hui-border-strong); }
html.hui .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px; }
html.hui .select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
html.hui .select2-dropdown { border-color: var(--hui-border-strong); border-radius: 10px; overflow: hidden; }
html.hui .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--hui-accent); }
html.hui .bootstrap-select .btn-light { border: 1px solid var(--hui-border-strong) !important; border-radius: 10px; min-height: 42px; }

/* پیام‌های sweetalert */
html.hui .swal-modal { border-radius: 16px; }
html.hui .swal-button { background: var(--hui-accent); border-radius: 10px; font-family: var(--hui-font); }
html.hui .swal-button:not([disabled]):hover { background: var(--hui-accent-hover); }

/* ---------- صفحه‌های لیستی (بانک اطلاعات، کاربران، حذف‌شده‌ها) ---------- */
.hui-page { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.hui-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.hui-page-head > div:first-child { flex: 1 1 300px; }
html.hui .hui-h { margin: 0; font-size: 22px; font-weight: 700; color: var(--hui-text); }
.hui-sub { margin: 4px 0 0; font-size: 13px; color: var(--hui-muted); }
.hui-card { background: var(--hui-surface); border: 1px solid var(--hui-border); border-radius: 16px; overflow: hidden; }
.hui-collapse > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
    padding: 14px 18px; font-weight: 700; color: var(--hui-accent-text);
}
.hui-collapse > summary::-webkit-details-marker { display: none; }
.hui-collapse > summary::after { content: "▾"; margin-right: auto; color: var(--hui-muted); transition: transform .15s; }
.hui-collapse[open] > summary { border-bottom: 1px solid var(--hui-border); }
.hui-collapse[open] > summary::after { transform: rotate(180deg); }
.hui-collapse-body { padding: 16px 8px 4px; }
.hui-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--hui-border); }
.hui-search {
    flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 42px; margin: 0; padding: 0 12px;
    border: 1px solid var(--hui-border-strong); border-radius: 10px; background: #fff; color: var(--hui-muted);
}
.hui-search:focus-within { border-color: var(--hui-accent); box-shadow: 0 0 0 3px var(--hui-ring); }
.hui-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--hui-text); }
.hui-toolbar .btn { height: 42px; }

.hui-list-head, .hui-row { display: grid; gap: 12px; align-items: center; padding: 10px 16px; }
.hui-cols-bank  { grid-template-columns: minmax(190px, 1.5fr) minmax(130px, 1fr) minmax(150px, 1.3fr) minmax(110px, 1fr) 100px 168px; }
.hui-cols-del   { grid-template-columns: minmax(200px, 2fr) minmax(160px, 1.4fr) 110px 190px; }
.hui-cols-users { grid-template-columns: minmax(190px, 1.6fr) 120px minmax(150px, 1.4fr) 100px 100px 96px; }
.hui-list-head { background: var(--hui-subtle); border-bottom: 1px solid var(--hui-border); color: var(--hui-muted); font-size: 12px; font-weight: 600; }
.hui-item { border-bottom: 1px solid #eef0f5; }
.hui-item:last-child { border-bottom: 0; }
.hui-row:hover { background: #f7f8fc; }
.hui-row > div { min-width: 0; font-size: 13px; color: var(--hui-text-2); overflow-wrap: anywhere; }
.hui-row small { display: block; font-size: 12px; color: var(--hui-muted); }
.hui-muted { color: var(--hui-muted); }
.hui-ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hui-cell-main { display: flex; align-items: center; gap: 10px; }
.hui-cell-main b { display: block; font-size: 14px; font-weight: 600; color: var(--hui-text); }
.hui-av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.hui-av.male { background: #e4f1f9; color: #1f6f9c; }
.hui-av.female { background: #f8e6f3; color: #9d2b84; }
.hui-av.unknown { background: #eef0f5; color: var(--hui-muted); }
.hui-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.hui-act {
    width: 34px; height: 34px; padding: 0; border: 1px solid var(--hui-border); border-radius: 8px; background: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: var(--hui-text-2) !important; text-decoration: none !important;
}
.hui-act:hover { background: var(--hui-subtle); border-color: var(--hui-border-strong); }
.hui-act.ok { color: #15803d !important; }
.hui-act.danger { color: #b91c1c !important; }
html.hui .hui-btn-ok { color: #15803d; height: 34px; display: inline-flex; align-items: center; gap: 6px; }
.hui-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.hui-tag.ok { background: #e7f6ec; color: #166534; }
.hui-tag.warn { background: #fff4e0; color: #9a4b00; }
html.hui .hui-item .user_detail_container { margin: 0 !important; padding: 12px 8px 4px; background: var(--hui-subtle); border-top: 1px dashed var(--hui-border); }
.hui-card-foot { display: flex; justify-content: center; padding: 12px 16px; border-top: 1px solid var(--hui-border); }
.hui-card-foot:empty, .hui-card-foot nav:empty { display: none; }
html.hui .hui-card-foot .pagination { margin: 0; flex-wrap: wrap; }
.hui-empty { padding: 40px 16px; text-align: center; color: var(--hui-muted); }

@media (max-width: 991.98px) {
    .hui-list-head { display: none; }
    .hui-row { grid-template-columns: 1fr 1fr !important; }
    .hui-cell-main, .hui-actions { grid-column: 1 / -1; }
    .hui-actions { justify-content: flex-start; }
    .hui-row > div[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--hui-muted); }
}

/* ---------- گزارش آمار و صفحه‌های قدیمیِ دیگر ---------- */
html.hui .table-bordered { border: 1px solid var(--hui-border); border-radius: 12px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
html.hui .table-bordered th, html.hui .table-bordered td { border-color: #eef0f5; }
html.hui hr { border-top-color: var(--hui-border); }
html.hui .rounded-border { border-radius: 12px !important; }

/* جستجوی زنده */
.hui-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.hui-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.hui-search-clear {
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: #eceef4; color: var(--hui-muted);
    font-size: 18px; line-height: 26px; cursor: pointer; flex-shrink: 0;
}
.hui-search-clear:hover { background: #dfe2ea; color: var(--hui-text); }
.hui-search-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--hui-border); border-top-color: var(--hui-accent); flex-shrink: 0; visibility: hidden; }
.hui-loading .hui-search-spin { visibility: visible; animation: hui-spin .7s linear infinite; }
.hui-loading .hui-list { opacity: .55; transition: opacity .15s; }
@keyframes hui-spin { to { transform: rotate(360deg); } }
.hui-act.on { background: var(--hui-accent-soft); border-color: var(--hui-accent); color: var(--hui-accent-text) !important; }

/* ---------- فرم‌ها و جستجوی قدیمی (گالری و ...) ---------- */
html.hui .form-group { margin-bottom: 14px; }
html.hui .form-control[type="file"] { padding: 8px 10px; height: auto; }
html.hui form.bft-search { background: #fff !important; border: 1px solid var(--hui-border) !important; border-radius: 14px; padding: 8px !important; align-items: center; }
html.hui .bft-search .bft-input input:not([type="hidden"]) {
    width: 100%; height: 42px; padding: 0 12px !important; border: 1px solid var(--hui-border-strong); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; outline: 0;
}
html.hui .bft-search .bft-input input:focus { border-color: var(--hui-accent); box-shadow: 0 0 0 3px var(--hui-ring); }
html.hui .btn-warning { background: #fff; border: 1px solid var(--hui-border-strong); color: var(--hui-text-2); }

/* ---------- صفحه‌ی ورود ---------- */
html.hui-login body { padding: 0 !important; background: var(--hui-bg); }
.hui-login-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; }
.hui-login-main { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 20px; box-sizing: border-box; }
.hui-login-card {
    width: 100%; max-width: 400px; box-sizing: border-box; background: #fff; border: 1px solid var(--hui-border); border-radius: 20px;
    padding: 34px 30px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
.hui-brand-static { border-bottom: 0; padding: 0; }
html.hui .hui-login-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.hui-login-card .form-control { min-height: 46px; font-size: 15px; }
.hui-login-card .hui-code { text-align: center; letter-spacing: 8px; font-size: 20px; }
.hui-login-btn { min-height: 48px; font-size: 15px; font-weight: 600; }
.hui-login-art {
    flex: 1 1 420px; min-height: 280px; display: flex; align-items: center; justify-content: center; padding: 40px; box-sizing: border-box;
    background: #1f2a66; color: #fff;
}
.hui-login-art > div { max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.hui-login-quote { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.6; }
.hui-login-note { margin: 0; font-size: 14px; line-height: 1.9; color: rgba(255, 255, 255, .82); }
@media (max-width: 860px) { .hui-login-art { display: none; } }

/* صفحه‌ی ورود: یادداشت و دکمه‌ی ویرایش ایمیل */
.hui-login-hint { margin-top: 8px; font-size: 12px; color: var(--hui-muted); line-height: 1.8; }
.hui-login-hint b { color: var(--hui-text-2); font-weight: 600; }
.hui-link-btn { margin-top: 10px; padding: 0; border: 0; background: transparent; color: var(--hui-accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.hui-link-btn:hover { color: var(--hui-accent-hover); }

/* ---------- صفحه‌بندی استاندارد ---------- */
.hui-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; direction: rtl; }
.hui-pg {
    min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--hui-border); background: #fff; color: var(--hui-text-2) !important;
    text-decoration: none !important; font-size: 13px; font-weight: 500; line-height: 1;
}
.hui-pg:hover { border-color: var(--hui-border-strong); background: var(--hui-subtle); }
.hui-pg.on { background: var(--hui-accent); border-color: var(--hui-accent); color: #fff !important; font-weight: 700; }
.hui-pg.nav { padding: 0 14px; }
.hui-pg.disabled { opacity: .45; pointer-events: none; }
.hui-pg.dots { border: 0; background: transparent; min-width: auto; color: var(--hui-muted); }
.hui-pg-info { width: 100%; text-align: center; font-size: 12px; color: var(--hui-muted); margin-top: 4px; }
.hui-card-foot { padding: 14px 16px; }

/* ---------- نوار گالری ---------- */
html.hui .hui-gallery-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
html.hui .hui-gallery-bar .hui-toolbar { flex: 1 1 320px; padding: 0; border: 0; margin: 0; }
html.hui .hui-seg { display: inline-flex; background: #e9ebf2; border-radius: 12px; padding: 4px; gap: 4px; }
html.hui .hui-seg a { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 9px; color: var(--hui-muted) !important; text-decoration: none !important; font-size: 13px; font-weight: 500; }
html.hui .hui-seg a.active { background: #fff; color: var(--hui-text) !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
html.hui .hui-gallery-bar .btn-primary { height: 42px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; }

/* ---------- کارت‌های گالری ---------- */
html.hui .hui-gallery-grid .bg-light { background: #fff !important; border: 1px solid var(--hui-border); border-bottom: 0; border-radius: 14px 14px 0 0; align-items: center; }
html.hui .hui-gallery-grid .bg-light a.text-dark { font-weight: 600; color: var(--hui-text) !important; text-decoration: none; }
html.hui .hui-gallery-grid .bg-light img { object-fit: cover; }
html.hui .hui-gallery-grid .float-start { float: left !important; }
html.hui .hui-gallery-grid .thumbnail { border: 1px solid var(--hui-border); border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; background: #fff; box-shadow: none; }
html.hui .hui-gallery-grid .thumbnail:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .10); }
html.hui .hui-gallery-grid .thumbnail__img { border-radius: 0; }
html.hui .hui-gallery-grid .thumbnail__caption { font-size: 13px; font-weight: 500; color: var(--hui-text-2) !important; }
html.hui .hui-gallery-grid > div { margin-bottom: 4px; }

/* ---------- لیست کاربران: دکمه‌های متنی کنار هم ---------- */
.hui-cols-users { grid-template-columns: minmax(190px, 1.4fr) 120px minmax(150px, 1.2fr) 100px 110px auto; }
.hui-actions { flex-wrap: nowrap; }
.hui-act.txt { width: auto; padding: 0 12px; gap: 6px; font-size: 13px; white-space: nowrap; }
.hui-act.txt i { font-size: 13px; }

/* ---------- پنجره‌ها: عنوان سفید روی رنگ، فاصله‌ی دکمه‌ها ---------- */
html.hui .modal-header { padding: 18px 22px; }
html.hui .modal-header .modal-title, html.hui .modal-header h6 { color: #fff; margin: 0; font-size: 17px; font-weight: 700; }
html.hui .modal-header .close { color: #fff; opacity: .9; text-shadow: none; }
html.hui .modal-body { padding: 20px 22px; }
html.hui .modal-footer { padding: 14px 22px 18px; gap: 10px; }
html.hui .modal-footer .btn { min-width: 96px; height: 42px; display: inline-flex; align-items: center; justify-content: center; margin: 0 !important; }

/* ---------- دکمه‌ی تغییر عکس: روی عکس پروفایل، فقط در حالت ویرایش ---------- */
.ft-photo-box { position: relative; display: inline-block; }
.ft-photo-btn {
    position: absolute; right: -4px; bottom: -4px; width: 36px; height: 36px; margin: 0; border-radius: 50%;
    background: #fff; border: 1px solid var(--hui-border-strong); box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--hui-accent);
}
.ft-photo-btn:hover { background: var(--hui-accent-soft); }
.ft-photo-btn.disabled { opacity: .5; pointer-events: none; }

/* کارت‌های شجره (کتابخانه‌ی family-chart) از قالب کلی کارت‌ها جدا می‌مانند */
/* پس‌زمینه‌ی سفید کارت، بدون اینکه دکمه‌ی C1 و جعبه‌های فرزندان پشتش بروند (isolation) */
html.hui #FamilyChart .card { background: #fff; border: 0; border-radius: 0; box-shadow: none; margin: 0; isolation: isolate; }

/* منوی انتخاب (bootstrap-select / select2) و دکمه‌ی انتخاب فایل با رنگ سایت */
html.hui .dropdown-menu .active, html.hui .dropdown-item.active, html.hui .dropdown-item:active { background-color: var(--hui-accent) !important; color: #fff !important; }
html.hui .bootstrap-select .dropdown-menu { border: 1px solid var(--hui-border); border-radius: 12px; padding: 6px; }
html.hui .bootstrap-select .dropdown-menu li a { border-radius: 8px; padding: 7px 10px; }
html.hui .bootstrap-select .dropdown-menu li a:hover { background: var(--hui-subtle); color: var(--hui-text); }
html.hui .bs-searchbox .form-control { min-height: 36px; border-radius: 8px; }
html.hui input[type="file"]::file-selector-button { background: #fff; border: 1px solid var(--hui-border-strong); border-radius: 8px; padding: 6px 12px; margin-inline-end: 10px; cursor: pointer; font: inherit; color: var(--hui-text-2); }
html.hui input[type="file"]::file-selector-button:hover { background: var(--hui-subtle); }

/* دکمه‌ی C1 روی کارت باشد تا کلیک به آن برسد (نه به خود کارت) */
html.hui #FamilyChart .f3-toggle-div { z-index: 2 !important; }

/* کادر «دسترسی ورود» زیر منوی وضعیت؛ دکمه‌ی ویرایش هم‌تراز با منوی وضعیت */
html.hui .ep-canlogin-box { margin-top: 10px; }
html.hui .ep-check { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 500; color: var(--hui-text-2); cursor: pointer; }
html.hui .ep-check input { margin: 0; width: 18px; height: 18px; flex-shrink: 0; }
html.hui form.user_detail_container > .form-group.d-flex { align-items: flex-start; padding-top: 42px; }
html.hui .ep-save-btn { margin: 0; height: 38px; align-self: flex-start; }

/* دکمه‌ی حذف کنار ذخیره در فرم ویرایش کاربر */
html.hui .ep-del-btn { margin-inline-start: 8px; height: 38px; display: inline-flex; align-items: center; justify-content: center; min-width: 80px; }

/* رنگ دکمه‌های حذف و ذخیره (حالت عادی و هاور) هماهنگ با سایت */
html.hui .btn-outline-danger { color: #b91c1c; border: 1px solid #f0b8b8; background: #fff; }
html.hui .btn-outline-danger:hover, html.hui .btn-outline-danger:focus { color: #991b1b; background: #fdecec; border-color: #dc2626; }
html.hui .btn-outline-danger:active { background: #fbd5d5; color: #7f1d1d; }
html.hui .btn-outline-success { color: var(--hui-accent); border: 1px solid var(--hui-accent); background: #fff; }
html.hui .btn-outline-success:hover, html.hui .btn-outline-success:focus { color: #fff; background: var(--hui-accent); border-color: var(--hui-accent); }
html.hui .btn-outline-success:active { background: var(--hui-accent-hover); border-color: var(--hui-accent-hover); color: #fff; }

/* عنوان پنجره‌های بدون رنگ پس‌زمینه باید تیره باشد */
html.hui .modal-header:not(.text-white) .modal-title, html.hui .modal-header:not(.text-white) h6 { color: var(--hui-text); }

/* صفحه‌ی ورود روی گوشی: بدون عرض ثابت و بدون بریدگی */
@media (max-width: 575.98px) {
    .hui-login-main { flex: 1 1 100%; min-width: 0; padding: 24px 16px; }
    .hui-login-card { padding: 26px 20px; }
    html.hui-login body { overflow-x: hidden; }
}

/* جستجوی درخت: بدون زوم خودکار گوشی و بدون حالت فوکوس */
html.hui .ft-search .form-control { font-size: 16px; }
html.hui .ft-search .form-control:focus { box-shadow: none; outline: 0; border-color: var(--hui-border-strong); }

/* ---- آیفون/iOS: بدون زوم خودکار روی فیلدها، و احترام به بریدگی و نوار پایین ---- */
@media (max-width: 991.98px) {
    html.hui input, html.hui select, html.hui textarea { font-size: 16px; }
}
html.hui .hui-top { padding-top: env(safe-area-inset-top); height: calc(var(--hui-top-h) + env(safe-area-inset-top)); }
html.hui #FamilyChart { top: calc(var(--hui-top-h) + env(safe-area-inset-top)); }
html.hui .ft-zoom { bottom: calc(12px + env(safe-area-inset-bottom)); }
