/* ============================================================
   admin-compat.css
   پل بین کلاس‌های قدیمی صفحات ادمین (Foundation 5 / Bootstrap)
   و قالب جدید radcom (Foundation 6). رنگ‌ها از متغیرهای قالب
   می‌آیند تا تم روشن/تاریک هم درست کار کند.
   ============================================================ */

/* ---------- گرید قدیمی ---------- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.9375rem;
    margin-right: -0.9375rem;
}
.row > .columns,
.row > [class*="columns"],
.columns,
[class~="columns"] {
    padding-left: 0.9375rem;
    padding-right: 0.9375rem;
    box-sizing: border-box;
}
.columns { width: 100%; }

/* ستون‌های بوت‌استرپی */
.col-sm-1  { width: 8.3333%; }
.col-sm-2  { width: 16.6667%; }
.col-sm-3  { width: 25%; }
.col-sm-4  { width: 33.3333%; }
.col-sm-5  { width: 41.6667%; }
.col-sm-6  { width: 50%; }
.col-sm-10 { width: 83.3333%; }
.col-md-3  { width: 25%; }
.col-md-4  { width: 33.3333%; }
.col-md-6  { width: 50%; }
.col-md-9  { width: 75%; }
.col-md-12 { width: 100%; }
[class*="col-sm-"], [class*="col-md-"] {
    padding-left: 0.9375rem;
    padding-right: 0.9375rem;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    [class*="col-md-"], .row > .columns, .columns { width: 100%; }
}

/* ---------- فرم ---------- */
.form-group { margin-bottom: 1rem; }
.control-label,
label.control-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--palette-text-primary, #313131);
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    font: inherit;
    line-height: 1.5;
    color: inherit;
    background-color: var(--white-color, #fff);
    border: 1px solid var(--color-svg-border, #cfcfcf);
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: var(--secondary-color, #6e44c6);
    box-shadow: 0 0 0 2px var(--bg-light-purple, #f3eeff);
}
select.form-control { height: auto; }
textarea.form-control { min-height: 90px; }

.text-danger { color: var(--color-red, #bb3d32); font-size: 0.85rem; }
.text-success { color: var(--color-green, #11663d); }

.form-check { margin: 0.5rem 0; display: flex; align-items: center; gap: 0.4rem; }
.form-check-input { width: auto; }

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0 0.25rem 0.25rem;
    font: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: var(--secondary-color, #6e44c6);
    color: #fff;
    transition: background .15s ease;
}
.btn:hover { background: var(--color-button-primary-hover, #5b35ad); color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.btn-lg { padding: 0.7rem 1.4rem; font-size: 1.05rem; }
.btn-success { background: var(--color-green, #11663d); }
.btn-success:hover { background: #0d4f2f; }
.btn-warning { background: #d29200; }
.btn-warning:hover { background: #b37e00; }
.btn-danger  { background: var(--color-red, #bb3d32); }
.btn-danger:hover { background: #9c3128; }
.btn-info    { background: #4b4b4b; }
.btn-info:hover { background: #313131; }
.btn-light   { background: #e5e5e5; color: #313131; }
.btn-light:hover { background: #d5d5d5; color: #313131; }
.btn-primary { background: var(--secondary-color, #6e44c6); }
.btn-outline-danger {
    background: transparent;
    border-color: var(--color-red, #bb3d32);
    color: var(--color-red, #bb3d32);
}
.btn-outline-danger:hover { background: var(--color-red, #bb3d32); color: #fff; }

/* ---------- جدول ---------- */
table.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--white-color, #fff);
    border-radius: 10px;
    overflow: hidden;
}
table.table th,
table.table td {
    padding: 0.7rem 0.9rem;
    text-align: right;
    border-bottom: 1px solid var(--svg-t-gray, #ddd);
    vertical-align: middle;
}
table.table thead th {
    background: var(--bg-light-purple, #f3eeff);
    font-weight: 700;
}
table.table tbody tr:hover { background: rgba(110, 68, 198, 0.04); }

/* ---------- کارت / پنل ---------- */
.card {
    background: var(--white-color, #fff);
    border: 1px solid var(--svg-t-gray, #e6e6e6);
    border-radius: 12px;
    margin-bottom: 1rem;
}
.card-body { padding: 1rem 1.25rem; }
.card-header { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--svg-t-gray, #e6e6e6); font-weight: 700; }

/* ---------- عناوین / متفرقه ---------- */
.page-title h2, .page_title h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.page-title { margin-bottom: 1rem; }
h1, h2 { color: var(--palette-text-primary, #313131); }

.alert { padding: 0.8rem 1rem; border-radius: 8px; margin: 0.75rem 0; }
.alert-success { background: var(--color-bg-green, #d6f3e5); color: var(--color-green, #11663d); }
.alert-danger  { background: var(--color-bg-red, #f1cfcc); color: var(--color-red, #bb3d32); }

/* تب‌های بوت‌استرپ (fallback بدون JS: همه پنل‌ها دیده شوند) */
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active,
.tab-content > .tab-pane.show.active { display: block; }
.nav-tabs { display: flex; gap: 0.25rem; list-style: none; padding: 0; margin: 0 0 0.75rem; border-bottom: 1px solid var(--svg-t-gray, #ddd); }
.nav-tabs .nav-link { display: block; padding: 0.5rem 0.9rem; border-radius: 8px 8px 0 0; text-decoration: none; color: inherit; }
.nav-tabs .nav-link.active { background: var(--bg-light-purple, #f3eeff); font-weight: 700; }

/* collapse بوت‌استرپ (fallback: باز نمایش داده شود) */
.collapse:not(.show) { display: block; }

img { max-width: 100%; height: auto; }

/* ---------- کمک‌های فرمِ قالب (floatingInpuBox) ---------- */
.floatingInpuBox { background: var(--white-color, #fff); }
.floatingInpuBox textarea { min-height: 110px; height: auto; padding-top: 22px; }
.floatingInpuBox select { height: 50px; }
.floatingInpuBox.selectBox::after {
    content: ""; position: absolute; left: 16px; top: 50%;
    width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg); pointer-events: none; opacity: .5;
}
.floatingInpuBox + .text-danger,
.field-block + .text-danger { display: block; margin: -8px 0 12px; }

.floatingInpuBox input:disabled,
.floatingInpuBox textarea:disabled {
    background: var(--color-gray-level-200, #eee);
    color: var(--color-gray-level-700, #717171);
    cursor: not-allowed;
}

/* لیبل شناور: وقتی فیلد مقدار دارد یا autofill شده، لیبل بالا برود */
.floatingInpuBox.is-filled label,
.floatingInpuBox input:-webkit-autofill ~ label {
    top: 0 !important;
    font-size: .6rem !important;
}
/* لیبل شناور خط بوردر را ببُرد + رنگ درست */
.floatingInpuBox label {
    background: var(--white-color, #fff);
    color: var(--color-gray-level-700, #8a8a8a);
}
.floatingInpuBox.is-filled label,
.floatingInpuBox input:focus ~ label,
.floatingInpuBox input:-webkit-autofill ~ label {
    color: var(--secondary-color, #6e44c6);
}
/* حذف پس‌زمینهٔ آبی autofill کروم */
.floatingInpuBox input:-webkit-autofill,
.floatingInpuBox input:-webkit-autofill:hover,
.floatingInpuBox input:-webkit-autofill:focus,
.floatingInpuBox input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--white-color, #fff) inset !important;
    box-shadow: 0 0 0 1000px var(--white-color, #fff) inset !important;
    -webkit-text-fill-color: var(--primary-color, #222) !important;
    caret-color: var(--primary-color, #222);
}

/* رمز عبور: نقطه‌های رمز راست‌چین (مثل نام کاربری) + لیبل راست + چشم دایره‌ای چپ */
.floatingInpuBox.passwordBox label { right: 15px; }
.floatingInpuBox.passwordBox input {
    text-align: right !important;
    direction: rtl;
    padding-left: 46px;
    padding-right: 16px;
}
.floatingInpuBox.passwordBox .eye {
    right: auto !important;
    left: 8px !important;
    opacity: 1 !important;
    width: 32px; height: 32px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: var(--bg-light-purple, #f3eeff);
    color: var(--secondary-color, #6e44c6);
    transition: background .15s ease, color .15s ease;
}
.floatingInpuBox.passwordBox .eye:hover {
    background: var(--secondary-color, #6e44c6); color: #fff;
}
.floatingInpuBox.passwordBox .eye svg { width: 18px; height: 18px; }

.field-block { margin-bottom: 18px; }
.field-block > label {
    display: block; margin-bottom: .5rem; font-size: .82rem; font-weight: 600;
    color: var(--color-gray-level-700, #717171);
}

/* آپلود تصویر به سبک قالب */
.upload-box {
    position: relative; display: block; cursor: pointer;
    border: 1px dashed var(--color-boder-2, #cfcfcf); border-radius: 12px;
    padding: 14px; text-align: center; background: var(--white-color, #fff);
    transition: border-color .15s ease;
}
.upload-box:hover { border-color: var(--secondary-color, #6e44c6); }
.upload-box input[type="file"] {
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.upload-box .upload-preview {
    width: 100%; height: 120px; border-radius: 8px; margin-bottom: 10px;
    background: #f0f0f0 center / contain no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.upload-box .upload-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--secondary-color, #6e44c6); color: #fff;
    border-radius: 20px; padding: 6px 18px; font-size: .82rem; font-weight: 700;
}

/* گرد کردن قاب CKEditor */
.field-block span.cke, .field-block .cke_chrome {
    border-radius: 10px !important; overflow: hidden;
    border: 1px solid var(--color-boder-2, #cfcfcf) !important;
}

.button.primary.expanded { border-radius: 30px; }
.button.hollow.primary { border-radius: 30px; }

/* ---------- بازنویسی جدول لیست‌ها ---------- */
.card > .main-table,
.card .main-table { width: 100%; }

.main-table { width: 100%; border-collapse: collapse; margin: 0; }
.main-table thead th {
    padding: 14px 16px !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    text-align: right;
    color: var(--color-gray-level-700, #717171);
    background: transparent;
    border-bottom: 1px solid var(--svg-t-gray, #e6e6e6);
    white-space: nowrap;
}
.main-table tbody { background: transparent !important; }
.main-table tbody td {
    padding: 14px 16px !important;
    font-size: .88rem !important;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid var(--svg-t-gray, #f0f0f0);
    color: var(--palette-text-primary, #313131);
}
.main-table tbody tr:nth-child(even) { background: transparent !important; }
.main-table tbody tr:hover { background: rgba(110, 68, 198, .05) !important; }
.main-table tbody tr:last-child td { border-bottom: 0; }
.main-table th.text-left, .main-table td.text-left { text-align: left !important; white-space: nowrap; }
.main-table td .button { margin: 0 0 0 6px; }
.main-table td img { display: inline-block; border-radius: 8px; vertical-align: middle; }

/* کارت دربرگیرندهٔ جدول */
.card.table-card { padding: 8px 10px; overflow-x: auto; }

/* صفحات لیست: تمام‌عرض (کشیدن از راست و چپ) - فرم‌ها همچنان وسط‌چین 1520 می‌مانند */
.page-content .content .grid-container:has(.table-card) {
    max-width: 100%;
    padding-right: 24px;
    padding-left: 24px;
}

/* ردیف‌های بازتر + تصویر بزرگ‌تر و واضح */
.main-table tbody td { padding: 24px 22px !important; }
.main-table thead th { padding: 18px 22px !important; }
.main-table td img {
    width: 110px; height: 70px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--svg-t-gray, #eee);
}
.main-table td:last-child, .main-table th:last-child { width: 1%; white-space: nowrap; }
.main-table td:first-child { font-weight: 700; }

/* ---------- صفحه‌بندی ---------- */
.admin-pager {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; flex-wrap: wrap; margin: 20px 0 4px;
}
.admin-pager a, .admin-pager span {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: .9rem; text-decoration: none;
    border: 1px solid var(--svg-t-gray, #e0e0e0);
    color: var(--palette-text-primary, #313131);
    background: var(--white-color, #fff);
}
.admin-pager a:hover { border-color: var(--secondary-color, #6e44c6); color: var(--secondary-color, #6e44c6); }
.admin-pager .current {
    background: var(--secondary-color, #6e44c6); color: #fff; border-color: var(--secondary-color, #6e44c6);
    font-weight: 700;
}
.admin-pager .disabled { opacity: .4; pointer-events: none; }

/* ---------- پیشخوان: باکس‌های دسترسی سریع ---------- */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.quick-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 40px 20px; border-radius: 22px; text-decoration: none;
    background: var(--white-color, #fff);
    border: 1px solid var(--svg-t-gray, #e6e6e6);
    color: var(--palette-text-primary, #313131);
    font-weight: 800; font-size: 1.05rem; text-align: center;
    transition: transform .2s ease, background .2s ease, color .2s ease,
                box-shadow .2s ease, border-color .2s ease;
}
.quick-box .qb-icon {
    width: 64px; height: 64px; border-radius: 20px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-light-purple, #f3eeff);
    transition: background .2s ease;
}
.quick-box .qb-icon svg { width: 30px; height: 30px; color: var(--secondary-color, #6e44c6); transition: color .2s ease, transform .2s ease; }
.quick-box:hover {
    background: var(--secondary-color, #6e44c6);
    color: #fff; border-color: var(--secondary-color, #6e44c6);
    transform: translateY(-6px);
    box-shadow: 0 16px 34px rgba(110, 68, 198, .32);
}
.quick-box:hover .qb-icon { background: rgba(255, 255, 255, .18); }
.quick-box:hover .qb-icon svg { color: #fff; transform: scale(1.18); }

/* ---------- پیشخوان: باکس‌های آمار ---------- */
.stat-box {
    display: flex; align-items: center; gap: 14px; height: 100%;
    padding: 18px; border-radius: 18px; text-decoration: none;
    background: var(--white-color, #fff);
    border: 1px solid var(--svg-t-gray, #e6e6e6);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-box:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,.08); border-color: var(--secondary-color, #6e44c6); }
.stat-box .stat-icon {
    width: 50px; height: 50px; border-radius: 14px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-light-purple, #f3eeff);
}
.stat-box .stat-icon svg { width: 24px; height: 24px; color: var(--secondary-color, #6e44c6); }
.stat-box .stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--palette-text-primary, #313131); line-height: 1.1; }
.stat-box .stat-label { display: block; font-size: .85rem; color: var(--color-gray-level-700, #717171); }

/* ---------- سایدبار چپ پیشخوان ---------- */
.dash-user {
    display: flex; align-items: center; gap: 12px; padding-bottom: 18px;
    border-bottom: 1px solid var(--svg-t-gray, #eee); margin-bottom: 18px;
}
.dash-user .avatar {
    width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-light-purple, #f3eeff); color: var(--secondary-color, #6e44c6);
}
.dash-user > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash-user .name { display: block; font-weight: 700; }
.dash-user .mail { display: block; font-size: .8rem; color: var(--color-gray-level-700, #717171); word-break: break-all; }

.my-services { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.my-services a {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    padding: 16px 8px; border-radius: 14px; text-decoration: none;
    background: var(--bg-color, #f7f7f7); border: 1px solid var(--svg-t-gray, #eee);
    color: var(--palette-text-primary, #313131);
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.my-services a svg { width: 22px; height: 22px; color: var(--secondary-color, #6e44c6); transition: color .16s ease; }
.my-services a:hover { background: var(--secondary-color, #6e44c6); color: #fff; border-color: var(--secondary-color, #6e44c6); transform: translateY(-3px); }
.my-services a:hover svg { color: #fff; }
.my-services .title { font-size: .82rem; font-weight: 700; }
.my-services .num { font-size: .75rem; opacity: .8; }

.dash-contact { font-size: .82rem; }
.dash-contact h4 { font-size: .9rem; margin: 0 0 10px; }
.dash-contact ul { list-style: none; padding: 0; margin: 0; }
.dash-contact li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--color-gray-level-700, #717171); }
.dash-contact li svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--secondary-color, #6e44c6); }
.dash-contact a { color: inherit; text-decoration: none; }

/* ---------- منوی کاربر در هدر ---------- */
.dropdown-pane.styled {
    width: auto !important; min-width: 180px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
    padding: 8px !important;
}
.user_menu { list-style: none; margin: 0; padding: 0; }
.user_menu li { margin: 0; }
.user_menu li a,
.user_menu li button {
    display: block; width: 100%; text-align: right;
    padding: 10px 12px; border-radius: 8px; border: 0; background: transparent;
    color: var(--palette-text-primary, #313131); font: inherit; cursor: pointer;
    text-decoration: none; white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.user_menu li a:hover,
.user_menu li button:hover {
    background: var(--bg-light-purple, #f3eeff);
    color: var(--secondary-color, #6e44c6);
}
.header-link .arrow { margin-right: 6px; }
.header-date {
    display: inline-flex; align-items: center; height: 36px; padding: 0 12px;
    border: 1px solid var(--svg-t-gray, #e0e0e0); border-radius: 8px;
    font-size: .8rem; color: var(--color-gray-level-700, #717171); margin: 0 10px 0 0;
}
/*
 * فارسی‌سازی پیام اتصال مجدد بلیزور (Blazor Server reconnection UI).
 * وقتی عنصری با id="components-reconnect-modal" در صفحه وجود داشته باشد، بلیزور به‌جای ساختن
 * رابط پیش‌فرض انگلیسی خودش، فقط کلاس‌های وضعیت زیر را روی همین عنصر اضافه/حذف می‌کند و متن را
 * دست‌نخورده می‌گذارد؛ بنابراین محتوای فارسی داخل هر بخش کاملا در اختیار ماست.
 */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    background: rgba(20, 26, 46, .55);
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-paused,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}
.reconnect-box {
    background: var(--body-background-color, #fff);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 340px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.reconnect-spinner {
    width: 36px; height: 36px; margin: 0 auto 1rem;
    border: 3px solid #e0e4ee;
    border-top-color: var(--primary-color, #2e477c);
    border-radius: 50%;
    animation: reconnect-spin .8s linear infinite;
}
@keyframes reconnect-spin { to { transform: rotate(360deg); } }
.reconnect-title { margin: 0 0 .35rem; font-size: 1rem; font-weight: 700; }
.reconnect-sub { margin: 0 0 1rem; font-size: .85rem; color: var(--color-gray-level-700, #717171); }

.reconnect-reload-btn {
    border: 0; border-radius: 10px; padding: .6rem 1.4rem;
    background: var(--primary-color, #2e477c); color: #fff; font: inherit; cursor: pointer;
}
