:root { --C0: #ffffff; --C1: #0b2f5b; --C2: #e5e5fa; --C3: #274973; --C4: #E8E8E8; --C5: #979797; --C6: #181818; --C7: #02101f; --C8: #f5f5f5; --C9: #041c35; --C10: #0b2f5bf0; --selection-bg: var(--C1); --selection-text: var(--C2); --mk-header-h: 120px; }

/* جلوگیری از فلش تم: پنل تا اعمال تم از localStorage مخفی است، بعد با تم درست نمایش داده می‌شود */
.profile-panel.theme-pending { opacity: 0; }
.profile-panel { transition: opacity 0.15s ease-out; }

/* بج/پس‌زمینه قرمز: فقط داخل پنل (تا مودال/فوتر اصلی تحت تأثیر نباشند) */
.profile-panel .bg-danger { color: #fff !important; }
.profile-panel .bg-danger a { color: #fff !important; }

/* Dark theme palette فقط داخل profile-panel */
.profile-panel[data-bs-theme="dark"] { --C0: #0b1220; --C1: #0b2f5b; --C2: #101826; --C3: #274973; --C4: #1f2a3a; --C5: #8b97a8; --C6: #e5e7eb; --C7: #0e1726; --C8: #0f172a; --C9: #041c35; --C10: #0b2f5b; --selection-bg: #23364a; --selection-text: #e5e7eb; color-scheme: dark; }

/* Core backgrounds and text in dark */
.profile-panel[data-bs-theme="dark"] { background-color: var(--C0); color: var(--C6); }

.profile-panel[data-bs-theme="dark"] .bg-light { background-color: var(--C8) !important; }
.profile-panel[data-bs-theme="dark"] .navbar,
.profile-panel[data-bs-theme="dark"] .navbar-light { background-color: var(--C8) !important; }
/* نوار موبایل پروفایل — لایت مد */
.profile-panel .navbar-profile-mobile,
.profile-panel .navbar.d-lg-none { background-color: var(--C8) !important; color: var(--C6); border-bottom: 1px solid var(--C4); padding: 0.5rem 1rem; min-height: 50px; }
.profile-panel .navbar-profile-mobile .navbar-brand,
.profile-panel .navbar.d-lg-none .navbar-brand { color: var(--C6) !important; font-weight: 600; padding: 0.5rem 0; }
.profile-panel .navbar-profile-mobile .navbar-toggler,
.profile-panel .navbar.d-lg-none .navbar-toggler { color: var(--C6); border-color: var(--C4); }
.profile-panel .navbar-profile-mobile .mk-hamburger,
.profile-panel .navbar-profile-mobile .mk-hamburger::before,
.profile-panel .navbar-profile-mobile .mk-hamburger::after,
.profile-panel .navbar.d-lg-none .mk-hamburger,
.profile-panel .navbar.d-lg-none .mk-hamburger::before,
.profile-panel .navbar.d-lg-none .mk-hamburger::after { background: var(--C6) !important; }
/* نوار موبایل پروفایل — دارک مد */
.profile-panel[data-bs-theme="dark"] .navbar-profile-mobile,
.profile-panel[data-bs-theme="dark"] .navbar.d-lg-none { background-color: var(--C8) !important; color: var(--C6); border-bottom-color: var(--C4); }
.profile-panel[data-bs-theme="dark"] .navbar-profile-mobile .navbar-brand,
.profile-panel[data-bs-theme="dark"] .navbar.d-lg-none .navbar-brand { color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .navbar-profile-mobile .navbar-toggler,
.profile-panel[data-bs-theme="dark"] .navbar.d-lg-none .navbar-toggler { color: var(--C6); border-color: var(--C5); }
.profile-panel[data-bs-theme="dark"] .navbar-profile-mobile .mk-hamburger,
.profile-panel[data-bs-theme="dark"] .navbar-profile-mobile .mk-hamburger::before,
.profile-panel[data-bs-theme="dark"] .navbar-profile-mobile .mk-hamburger::after,
.profile-panel[data-bs-theme="dark"] .navbar.d-lg-none .mk-hamburger,
.profile-panel[data-bs-theme="dark"] .navbar.d-lg-none .mk-hamburger::before,
.profile-panel[data-bs-theme="dark"] .navbar.d-lg-none .mk-hamburger::after { background: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .sidebar { background-color: var(--C8) !important; color: var(--C6); }
.profile-panel[data-bs-theme="dark"] .card { background-color: var(--C8); color: var(--C6); border-color: var(--C4); }
.profile-panel[data-bs-theme="dark"] .text-muted { color: var(--C5) !important; }
/* کارت پرداخت انتخاب‌شده — پس‌زمینه آبی تیره، متن کم‌رنگ خوانا */
.profile-panel[data-bs-theme="dark"] .payment-method.selected .text-muted { color: rgba(229, 231, 235, 0.85) !important; }
.profile-panel[data-bs-theme="dark"] .text-primary { color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .remove-item { color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .remove-item:hover { color: #f87171 !important; }
.profile-panel[data-bs-theme="dark"] .cart-summary h5 { color: var(--C6) !important; }
/* کارت پرداخت انتخاب‌شده — لایت مود: بک تیره، متن روشن */
.profile-panel .payment-method.selected .text-muted,
.profile-panel .payment-method-orders.selected .text-muted { color: rgba(255, 255, 255, 0.9) !important; }
.profile-panel[data-bs-theme="dark"] .payment-method { border-color: var(--C3); color: var(--C6); }
.profile-panel[data-bs-theme="dark"] .payment-method.selected { background: var(--C3) !important; border-color: var(--C3) !important; color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .payment-method.selected i { color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .btn-checkout { background: var(--C3) !important; color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .btn-checkout:hover { background: var(--C2) !important; color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .order-detail .value { color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(255,255,255,.04); --bs-table-color: var(--C6); }
.profile-panel[data-bs-theme="dark"] .form-control,
.profile-panel[data-bs-theme="dark"] .form-select { background-color: #0b1626; color: var(--C6); border-color: #1e293b; }
.profile-panel[data-bs-theme="dark"] .form-control:focus { border-color: var(--C3) !important; box-shadow: 0 0 0 0.2rem rgba(var(--bs-secondary-rgb), 0.25) !important; }

/* فیلدهای غیرفعال در دارک مد */
.profile-panel[data-bs-theme="dark"] .form-control[readonly],
.profile-panel[data-bs-theme="dark"] .form-control[disabled] { background-color: #1f2937 !important; color: #9ca3af !important; border-color: #374151 !important; cursor: not-allowed; }
.profile-panel[data-bs-theme="dark"] .form-select[readonly],
.profile-panel[data-bs-theme="dark"] .form-select[disabled] { background-color: #1f2937 !important; color: #9ca3af !important; border-color: #374151 !important; cursor: not-allowed; }

/* ========== لودر یکسان پروفایل (مثل پنل ادمین: بلر + اسپینر، دارک‌مود) ========== */
.panel-loader-wrap { position: relative; min-height: 60px; }
.panel-loader-wrap.loading { pointer-events: none; }
.panel-loader-wrap.loading::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.78); z-index: 10; border-radius: inherit; display: block; backdrop-filter: blur(2px); }
.panel-loader-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 11; display: none; width: 36px; height: 36px; border: 3px solid rgba(0,0,0,0.08); border-left-color: var(--C1); border-radius: 50%; animation: spin 0.75s linear infinite; }
.panel-loader-wrap.loading .panel-loader-spinner { display: block; }
.panel-loader-spinner-sm { width: 22px; height: 22px; border-width: 2px; }
.panel-loader-wrap.loading .panel-loader-spinner-sm { display: block; }
.panel-loader-wrap-inline { min-height: 0; }
.panel-loader-wrap-inline.loading::before { display: none !important; }
.panel-loader-wrap-inline .panel-loader-spinner, .panel-loader-wrap-inline .panel-loader-spinner-sm { position: static; transform: none; margin: 0; }
.profile-panel[data-bs-theme="dark"] .panel-loader-wrap.loading::before { background: rgba(15, 23, 42, 0.88); }
.profile-panel[data-bs-theme="dark"] .panel-loader-spinner { border-color: rgba(255,255,255,0.1); border-left-color: var(--C3); }
.panel-ajax-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.65); z-index: 99990; display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.panel-ajax-overlay.show { display: flex; }
.panel-ajax-overlay .panel-loader-spinner { position: static; transform: none; display: block; }
.profile-panel[data-bs-theme="dark"] .panel-ajax-overlay { background: rgba(11, 18, 32, 0.82); }
/* overlay روی مودال (داخل .modal-content) — همان اسپینر یکسان */
.panel-loader-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.85); z-index: 1050; display: none; align-items: center; justify-content: center; border-radius: 0 0 var(--bs-modal-border-radius, 0.5rem) var(--bs-modal-border-radius, 0.5rem); backdrop-filter: blur(2px); }
.panel-loader-overlay.show { display: flex; }
.panel-loader-overlay .panel-loader-spinner { position: static; transform: none; display: block; }
.profile-panel[data-bs-theme="dark"] .panel-loader-overlay { background: rgba(15, 23, 42, 0.88); }
/* اسپینر داخل دکمه (inline) */
.panel-loader-wrap-inline.loading .panel-loader-spinner-sm { display: inline-block; }
.panel-loader-wrap-inline .panel-loader-spinner-sm { display: none; }

/* Loader صفحه اولیه (قبل از لود محتوا) — همان استایل یکسان */
#pageLoader { min-height: 200px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; }
#pageLoader::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.78); backdrop-filter: blur(2px); border-radius: inherit; }
#pageLoader .panel-loader-spinner { position: relative; top: auto; left: auto; transform: none; display: block; margin-bottom: 0.75rem; }
.profile-panel[data-bs-theme="dark"] #pageLoader::before { background: rgba(15, 23, 42, 0.88); }
.profile-panel[data-bs-theme="dark"] #pageLoader .panel-loader-spinner { border-color: rgba(255,255,255,0.1); border-left-color: var(--C3); }
#pageLoader .spinner-border { width: 3rem; height: 3rem; border-color: rgba(0,0,0,0.08); border-left-color: var(--C1); animation: spin 0.75s linear infinite; }
.profile-panel[data-bs-theme="dark"] #pageLoader .spinner-border { color: var(--C3) !important; border-color: rgba(255,255,255,0.1); border-left-color: var(--C3); }

#mainContent { transition: opacity 0.3s ease-in-out; }

/* Dark mode loader */
.profile-panel[data-bs-theme="dark"] #pageLoader { background-color: var(--C8); color: var(--C6); }
.profile-panel[data-bs-theme="dark"] .nav-link { color: #cbd5e1; }
.profile-panel[data-bs-theme="dark"] .nav-link.active { background-color: rgba(var(--bs-secondary-rgb), 0.12); color: var(--C3) !important; }


/* Alert styles for login page */
.mk-auth-card #mkAlert { border-radius: 8px; padding: 1rem; margin-bottom: 1rem; border: 1px solid; animation: slideDown 0.3s ease-out; }

.mk-auth-card #mkAlert.alert-warning { background-color: rgba(255, 193, 7, 0.1); border-color: rgba(255, 193, 7, 0.3); color: #856404; }

.mk-auth-card #mkAlert.alert-danger { background-color: rgba(220, 53, 69, 0.1); border-color: rgba(220, 53, 69, 0.3); color: #721c24; }

.mk-auth-card #mkAlert.alert-success { background-color: rgba(40, 167, 69, 0.1); border-color: rgba(40, 167, 69, 0.3); color: #155724; }

.mk-auth-card #mkAlert.alert-info { background-color: rgba(23, 162, 184, 0.1); border-color: rgba(23, 162, 184, 0.3); color: #0c5460; }

.mk-auth-card #mkAlert strong { display: block; margin-bottom: 0.5rem; font-size: 1rem; }

.mk-auth-card #mkAlert .small { display: block; margin-bottom: 0.75rem; line-height: 1.5; }

.mk-auth-card #mkAlert .btn { margin-top: 0.5rem; }

.profile-panel[data-bs-theme="dark"] .mk-auth-card #mkAlert.alert-warning { background-color: rgba(255, 193, 7, 0.15); border-color: rgba(255, 193, 7, 0.4); color: #ffc107; }

.profile-panel[data-bs-theme="dark"] .mk-auth-card #mkAlert.alert-danger { background-color: rgba(220, 53, 69, 0.15); border-color: rgba(220, 53, 69, 0.4); color: #f5c6cb; }

.profile-panel[data-bs-theme="dark"] .mk-auth-card #mkAlert.alert-success { background-color: rgba(40, 167, 69, 0.15); border-color: rgba(40, 167, 69, 0.4); color: #c3e6cb; }

.profile-panel[data-bs-theme="dark"] .mk-auth-card #mkAlert.alert-info { background-color: rgba(23, 162, 184, 0.15); border-color: rgba(23, 162, 184, 0.4); color: #bee5eb; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toggle button */
#themeToggle { position: absolute; top: 8px; left: 20px; z-index: 999; }
/* Adjusted z-index */
.profile-panel[data-bs-theme="dark"] #themeToggle { border-color: #334155; color: #cbd5e1; }
.profile-panel .navbar-toggler:focus { box-shadow: unset !important }
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--C2); z-index: 99999999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease, visibility 0.5s ease; }

.profile-panel .navbar-profile-mobile.sticky-top,
.profile-panel .navbar.sticky-top { z-index: 999; top: 0 !important; }
.mk-toggle { border: none; outline: none; }
.mk-hamburger { position: relative; display: inline-block; width: 22px; height: 2px; transition: background .2s ease; }
.mk-hamburger::before, .mk-hamburger::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; transition: transform .25s ease, top .25s ease, bottom .25s ease, opacity .2s ease; }
.mk-hamburger::before { top: -9px; }
.mk-hamburger::after { bottom: -9px; }
/* Expanded (X) state driven by aria-expanded */
.mk-toggle[aria-expanded="true"] .mk-hamburger { background: transparent; }
.mk-toggle[aria-expanded="true"] .mk-hamburger::before { top: 0; transform: rotate(45deg); }
.mk-toggle[aria-expanded="true"] .mk-hamburger::after { bottom: 0; transform: rotate(-45deg); }


.offcanvas-lg .offcanvas-body { display: block }
.offcanvas-header .btn-close { position: absolute; left: 20px; top: 25px; }

/* سایدبار تا 992px مثل موبایل: ستون عرض صفر، محتوا تمام‌عرض، منو به‌صورت offcanvas */
@media (max-width: 992px) {
    .profile-panel #sidebarMenu.profile-sidebar-col { flex: 0 0 0 !important; max-width: 0 !important; width: 0 !important; padding: 0 !important; overflow: visible; margin: 0 !important; }
    .profile-panel .row > main { flex: 0 0 100% !important; max-width: 100% !important; width: 100% !important; }

    /* در 992px Bootstrap سایدبار را استاتیک می‌کند؛ این override رفتار offcanvas را حفظ می‌کند */
    .profile-panel #sidebarCollapse.offcanvas-lg {
        position: fixed !important; bottom: 0; z-index: 1045; display: flex !important; flex-direction: column; max-width: 100%;
        visibility: hidden; background-color: var(--bs-offcanvas-bg, var(--C8)); background-clip: padding-box; outline: 0;
        transition: transform 0.3s ease-in-out;
    }
    .profile-panel #sidebarCollapse.offcanvas-lg.offcanvas-start {
        top: 0; left: 0; width: var(--bs-offcanvas-width, 400px);
        border-right: var(--bs-offcanvas-border-width, 1px) solid var(--bs-offcanvas-border-color);
        transform: translateX(-100%);
    }
    [dir="rtl"] .profile-panel #sidebarCollapse.offcanvas-lg.offcanvas-start {
        left: auto; right: 0; border-right: 0;
        border-left: var(--bs-offcanvas-border-width, 1px) solid var(--bs-offcanvas-border-color);
        transform: translateX(100%);
    }
    .profile-panel #sidebarCollapse.offcanvas-lg.showing,
    .profile-panel #sidebarCollapse.offcanvas-lg.show:not(.hiding) { transform: none !important; }
    [dir="rtl"] .profile-panel #sidebarCollapse.offcanvas-lg.showing,
    [dir="rtl"] .profile-panel #sidebarCollapse.offcanvas-lg.show:not(.hiding) { transform: none !important; }
    .profile-panel #sidebarCollapse.offcanvas-lg.showing,
    .profile-panel #sidebarCollapse.offcanvas-lg.hiding,
    .profile-panel #sidebarCollapse.offcanvas-lg.show { visibility: visible !important; }
    .profile-panel #sidebarCollapse.offcanvas-lg .offcanvas-header { display: block !important; }
    .profile-panel #sidebarCollapse.offcanvas-lg .offcanvas-body {
        display: block !important; flex-grow: 1; overflow-y: auto;
        background-color: var(--bs-offcanvas-bg, var(--C8)) !important;
    }

    /* نوار همبرگر در 992px نمایش داده شود (override برای d-lg-none) */
    .profile-panel .navbar.navbar-profile-mobile { display: flex !important; }

    #sidebarCollapse { top: 50px; height: calc(100% - var(--mk-nav-h)); z-index: 1045 !important; }

    #sidebarCollapse.offcanvas .offcanvas-body { overflow-y: auto; }

    .profile-panel[data-bs-theme="dark"] #sidebarCollapse.offcanvas { background-color: var(--C8); }

    .profile-panel .navbar-profile-mobile.sticky-top,
    .profile-panel .navbar.sticky-top.d-lg-none { opacity: 0; transition: opacity 0.2s ease; top: calc(var(--mk-header-h, 0) - 2px) !important; }
    body.mk-header-h-set .profile-panel .navbar-profile-mobile.sticky-top,
    body.mk-header-h-set .profile-panel .navbar.sticky-top.d-lg-none { opacity: 1; }

    #themeToggle { top: 15px; left: 20px; z-index: 999; }

    #sidebarCollapse.show { padding-bottom: 100px; }
}

.offcanvas-backdrop { z-index: 1040 !important; /* Force backdrop below menu but above content */ }

.loader-content { text-align: center; font-size: 1.2em; color: var(--C1); display: flex; flex-direction: column; align-items: center; }

.spinner { border: 4px solid var(--C2); border-left-color: var(--C1); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin-top: 10px; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#preloader.hide { opacity: 0; visibility: hidden; }

html, body { height: 100%; overflow-x: hidden; }


.sidebar-sticky { position: sticky; top: 0; /* Stick to the top */ height: calc(100vh - 56px); /* Adjust 56px if your mobile navbar height is different */ padding-top: .5rem; overflow-x: hidden; overflow-y: auto; /* Scrollable sidebar */ }

@media (max-width: 992px) {
    .sidebar-sticky { /* تا 992px: sticky توسط offcanvas/نوار موبایل مدیریت می‌شود */ position: static; height: auto; }
    .profile-panel main { /* فاصله از بالا تا زیر نوار موبایل */ padding-top: 56px; }
}

@media (min-width: 993px) {
    /* از 992px به بالا: سایدبار ثابت کنار صفحه */
    .sidebar { position: sticky; top: var(--mk-header-h); align-self: flex-start; height: calc(100vh - var(--mk-header-h)); overflow: auto; }

    /* بدنهٔ offcanvas روی دسکتاپ کل ارتفاع ستون را بگیرد تا اسکرول داخلی روی منو کار کند */
    #sidebarMenu .offcanvas-body { height: 100%; max-height: 100%; overflow: hidden; /* اسکرول داخل .sidebar-sticky مدیریت می‌شود */ }

    .sidebar-sticky { position: static; height: 100%; max-height: 100%; overflow-y: auto; overflow-x: hidden; }
}

.sidebar .nav-link { font-weight: 500; color: #333; padding: .5rem 1rem; /* Adjust padding */ display: flex; /* Align icon and text */ align-items: center; /* Vertically center icon and text */ cursor: pointer; }

/* Adjust icon margin for RTL */
.sidebar .nav-link .bi { margin-left: .5rem; /* Add space between icon and text */ margin-right: 0; /* Reset LTR margin */ font-size: 1.1rem; /* Optional: Adjust icon size */ width: 20px; /* Ensure consistent icon spacing */ text-align: center; }

.sidebar .nav-link.active { color: var(--bs-primary); background-color: rgba(var(--bs-primary-rgb), 0.1); border-right: 3px solid var(--bs-primary); padding-right: calc(1rem - 3px); }

/* Active menu item - فقط سایدبار پروفایل (منوی اصلی هدر تحت تأثیر نباشد) */
.profile-panel .nav-item.active .nav-link { color: var(--C3) !important; background-color: rgba(var(--bs-secondary-rgb), 0.15) !important; border-right: 3px solid var(--C3) !important; padding-right: calc(1rem - 3px) !important; font-weight: 600; }

/* Dark theme active menu item */
.profile-panel[data-bs-theme="dark"] .nav-item.active .nav-link { color: var(--C3) !important; background-color: rgba(var(--bs-secondary-rgb), 0.2) !important; border-right: 3px solid var(--C3) !important; }

/* Hover effect for non-active items */
.profile-panel .nav-item:not(.active) .nav-link:hover { color: var(--C3) !important; background-color: rgba(var(--bs-secondary-rgb), 0.08) !important; transition: all 0.2s ease; }

.sidebar .nav-link:hover:not(.active) { color: var(--bs-primary); background-color: rgba(var(--bs-primary-rgb), 0.06); }


.sidebar-heading { font-size: .85rem; text-transform: uppercase; padding: .5rem 1rem; margin-top: 1rem; color: #6c757d; /* Muted color */ }

/* Style the mobile offcanvas width if needed */
.offcanvas-end { width: 280px; /* Adjust as needed */ }

#menuInner { padding: 0 }

.profile-panel .badge { color: unset }

.profile-panel h1, .profile-panel h2, .profile-panel h3, .profile-panel h4, .profile-panel h5, .profile-panel h6 { margin: 0 }

.profile-panel .card-header { align-items: center }

/* User box in sidebar */
.mk-userbox { background: var(--C8); border: 1px solid var(--C4); border-radius: 10px; }
.mk-userbox .mk-avatar { width: 36px; height: 36px; background: rgba(var(--bs-secondary-rgb), 0.15); color: var(--C3); }
.mk-userbox .mk-phone.ltr { direction: ltr; text-align: left; }

.uploadimgbox { margin: 2px 5px 20px; display: grid; min-height: 50px; min-width: 50px }
.uploadimgbox img { color: transparent; font-size: 1px }
.uploadimgdiv { min-height: 50px; text-align: center; background: #f1f1f1 url(/assets/images/main/loader-main.gif) center center no-repeat }
.uploadimg { width: 100% !important; width: auto; }
.uploadimgalt { padding: 1%; background-color: #f9f9f9; border-bottom: 1px solid silver; float: right; direction: rtl; text-align: center; font-size: 75%; font-weight: bold }
.uploadimgbox320 { display: inline-grid; float: right; margin: 1%; width: 100% }

.hide { display: none; visibility: hidden }
.vhide { visibility: hidden }

.modal-open { overflow: auto !important; padding: 0 !important }

.profile-panel .nav-item ul { background-color: var(--C2); padding: 10px; }

/* فقط پنل (مودال جستجو/ورود و ... تحت تأثیر نباشند) */
.profile-panel .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) { margin-right: calc(var(--bs-border-width) * -1); border-top-right-radius: 0; border-bottom-right-radius: 0; }


/* ==========================================
   Bootstrap Variables & Component Overrides
   فقط داخل پنل پروفایل تا روی منوی اصلی سایت اثر نگذارد.
   ========================================== */
.profile-panel { --bs-primary: var(--C1); --bs-secondary: var(--C3); --bs-primary-rgb: 3, 20, 40; --bs-secondary-rgb: 235, 158, 50; }
/* Buttons - فقط داخل پنل تا منوی اصلی تغییر رنگ ندهد */
.profile-panel .btn-primary { --bs-btn-color: var(--C2) !important; --bs-btn-bg: var(--C1) !important; --bs-btn-border-color: var(--C1) !important; --bs-btn-hover-color: var(--C2) !important; --bs-btn-hover-bg: var(--C3) !important; --bs-btn-hover-border-color: var(--C3) !important; --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb) !important; --bs-btn-active-color: var(--C2) !important; --bs-btn-active-bg: var(--C7) !important; --bs-btn-active-border-color: var(--C7) !important; --bs-btn-disabled-color: var(--C2) !important; --bs-btn-disabled-bg: var(--C5) !important; --bs-btn-disabled-border-color: var(--C5) !important; color: var(--C2) !important; background-color: var(--C1) !important; border-color: var(--C1) !important; }
.profile-panel .btn-primary:hover { color: var(--C2) !important; background-color: var(--C3) !important; border-color: var(--C3) !important; }
.profile-panel .btn-primary:active, .profile-panel .btn-primary.active { color: var(--C2) !important; background-color: var(--C7) !important; border-color: var(--C7) !important; }
.profile-panel .btn-primary:disabled, .profile-panel .btn-primary.disabled { color: var(--C2) !important; background-color: var(--C5) !important; border-color: var(--C5) !important; }
.profile-panel .btn-secondary { --bs-btn-color: var(--C2) !important; --bs-btn-bg: var(--C3) !important; --bs-btn-border-color: var(--C3) !important; --bs-btn-hover-color: var(--C2) !important; --bs-btn-hover-bg: var(--C1) !important; --bs-btn-hover-border-color: var(--C1) !important; --bs-btn-focus-shadow-rgb: var(--bs-secondary-rgb) !important; --bs-btn-active-color: var(--C2) !important; --bs-btn-active-bg: var(--C7) !important; --bs-btn-active-border-color: var(--C7) !important; --bs-btn-disabled-color: var(--C6) !important; --bs-btn-disabled-bg: var(--C4) !important; --bs-btn-disabled-border-color: var(--C4) !important; color: var(--C2) !important; background-color: var(--C3) !important; border-color: var(--C3) !important; }
.profile-panel .btn-secondary:hover { color: var(--C2) !important; background-color: var(--C1) !important; border-color: var(--C1) !important; }
.profile-panel .btn-secondary:active, .profile-panel .btn-secondary.active { color: var(--C2) !important; background-color: var(--C7) !important; border-color: var(--C7) !important; }
.profile-panel .btn-secondary:disabled, .profile-panel .btn-secondary.disabled { color: var(--C6) !important; background-color: var(--C4) !important; border-color: var(--C4) !important; }
.profile-panel .btn-outline-primary { --bs-btn-color: var(--C1) !important; --bs-btn-border-color: var(--C1) !important; --bs-btn-hover-color: var(--C2) !important; --bs-btn-hover-bg: var(--C1) !important; --bs-btn-hover-border-color: var(--C1) !important; --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb) !important; --bs-btn-active-color: var(--C2) !important; --bs-btn-active-bg: var(--C1) !important; --bs-btn-active-border-color: var(--C1) !important; --bs-btn-disabled-color: var(--C1) !important; --bs-btn-disabled-bg: transparent !important; --bs-btn-disabled-border-color: var(--C1) !important; color: var(--C1) !important; border-color: var(--C1) !important; background-color: transparent !important; }
.profile-panel .btn-outline-primary:hover { color: var(--C2) !important; background-color: var(--C1) !important; border-color: var(--C1) !important; }
.profile-panel .btn-outline-primary:active, .profile-panel .btn-outline-primary.active { color: var(--C2) !important; background-color: var(--C1) !important; border-color: var(--C1) !important; }
.profile-panel .btn-outline-primary:disabled, .profile-panel .btn-outline-primary.disabled { color: var(--C1) !important; background-color: transparent !important; border-color: var(--C1) !important; }
.profile-panel .btn-outline-secondary { --bs-btn-color: var(--C3) !important; --bs-btn-border-color: var(--C3) !important; --bs-btn-hover-color: var(--C2) !important; --bs-btn-hover-bg: var(--C3) !important; --bs-btn-hover-border-color: var(--C3) !important; --bs-btn-focus-shadow-rgb: var(--bs-secondary-rgb) !important; --bs-btn-active-color: var(--C2) !important; --bs-btn-active-bg: var(--C3) !important; --bs-btn-active-border-color: var(--C3) !important; --bs-btn-disabled-color: var(--C3) !important; --bs-btn-disabled-bg: transparent !important; --bs-btn-disabled-border-color: var(--C3) !important; color: var(--C3) !important; border-color: var(--C3) !important; background-color: transparent !important; }
.profile-panel .btn-outline-secondary:hover { color: var(--C2) !important; background-color: var(--C3) !important; border-color: var(--C3) !important; }
.profile-panel .btn-outline-secondary:active, .profile-panel .btn-outline-secondary.active { color: var(--C2) !important; background-color: var(--C3) !important; border-color: var(--C3) !important; }
.profile-panel .btn-outline-secondary:disabled, .profile-panel .btn-outline-secondary.disabled { color: var(--C3) !important; background-color: transparent !important; border-color: var(--C3) !important; }

/* Alerts - فقط پنل (مودال/هدر/فوتر تحت تأثیر نباشند) */
.profile-panel .alert-primary { --bs-alert-color: var(--C1); --bs-alert-bg: #cfe2ff; --bs-alert-border-color: #b6d4fe; }
.profile-panel .alert-secondary { --bs-alert-color: var(--C3); --bs-alert-bg: #e2e3e5; --bs-alert-border-color: #d3d6d8; }

/* Text & Backgrounds */
.profile-panel .text-secondary { color: var(--C3) !important; }
.profile-panel .bg-secondary { background-color: var(--C3) !important; }
.profile-panel .border-primary { border-color: var(--C1) !important; }
.profile-panel .border-secondary { border-color: var(--C3) !important; }

/* Forms */
.profile-panel .form-check-input:checked { background-color: var(--C1) !important; border-color: var(--C1) !important; }
.profile-panel .form-control:focus { border-color: var(--C3) !important; box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important; }

/* List Group */
.profile-panel .list-group-item.active { background-color: var(--C1); border-color: var(--C1); }
.profile-panel .list-group-item-action:hover, .profile-panel .list-group-item-action:focus { background-color: var(--C4); color: var(--C6); }

/* Badges */
.profile-panel .badge.bg-primary { background-color: var(--C1) !important; color: var(--C2) !important; }
.profile-panel .badge.bg-secondary { background-color: var(--C3) !important; color: var(--C2) !important; }
/* Badges در دارک مد حساب کاربری — تضمین کنتراست و خوانایی */
.profile-panel[data-bs-theme="dark"] .badge { color: #fff; }
.profile-panel[data-bs-theme="dark"] .badge:not([class*="bg-"]) { background-color: var(--C4); color: var(--C6); }
.profile-panel[data-bs-theme="dark"] .badge.bg-primary { background-color: var(--C3) !important; color: #fff !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-secondary { background-color: var(--C4) !important; color: var(--C6) !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-success { background-color: #198754 !important; color: #fff !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-danger { background-color: #dc3545 !important; color: #fff !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-warning { background-color: #ffc107 !important; color: #000 !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-info { background-color: #0dcaf0 !important; color: #000 !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-light { background-color: #e9ecef !important; color: #212529 !important; }
.profile-panel[data-bs-theme="dark"] .badge.bg-dark { background-color: #495057 !important; color: #fff !important; }

/* Dropdowns - منوی مگا/هدر تحت تأثیر نباشد */
.profile-panel .dropdown-item:hover, .profile-panel .dropdown-item:focus { background-color: var(--C1); color: var(--C2) !important; }
.profile-panel .dropdown-item.active, .profile-panel .dropdown-item:active { background-color: var(--C1); color: var(--C2) !important; }

/* Navs & Tabs */
.profile-panel .nav-pills .nav-link.active, .profile-panel .nav-pills .show > .nav-link { background-color: var(--C1); color: var(--C2); }
/* فقط داخل پنل تا منوی اصلی هدر (که nav-link دارد) رنگش عوض نشود */
.profile-panel .nav-link:hover, .profile-panel .nav-link:focus { color: var(--C3); }
.profile-panel .nav-tabs .nav-link.active, .profile-panel .nav-tabs .nav-item.show .nav-link { border-color: var(--C5) var(--C5) var(--C0); color: var(--C1); }

/* تب‌های روش ورود (صفحه لاگین) — دسکتاپ و موبایل حرفه‌ای */
.mk-auth-card .login-method-tabs {
    display: flex;
    gap: 8px;
    border: none;
    padding: 4px;
    background: rgba(0,0,0,.06);
    border-radius: 12px;
}
.profile-panel[data-bs-theme="dark"] .mk-auth-card .login-method-tabs { background: rgba(255,255,255,.06); }
.mk-auth-card .login-method-tabs .nav-item { margin: 0; }
.mk-auth-card .login-method-tabs .nav-link {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--mk-muted, #6c757d);
    background: transparent;
    transition: background .2s, color .2s;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mk-auth-card .login-method-tabs .nav-link:hover { color: var(--C1); background: rgba(255,255,255,.5); }
.profile-panel[data-bs-theme="dark"] .mk-auth-card .login-method-tabs .nav-link:hover { background: rgba(255,255,255,.08); color: var(--C6); }
.mk-auth-card .login-method-tabs .nav-link.active {
    background: var(--C1);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(11, 47, 91, .35);
}
.profile-panel[data-bs-theme="dark"] .mk-auth-card .login-method-tabs .nav-link.active { color: var(--C6) !important; box-shadow: 0 2px 12px rgba(0,0,0,.3); }
@media (max-width: 767px) {
    .mk-auth-card .login-method-tabs .nav-link { font-size: 0.55rem; }
    .mk-auth-card .login-method-tabs .nav-link i.ti { display: none; }
    .mk-auth-card .mk-header { padding: 0 !important; }
}

/* فوتر کارت ورود/ثبت‌نام — چیدمان تمیز و خوانا */
.mk-footer .mk-bottom-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 20px;
}
.mk-footer .mk-footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
}
.mk-footer .mk-footer-register { width: 100%; }
.mk-footer .mk-footer-rules { width: 100%; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.profile-panel[data-bs-theme="dark"] .mk-footer .mk-footer-rules { border-top-color: rgba(255,255,255,.06); }
.mk-footer .mk-footer-link {
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .2s, color .2s;
}
.mk-footer .mk-footer-link:hover { background: rgba(0,0,0,.06); }
.profile-panel[data-bs-theme="dark"] .mk-footer .mk-footer-link:hover { background: rgba(255,255,255,.08); }
@media (min-width: 576px) {
    .mk-footer .mk-bottom-links { flex-direction: row; justify-content: space-between; }
    .mk-footer .mk-footer-register { width: auto; }
    .mk-footer .mk-footer-rules { width: auto; padding-top: 0; border-top: none; padding-right: 12px; border-right: 1px solid rgba(255,255,255,.12); }
    .profile-panel[data-bs-theme="dark"] .mk-footer .mk-footer-rules { border-right-color: rgba(255,255,255,.08); }
}

/* Progress Bar */
.profile-panel .progress-bar { background-color: var(--C1); }

.mk-auth-wrap { min-height: 500px; display: flex; align-items: center; justify-content: center; padding: 0 32px }
.mk-auth-card { width: 100%; max-width: 440px; background: var(--mk-card); border-radius: 16px; border: 1px solid rgba(255,255,255,.06); box-shadow: 0 10px 30px rgba(0,0,0,.25) }
.mk-auth-card .mk-header { padding: 24px 24px 8px; text-align: center }
.mk-auth-card .mk-header img { max-width: 120px; opacity: .95 }
.mk-auth-card .mk-header h1 { font-size: 18px; margin: 12px 0 0; color: var(--mk-text) }
.mk-auth-card .mk-body { padding: 24px }

.mk-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; align-items: center; color: var(--mk-muted) }
.mk-bottom-links { gap: 12px }

/* Login/Register (mk-auth-wrap): لینک‌ها و btn-link با رنگ ثانویه */
.mk-auth-wrap a:not(.btn),
.mk-auth-wrap .btn-link {
    color: var(--C3);
}
.mk-auth-wrap a:not(.btn):hover,
.mk-auth-wrap .btn-link:hover,
.mk-auth-wrap a:not(.btn):focus,
.mk-auth-wrap .btn-link:focus {
    color: var(--C3);
    text-decoration: underline;
}

/* loader */
.mk-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: mkspin 1s linear infinite }

@keyframes mkspin {
    to { transform: rotate(360deg) }
}

.small, small { color: var(--mk-muted) }

/* Dark theme buttons - override for better visibility */
.profile-panel[data-bs-theme="dark"] .btn-primary {
    color: var(--C6) !important;
    background-color: var(--C1) !important;
    border-color: var(--C1) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-primary:hover {
    color: var(--C6) !important;
    background-color: var(--C3) !important;
    border-color: var(--C3) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-primary:active,
.profile-panel[data-bs-theme="dark"] .btn-primary.active {
    color: var(--C6) !important;
    background-color: var(--C7) !important;
    border-color: var(--C7) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-primary:disabled,
.profile-panel[data-bs-theme="dark"] .btn-primary.disabled {
    color: var(--C5) !important;
    background-color: var(--C4) !important;
    border-color: var(--C4) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-secondary {
    color: var(--C6) !important;
    background-color: var(--C3) !important;
    border-color: var(--C3) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-secondary:hover {
    color: var(--C6) !important;
    background-color: var(--C1) !important;
    border-color: var(--C1) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-secondary:active,
.profile-panel[data-bs-theme="dark"] .btn-secondary.active {
    color: var(--C6) !important;
    background-color: var(--C7) !important;
    border-color: var(--C7) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-outline-primary {
    color: var(--C3) !important;
    border-color: var(--C3) !important;
    background-color: transparent !important;
}

.profile-panel[data-bs-theme="dark"] .btn-outline-primary:hover {
    color: var(--C6) !important;
    background-color: var(--C3) !important;
    border-color: var(--C3) !important;
}

.profile-panel[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--C6) !important;
    border-color: var(--C3) !important;
    background-color: transparent !important;
}

.profile-panel[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: var(--C6) !important;
    background-color: var(--C3) !important;
    border-color: var(--C3) !important;
}

.profile-panel[data-bs-theme="dark"] .section-title { border-bottom: none; }

/* placeholder کم‌رنگ در حساب کاربری */
.profile-panel .form-control::placeholder,
.profile-panel input::placeholder,
.profile-panel textarea::placeholder { color: rgba(0,0,0,0.22) !important; opacity: 1; }
.profile-panel .form-control::-moz-placeholder,
.profile-panel input::-moz-placeholder,
.profile-panel textarea::-moz-placeholder { color: rgba(0,0,0,0.22) !important; opacity: 1; }
.profile-panel[data-bs-theme="dark"] .form-control::placeholder,
.profile-panel[data-bs-theme="dark"] input::placeholder,
.profile-panel[data-bs-theme="dark"] textarea::placeholder { color: rgba(255,255,255,0.22) !important; opacity: 1; }
.profile-panel[data-bs-theme="dark"] .form-control::-moz-placeholder,
.profile-panel[data-bs-theme="dark"] input::-moz-placeholder,
.profile-panel[data-bs-theme="dark"] textarea::-moz-placeholder { color: rgba(255,255,255,0.22) !important; opacity: 1; }

/* form-floating: پلیس‌هولدر شفاف */
.profile-panel .form-floating .form-control::placeholder,
.profile-panel .form-floating .form-control-plaintext::placeholder,
.profile-panel .form-floating input::placeholder,
.profile-panel .form-floating textarea::placeholder { color: transparent !important; opacity: 1; }
.profile-panel .form-floating .form-control::-moz-placeholder,
.profile-panel .form-floating .form-control-plaintext::-moz-placeholder,
.profile-panel .form-floating input::-moz-placeholder,
.profile-panel .form-floating textarea::-moz-placeholder { color: transparent !important; opacity: 1; }
.profile-panel .form-floating .form-control::-ms-input-placeholder,
.profile-panel .form-floating input::-ms-input-placeholder,
.profile-panel .form-floating textarea::-ms-input-placeholder { color: transparent !important; }
.profile-panel .form-floating .form-control::-webkit-input-placeholder,
.profile-panel .form-floating input::-webkit-input-placeholder,
.profile-panel .form-floating textarea::-webkit-input-placeholder { color: transparent !important; }

/* دکمه ارسال کد تایید و تایید و ورود — رنگ تاکیدی (C3) فقط در دارک‌مود، متن روشن */
.profile-panel[data-bs-theme="dark"] .btn-send-code {
    background-color: var(--C3) !important;
    border-color: var(--C3) !important;
    color: #fff !important;
}
.profile-panel[data-bs-theme="dark"] .btn-send-code:hover:not(:disabled),
.profile-panel[data-bs-theme="dark"] .btn-send-code:focus {
    background-color: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(39, 73, 115, 0.35);
}
.profile-panel[data-bs-theme="dark"] .btn-login-verify {
    background-color: var(--C3) !important;
    border-color: var(--C3) !important;
    color: #fff !important;
}
.profile-panel[data-bs-theme="dark"] .btn-login-verify:hover:not(:disabled),
.profile-panel[data-bs-theme="dark"] .btn-login-verify:focus {
    background-color: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(39, 73, 115, 0.35);
}

/* لیست کارتی — حساب‌های بانکی و آدرس‌ها */
.profile-panel .profile-list-page { padding: 0; }
.profile-panel .profile-list-loader,
.profile-panel .profile-list-empty { min-height: 120px; }
.profile-panel .profile-list-card {
    border-radius: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.profile-panel .profile-list-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1) !important;
}
.profile-panel[data-bs-theme="dark"] .profile-list-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.35) !important;
}
.profile-panel .profile-list-dl { display: grid; gap: 0.5rem 1rem; }
.profile-panel .profile-list-dl > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.5rem; }
.profile-panel .profile-list-dl dt {
    font-size: 0.75rem;
    color: var(--mk-muted, #6c757d);
    font-weight: 600;
    margin: 0;
    flex-shrink: 0;
}
.profile-panel .profile-list-dl dd {
    margin: 0;
    font-size: 0.9rem;
    word-break: break-word;
}
.profile-panel .profile-list-card .card-footer { padding: 0.75rem 1rem; }
.profile-panel .profile-list-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

