/* فونت وزیرمتن — میزبانی محلی (بدون وابستگی به CDN — قابل اطمینان در ایران) */
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* =====================================================================
   TATvip Panel — Design System v26.1 (Aurora Violet)
   بازطراحی کامل رابط کاربری | RTL | Light + Dark
   قاعده: همه کلاس‌های نسخه قبلی حفظ شده‌اند + کلاس‌های جدید اضافه شده‌اند
   ===================================================================== */

:root {
    --bg: #f4f3fb;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(var(--brand2-rgb), .11), transparent 60%),
               radial-gradient(900px 500px at -10% 110%, rgba(var(--brand1-rgb), .08), transparent 60%);
    --surface: #ffffff;
    --surface-2: #f8f7fd;
    --surface-3: #f0eef9;
    --border: #e6e3f3;
    --border-strong: #d6d1ec;
    --text: #17132e;
    --text-dim: #5f5a7d;
    --text-faint: #9d97ba;

    --navy: #140f28;
    --navy-2: #1b1438;
    --navy-3: #251c4d;
    --navy-line: rgba(255, 255, 255, .08);

    --accent: #7c3aed;
    --accent-2: #a855f7;
    --accent-dark: #6d28d9;
    --accent-soft: #ede6fd;

    --warn: #d97706;
    --warn-2: #f59e0b;
    --warn-soft: #fdf1dc;
    --danger: #e11d48;
    --danger-2: #f43f5e;
    --danger-soft: #fde8ee;
    --success: #059669;
    --success-2: #10b981;
    --success-soft: #d8f3e8;
    --blue: #0891b2;
    --blue-soft: #dcf3f9;
    --purple: #9333ea;
    --purple-soft: #f1e8fe;

    --brand-pink: #d946ef;
    --brand-purple: #8b5cf6;
    --brand-gradient: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    --brand-soft: #f4ebfe;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 1px 2px rgba(35, 24, 74, .05), 0 8px 24px -12px rgba(35, 24, 74, .14);
    --shadow-lg: 0 4px 10px -4px rgba(35, 24, 74, .10), 0 24px 48px -16px rgba(35, 24, 74, .20);
    --ring: 0 0 0 3px rgba(var(--accent-rgb), .18);
    --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
    --bg: #0d0a1b;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(var(--accent2-rgb), .08), transparent 60%),
               radial-gradient(900px 500px at -10% 110%, rgba(var(--brand1-rgb), .05), transparent 60%);
    --surface: #161129;
    --surface-2: #1c1633;
    --surface-3: #241c40;
    --border: #2b2149;
    --border-strong: #3a2d63;
    --text: #edeaf8;
    --text-dim: #b0a9cf;
    --text-faint: #756e97;

    --navy: #0a0716;
    --navy-2: #120d24;
    --navy-3: #1a1330;
    --navy-line: rgba(255, 255, 255, .07);

    --accent-soft: #2b1c52;
    --warn-soft: #38250a;
    --danger-soft: #431423;
    --success-soft: #0c2e21;
    --blue-soft: #0e2e3a;
    --purple-soft: #2a1c50;
    --brand-soft: #2a1c50;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 4px 12px -4px rgba(0, 0, 0, .5), 0 28px 56px -18px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(var(--accent2-rgb), .28);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; direction: rtl; }
/* v28.89: جای نوار اسکرول همیشه رزرو می‌شود؛ وقتی طول صفحه از ارتفاع پنجره رد/کم می‌شود
   (مثلاً بعد از رسم فهرست تیکت‌ها با جاوااسکریپت یا عوض‌کردن فیلتر) کل صفحه و نوار بالا به پهلو نمی‌پرد */
html { scrollbar-gutter: stable; }
body {
    margin: 0;
    font-family: Vazirmatn, 'Segoe UI', Tahoma, sans-serif;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { margin: 0; line-height: 1.5; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
::selection { background: rgba(var(--accent-rgb), .25); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 130, 155, .35); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 130, 155, .6); background-clip: padding-box; }

.mono { font-family: 'Vazirmatn', ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.dim { color: var(--text-faint); font-size: 11.5px; font-weight: 500; display: block; }
.full { width: 100%; }
.help-text { font-size: 11.5px; color: var(--text-faint); line-height: 1.9; margin: 6px 0; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--text-dim); flex-shrink: 0; }
.kv-row .v { font-weight: 600; text-align: start; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px 20px; }

/* صفحه «مشاهده کاربر»: ستون اصلی + ریل کناری جمع‌وجور در دسکتاپ؛ تک‌ستون در تبلت/موبایل */
.cv-layout { grid-template-columns: minmax(0, 1fr); align-items: start; }
.cv-layout > div { min-width: 0; }
@media (min-width: 1100px) {
    .cv-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; }
}

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-inline-start: 262px;
    transition: margin var(--transition);
}
.content { padding: 22px 26px 40px; flex: 1; animation: content-in .3s ease both; }
@keyframes content-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 262px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy) 100%);
    border-inline-end: 1px solid var(--navy-line);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 60;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 13px;
    background: var(--brand-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    box-shadow: 0 6px 16px -4px rgba(var(--brand2-rgb), .55);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.brand-sub { color: rgba(255, 255, 255, .45); font-size: 10.5px; margin-top: 1px; }
.brand-dot { display: none; }

.nav-group-title {
    color: rgba(255, 255, 255, .34);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    padding: 16px 20px 6px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 1px 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .62);
    font-size: 12.8px;
    font-weight: 500;
    position: relative;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .30), rgba(var(--brand1-rgb), .20));
    color: #fff;
    font-weight: 700;
}
.nav-link.active::before {
    content: '';
    position: absolute;
    inset-inline-start: -10px;
    top: 20%;
    bottom: 20%;
    width: 3.5px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--accent-2), var(--brand-pink));
}
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-badge-soon {
    margin-inline-start: auto;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .09);
    color: rgba(255, 255, 255, .65);
    border: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-foot { margin-top: auto; padding: 14px 18px 16px; color: rgba(255,255,255,.3); font-size: 10px; border-top: 1px solid var(--navy-line); }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(7, 10, 24, .55); backdrop-filter: blur(2px); z-index: 55; opacity: 0; transition: opacity .2s; }
.sidebar-backdrop.open { opacity: 1; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 26px;
    /* v27.8 — با viewport-fit=cover روی آیفون ناچ‌دار، نوار زیر status bar نمی‌رود */
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; min-width: 0; }
.topbar-title .dim { display: block; font-size: 11px; font-weight: 500; margin-top: 1px; }
.topbar-user { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.topbar-userbox {
    display: flex; align-items: center; gap: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px 6px;
    padding-inline-end: 13px;
    max-width: 200px;
}
.topbar-userbox .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.topbar-usermeta { min-width: 0; }
.topbar-username { font-size: 12.5px; font-weight: 700; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-userrole { font-size: 10.5px; color: var(--text-faint); line-height: 1.4; white-space: nowrap; }
.avatar {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--brand-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px -3px rgba(var(--brand2-rgb), .5);
}
.mobile-menu-btn {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    width: 38px; height: 38px;
    border-radius: 11px;
    font-size: 17px;
    cursor: pointer;
    align-items: center; justify-content: center;
    transition: var(--transition);
}
.mobile-menu-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
/* v28.52 — کارت‌های گرادیانی: سایهٔ ملایم رنگی گوشهٔ بالا و درخشش لبه در هاور */
.panel-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition), border-color var(--transition);
    background-image: linear-gradient(155deg, rgba(var(--accent-rgb), .05), rgba(var(--accent2-rgb), .015) 38%, transparent 62%);
}
.panel-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.panel-card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 15px 18px 13px;
    border-bottom: 1px solid var(--border);
    position: relative;
    background:
        linear-gradient(90deg, rgba(var(--accent-rgb), .085), rgba(var(--accent2-rgb), .03) 45%, transparent 75%),
        linear-gradient(180deg, var(--surface-2), var(--surface));
}
/* نوار گرادیانی برند در لبهٔ راست سرکارت */
.panel-card-header::before {
    content: '';
    position: absolute;
    inset-inline-start: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--brand-gradient);
    opacity: .85;
}
.panel-card-title { font-size: 14px; font-weight: 800; }
.panel-card-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.panel-card-body { padding: 16px 18px; }
.panel-card > .panel-card-title { padding: 15px 18px 13px; border-bottom: 1px solid var(--border); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mt { margin-top: 16px; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat-card { position: relative; overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
/* v28.52 — کارت‌های آماری گرادیانی: ته‌رنگ برند در گوشه و درخشش نوار کنار */
.stat-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(var(--accent-rgb), .07), rgba(var(--accent2-rgb), .02) 45%, transparent 70%);
    pointer-events: none;
}
.stat-card::after {
    content: '';
    position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3.5px;
    background: var(--accent);
    opacity: .8;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-label { font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.stat-value { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.stat-delta { font-size: 10.5px; }
.stat-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.icon-teal { background: var(--accent-soft); color: var(--accent); }
.icon-blue { background: var(--blue-soft); color: var(--blue); }
.icon-purple { background: var(--purple-soft); color: var(--purple); }
.icon-warn { background: var(--warn-soft); color: var(--warn); }
.icon-danger { background: var(--danger-soft); color: var(--danger); }
.icon-success { background: var(--success-soft); color: var(--success); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 18px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 2px 8px -2px rgba(var(--accent-rgb), .45);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition), background var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px -4px rgba(var(--accent-rgb), .5); color: #fff; }
.btn:active { transform: translateY(0); filter: brightness(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 2px 8px -2px rgba(220, 38, 38, .4);
}
.btn-danger:hover { box-shadow: 0 6px 16px -4px rgba(220, 38, 38, .5); }
.btn-accent { background: var(--brand-gradient); box-shadow: 0 2px 10px -2px rgba(var(--brand2-rgb), .5); }
.btn-accent:hover { box-shadow: 0 6px 18px -4px rgba(var(--brand2-rgb), .6); }
.btn-sm { padding: 5px 11px; font-size: 11px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-logout {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font: inherit; font-size: 11.5px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
label { font-size: 12px; font-weight: 700; color: var(--text-dim); display: block; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=password], input[type=email], input[type=date], input[type=url], input[type=tel], select, textarea {
    width: 100%;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    padding: 9px 13px;
    font: inherit;
    font-size: 12.8px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); cursor: not-allowed; color: var(--text-dim); }
textarea { min-height: 90px; resize: vertical; line-height: 1.9; }
select { cursor: pointer; }
input[type=file] { font-size: 11.5px; color: var(--text-dim); }
input[type=file]::file-selector-button {
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 12px;
    margin-inline-end: 10px;
    font: inherit; font-size: 11px; font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
input[type=file]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 16px; }
.form-section-title {
    font-size: 12.5px; font-weight: 800;
    color: var(--accent-dark);
    margin: 18px 0 12px;
    padding-inline-start: 10px;
    border-inline-start: 3px solid var(--accent);
    border-radius: 2px;
}
.form-section-title:first-child { margin-top: 0; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--text); cursor: pointer; padding: 6px 0; }
.check-row input { flex-shrink: 0; }

.search-box { position: relative; }
.search-box input { padding-inline-start: 36px; }
.search-box::before {
    content: '⌕';
    position: absolute;
    inset-inline-start: 12px; top: 50%;
    transform: translateY(-54%);
    font-size: 17px;
    color: var(--text-faint);
    pointer-events: none;
}

.filter-tabs { display: inline-flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 12px; border: 1px solid var(--border); flex-wrap: wrap; }
.filter-tabs a, .filter-tabs .filter-tab {
    padding: 6px 14px;
    border-radius: 9px;
    font-size: 11.8px;
    font-weight: 700;
    color: var(--text-dim);
    transition: var(--transition);
}
.filter-tabs a:hover { color: var(--text); }
.filter-tabs a.active, .filter-tabs .filter-tab.active { background: var(--surface); color: var(--accent-dark); box-shadow: var(--shadow); }
.duration-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.type-pill-select select { min-width: 130px; }

.icon-choice { display: flex; gap: 10px; flex-wrap: wrap; }
.icon-radio {
    flex: 1; min-width: 130px;
    display: flex; align-items: center; gap: 9px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    cursor: pointer;
    font-size: 12.3px; font-weight: 600;
    transition: var(--transition);
    background: var(--surface);
}
.icon-radio:hover { border-color: var(--accent); }
.icon-radio.selected, .icon-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.icon-radio input { margin: 0; }

.file-drop {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 22px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    background: var(--surface-2);
    transition: var(--transition);
    cursor: pointer;
}
.file-drop:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead th {
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--surface-2);
    padding: 11px 14px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-name { font-weight: 700; font-size: 12.8px; }
.cell-sub { font-size: 10.8px; color: var(--text-faint); margin-top: 1px; }
.cell-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.table-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-pos { color: var(--success); }
.table-neg { color: var(--danger); }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 12px; font-weight: 600;
    padding: 0 8px;
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.7;
    white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 99px; background: currentColor; opacity: .7; }
.badge-gray { background: var(--surface-3); color: var(--text-dim); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Alerts ---------- */
.alert {
    /* v28.79: block به‌جای flex — قبلاً هر تکهٔ متن و هر لینک داخل هشدار یک ستون جدا می‌شد و متن به‌هم‌ریخته دیده می‌شد */
    display: block;
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: 12.5px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    line-height: 1.9;
}
.alert a { font-weight: 700; text-decoration: underline; }
.alert { overflow-wrap: anywhere; word-break: normal; }
.alert > div + div { margin-top: 4px; }
.alert > form { display: inline-block; margin: 6px 0 0 6px; vertical-align: middle; }
/* v28.79: هشدار ساخت‌یافته (آیکون + متن + دکمه) */
.alert.alert-row { display: flex; align-items: flex-start; gap: 10px; }
.alert-row .alert-ic { flex: 0 0 auto; font-size: 18px; line-height: 1.5; }
.alert-row .alert-body { flex: 1 1 auto; min-width: 0; }
.alert-row .alert-body b { font-weight: 800; }
.alert-row .alert-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.alert-row .alert-actions .btn { text-decoration: none; }
@media (max-width: 560px) { .alert.alert-row { gap: 8px; padding: 11px 12px; } .alert-row .alert-actions .btn { flex: 1 1 auto; justify-content: center; } }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-warn, .alert-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 22%, transparent); }

/* ---------- Misc components ---------- */
.empty-state {
    text-align: center;
    padding: 42px 20px;
    color: var(--text-faint);
    font-size: 12.5px;
    line-height: 2.2;
}
.empty-state::before {
    content: '⌀';
    display: block;
    font-size: 34px;
    margin-bottom: 6px;
    opacity: .4;
}
.buyer-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.buyer-row:hover { background: var(--surface-2); }
.buyer-row:last-child { border-bottom: 0; }
.buyer-rank {
    width: 30px; height: 30px; flex-shrink: 0;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    background: var(--surface-3);
    color: var(--text-dim);
}
.buyer-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.buyer-rank.silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.buyer-rank.bronze { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.buyer-name { font-weight: 700; font-size: 12.8px; }
.buyer-meta { font-size: 10.8px; color: var(--text-faint); margin-top: 2px; display: flex; align-items: center; }
.buyer-amount { margin-inline-start: auto; font-weight: 800; font-size: 12.8px; white-space: nowrap; }

.balance-pos { color: var(--success); font-weight: 700; }
.balance-neg { color: var(--danger); font-weight: 700; }

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.toolbar .search-box { flex: 1; min-width: 170px; max-width: 320px; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quick-link-card {
    display: flex; align-items: center; gap: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-weight: 700; font-size: 12.5px;
    color: var(--text);
    transition: var(--transition);
    box-shadow: var(--shadow);
}
.quick-link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); color: var(--accent-dark); }
.quick-link-card .stat-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }

/* ---------- Auth pages ---------- */
.auth-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-visual {
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
    color: #fff;
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 56px;
    position: relative;
    overflow: hidden;
}
.auth-visual::before, .auth-visual::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}
.auth-visual::before { width: 420px; height: 420px; background: rgba(var(--brand2-rgb), .35); top: -120px; inset-inline-end: -120px; }
.auth-visual::after { width: 360px; height: 360px; background: rgba(var(--brand2-rgb), .3); bottom: -100px; inset-inline-start: -80px; }
.auth-feature-list { list-style: none; padding: 0; margin: 22px 0 0; position: relative; z-index: 1; }
.auth-feature-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; color: rgba(255,255,255,.85); }
.auth-feature-list li::before {
    content: '✓';
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 8px;
    background: rgba(var(--accent2-rgb), .18);
    color: var(--accent-2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
}
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 34px 30px;
}
.auth-form-card h1 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-box {
    width: 100%; max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px 28px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .brand-logo { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 16px; }
.login-brand .brand-logo svg { width: 27px; height: 27px; }
.login-brand h1 { font-size: 18px; font-weight: 800; }
.login-brand p { font-size: 11.5px; color: var(--text-faint); margin: 4px 0 0; }

/* ---------- Customer portal ---------- */
.customer-body { background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; }
/* ظرف مرکزی محتوا — بازسازی رفتار نسخه اصلی (بلوک وسط‌چین؛ عامل خرابی دسکتاپ در v25.0 همین بود) */
.customer-wrap { max-width: 1080px; margin: 0 auto; }
.customer-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 250px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    border-inline-end: 1px solid var(--navy-line);
    padding: 20px 0;
    display: flex; flex-direction: column;
    z-index: 60;
    overflow-y: auto;
}
.customer-main { flex: 1; margin-inline-start: 250px; padding: 26px 30px 90px; min-width: 0; }
.cs-brand { display: flex; align-items: center; gap: 11px; padding: 0 20px 18px; }
.cs-brand-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--brand-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    box-shadow: 0 6px 16px -4px rgba(var(--brand2-rgb), .55);
}
.cs-brand-icon svg { width: 21px; height: 21px; }
.cs-brand-name { color: #fff; font-weight: 800; font-size: 14.5px; }
.cs-brand-sub { color: rgba(255,255,255,.45); font-size: 10px; }
.cs-user-type { color: rgba(255,255,255,.5); font-size: 10px; font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-nav { display: flex; flex-direction: column; padding: 6px 10px; }
.cs-nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .62);
    font-size: 12.8px; font-weight: 500;
    transition: var(--transition);
}
.cs-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.cs-nav-link.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .30), rgba(var(--brand1-rgb), .20));
    color: #fff; font-weight: 700;
}
.cs-nav-icon { width: 20px; display: inline-flex; justify-content: center; }
.cs-nav-icon svg { width: 17px; height: 17px; }
.cs-user-footer { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid var(--navy-line); }
.cs-user-name { color: #fff; font-size: 12.5px; font-weight: 700; }
.cs-logout { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.5); font-size: 11px; margin-top: 6px; transition: var(--transition); }
.cs-logout:hover { color: var(--danger-2); }

.cs-wallet-card {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent) 55%, var(--accent-2));
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 30px -10px rgba(var(--accent-rgb), .5);
    margin-bottom: 18px;
}
.cs-wallet-card::after {
    content: '';
    position: absolute;
    width: 190px; height: 190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    top: -80px; inset-inline-end: -50px;
}
.cs-wallet-label { font-size: 11px; opacity: .85; }
.cs-wallet-amount { font-size: 24px; font-weight: 800; margin: 2px 0 12px; }
.cs-wallet-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    padding: 7px 16px;
    border-radius: 99px;
    font-size: 11.5px; font-weight: 700;
    transition: var(--transition);
}
.cs-wallet-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.cs-wallet-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 800;
    background: linear-gradient(135deg, rgba(var(--accent2-rgb), .34), rgba(var(--accent2-rgb), .16));
    border: 1px solid rgba(var(--accent2-rgb), .5);
    padding: 7px 13px;
    border-radius: 99px;
    color: #fff;
    white-space: nowrap;
    transition: var(--transition);
}
.cs-wallet-chip:hover { background: linear-gradient(135deg, rgba(var(--accent2-rgb), .48), rgba(var(--accent2-rgb), .26)); color: #fff; }
.cs-wallet-chip svg { width: 12px; height: 12px; opacity: .92; flex-shrink: 0; }

.cs-mobile-topbar {
    display: none;
    align-items: center; justify-content: space-between; gap: 10px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%);
    padding: 11px 14px;
    padding-top: calc(11px + env(safe-area-inset-top, 0px));
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 10px 26px -16px rgba(7, 10, 24, .85);
}
.cs-mobile-brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.cs-mobile-brand-icon { width: 34px; height: 34px; border-radius: 11px; }
.cs-mobile-brand-icon svg { width: 19px; height: 19px; }
.cs-mobile-brand-text { min-width: 0; }
.cs-mobile-site { color: #fff; font-weight: 800; font-size: 13.5px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-mobile-user { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 1px; }
.cs-mobile-user-av {
    width: 17px; height: 17px; border-radius: 99px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    color: #fff; font-size: 8.5px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.cs-mobile-user-name {
    font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .82);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 42vw;
}
.cs-mobile-user-type { font-size: 9.5px; font-weight: 600; color: color-mix(in srgb, var(--accent-light) 85%, transparent); white-space: nowrap; flex-shrink: 0; }
.cs-mobile-user-type::before { content: '\00B7'; margin-inline-end: 4px; color: rgba(255, 255, 255, .35); }
.cs-mobile-icon-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 15px; transition: var(--transition); flex-shrink: 0; }
.cs-mobile-icon-btn:active { transform: scale(.93); background: rgba(255,255,255,.2); }
.cs-mobile-actions { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
.cs-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; inset-inline: 0;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    z-index: 55;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.cs-bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px;
    border-radius: 10px;
    font-size: 10px; font-weight: 700;
    color: var(--text-faint);
    transition: var(--transition);
}
.cs-bottom-nav a.active { color: var(--accent); background: var(--accent-soft); }
.cs-bottom-nav a svg { width: 19px; height: 19px; }
.cs-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--brand-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
}

.greet-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.greet-avatar { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.greet-text { flex: 1; min-width: 190px; }
.greet-name { font-size: 17px; font-weight: 800; line-height: 1.6; }
.greet-sub { color: var(--text-faint); font-size: 11.5px; font-weight: 500; margin-top: 3px; display: block; line-height: 1.9; }
.greet-badge { margin-inline-start: auto; }

.balance-hero {
    background: linear-gradient(135deg, var(--navy), var(--navy-3));
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
}
.balance-hero::after { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(var(--brand1-rgb), .16); top: -80px; inset-inline-end: -60px; filter: blur(10px); }

/* ---------- Shop / products ---------- */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex; flex-direction: column; gap: 8px;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.p-name { font-weight: 800; font-size: 13.5px; }
.p-meta { font-size: 11px; color: var(--text-dim); }
.p-price { font-size: 16px; font-weight: 800; color: var(--accent-dark); margin-top: auto; }

.compact-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.compact-plan {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
    position: relative;
    display: flex; flex-direction: column; gap: 6px;
}
.compact-plan:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.compact-plan-title { font-weight: 800; font-size: 13.5px; }
.compact-plan-sub { font-size: 11px; color: var(--text-dim); line-height: 2; }
.compact-plan-price { font-size: 17px; font-weight: 800; color: var(--accent-dark); margin-top: 4px; }
.compact-plan-info { font-size: 11px; color: var(--text-faint); }
.buy-form { margin-top: 10px; }

.pay-options { display: flex; gap: 10px; flex-wrap: wrap; }
.qi { font-size: 11px; color: var(--text-faint); }

/* ---------- Service cards ---------- */
.service-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.service-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.service-card-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.config-ring { width: 64px; height: 64px; flex-shrink: 0; position: relative; }
.config-ring-inner {
    position: absolute; inset: 6px;
    border-radius: 50%;
    background: var(--surface);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; line-height: 1.4;
}
.config-meta { font-size: 11px; color: var(--text-faint); }
.config-name { font-weight: 800; font-size: 13px; }
.config-link-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    margin-top: 6px;
}
.config-link-text, .service-link-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; direction: ltr; text-align: left; color: var(--accent); }
.server-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 10px; font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
}
.service-credentials { margin-top: 6px; font-size: 11.5px; color: var(--text-dim); }
.service-location-links > summary { cursor: pointer; color: var(--purple); font-size: 11.5px; font-weight: 700; list-style: none; }
.service-location-links > summary::-webkit-details-marker { display: none; }
.service-location-links > summary::before { content: '▸ '; }
.service-location-links[open] > summary::before { content: '▾ '; }
.service-location-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.service-direct-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.service-direct-actions form { display: flex; align-items: center; gap: 7px; margin: 0; }
.service-note-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.service-note-form input[type=text] { flex: 1; min-width: 150px; font-size: 12px; }
.service-settled-check { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11.5px; color: var(--text-dim); }
.service-pending-delete { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; }
.service-danger { color: var(--danger) !important; }
.service-mobile-rail { display: contents; }

/* ---------- Receipts / tickets ---------- */
.receipt-thumb {
    width: 64px; height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: var(--transition);
}
.receipt-thumb:hover { transform: scale(1.06); box-shadow: var(--shadow-lg); }
.order-note-details > summary { cursor: pointer; font-size: 11.5px; color: var(--purple); font-weight: 700; }
.order-note-details > summary::-webkit-details-marker { display: none; }
.order-note-form { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Toast / modal / new components ---------- */
.toast-stack { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.toast {
    display: flex; align-items: center; gap: 10px;
    white-space: pre-line; /* v28.89: پیام‌های چندخطی (مثل تأیید تمدید) خط‌به‌خط نمایش داده شوند */
    background: var(--navy-2);
    color: #fff;
    border: 1px solid var(--navy-line);
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    font-size: 12.5px; font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease both;
    max-width: 340px;
}
[data-theme="dark"] .toast { background: var(--surface-3); }
.toast-success { border-inline-start: 3.5px solid var(--success-2); }
.toast-error { border-inline-start: 3.5px solid var(--danger-2); }
.toast-info { border-inline-start: 3.5px solid var(--blue); }
.toast.hide { animation: toast-out .22s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(7, 10, 24, .55);
    backdrop-filter: blur(3px);
    z-index: 900;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: content-in .18s ease both;
}
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 440px;
    padding: 22px;
    animation: modal-in .2s ease both;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 14.5px; font-weight: 800; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 18px; }

.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton { to { background-position: -200% 0; } }

.copy-btn {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 4px 9px;
    font: inherit; font-size: 10.5px; font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    /* سایدبار آفسکرین نباید اسکرول افقی صفحه‌سازی کند */
    html, body { overflow-x: clip; }
    .main { margin-inline-start: 0; }
    /* visibility: سایدبار جمع‌شده فضای اسکرول افقی ایجاد نکند */
    .sidebar { transform: translateX(100%); transition: transform .25s ease, visibility 0s linear .25s; box-shadow: none; width: 272px; visibility: hidden; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); visibility: visible; transition: transform .25s ease, visibility 0s; }
    .sidebar-backdrop { display: block; pointer-events: none; }
    .sidebar-backdrop.open { pointer-events: auto; }
    .mobile-menu-btn { display: inline-flex; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .content { padding: 14px 12px 30px; }
    .topbar { padding: 9px 12px; gap: 8px; }
    .topbar-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-usermeta { display: none; }
    .topbar-userbox { background: transparent; border: none; padding: 0; gap: 0; max-width: none; }
    .topbar-userbox .avatar { width: 34px; height: 34px; border-radius: 10px; }
    .topbar-logout-label { display: none; }
    .btn-logout { padding: 7px 9px; }
    .card { padding: 14px 13px; border-radius: var(--radius-sm); }
    .panel-card-header { flex-wrap: wrap; gap: 8px 10px; }
    .panel-card-body { padding: 14px 13px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-value { font-size: 17px; overflow-wrap: anywhere; }
    .stat-icon { width: 33px; height: 33px; font-size: 15px; }
    .compact-plan-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .compact-plan { padding: 13px; }
    .compact-plan-title { font-size: 12.5px; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .data-table { font-size: 12px; }
    .data-table thead th, .data-table tbody td { padding: 9px 10px; }
    .cell-actions .btn-sm { padding: 4px 8px; font-size: 10px; }
    .toolbar { padding: 11px 13px; }
    .buyer-row { padding: 10px 13px; }
    .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .quick-link-card { padding: 12px 13px; font-size: 11.8px; }
    .empty-state { padding: 30px 14px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
    .greet-card { gap: 11px; padding: 14px 15px; }
    .greet-avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }
    .greet-name { font-size: 15px; }
    .greet-sub { font-size: 10.8px; }
    .greet-badge { margin-inline-start: 0; }
    .cs-mobile-user-name { max-width: 34vw; }
    .cs-mobile-actions .cs-wallet-chip { padding: 7px 11px; font-size: 11px; }
}

/* Customer portal mobile */
@media (max-width: 900px) {
    .customer-sidebar { display: none; }
    .customer-main { margin-inline-start: 0; padding: 18px 14px calc(76px + env(safe-area-inset-bottom)); }
    .cs-mobile-topbar { display: flex; }
    .cs-bottom-nav { display: flex; }
}

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .btn, .row-actions, .pagination, .cs-bottom-nav, .cs-mobile-topbar { display: none !important; }
    .main, .customer-main { margin: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ccc; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   v27.0 — زنگوله اعلان‌ها + پیش‌نمایش منوی ربات + انتخاب‌گر رنگی
   ===================================================================== */
.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: color .18s, border-color .18s, background .18s;
    flex-shrink: 0;
}
.topbar-bell:hover, .topbar-bell:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.topbar-bell-badge {
    position: absolute;
    top: -5px;
    inset-inline-start: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger, #e11d48);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(225, 29, 72, .4);
}

/* پیش‌نمایش زنده منوی ربات (صفحه ربات تلگرام) */
.tg-preview {
    background: linear-gradient(160deg, #17212b, #0e1621);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(var(--accent-rgb), .25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.tg-preview-head {
    padding: 12px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: rgba(var(--accent-rgb), .28);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.tg-preview-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tg-preview-msg {
    align-self: flex-start;
    max-width: 85%;
    background: rgba(255, 255, 255, .08);
    color: #e9ecf2;
    font-size: 12px;
    line-height: 1.9;
    padding: 9px 13px;
    border-radius: 4px 14px 14px 14px;
    overflow-wrap: anywhere;
}
.tg-preview-row {
    display: grid;
    gap: 7px;
}
.tg-preview-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #dfe3ea;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 8px;
    border-radius: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* v27.1 — چیپ‌های همیشه رنگی انتخاب‌گر ایموجی + چیپ آیکون لیست دکمه‌ها */
.icon-choice.sel {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent-soft), 0 2px 8px rgba(var(--accent-rgb), .25);
    transform: scale(1.06);
}
.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--border);
    font-size: 15px;
    flex-shrink: 0;
}

/* v27.1 — زنگوله اعلان: نبض بج + بج زنگوله کاربر در تاپ‌بار موبایل */
@keyframes notifBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.22); }
}
.topbar-bell-badge, .cs-notif-badge {
    animation: notifBadgePulse 1.6s ease-in-out infinite;
}
.cs-notif-btn {
    position: relative;
}
.cs-notif-badge {
    position: absolute;
    top: -4px;
    inset-inline-start: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(225, 29, 72, .4);
    animation: notifBadgePulse 1.6s ease-in-out infinite;
}
@media (max-width: 640px) {
    .topbar-bell { width: 34px; height: 34px; border-radius: 10px; }
}

/* =====================================================================
   v27.2 — موبایل حرفه‌ای جدول‌ها + بازطراحی صفحه ربات + رنگ واقعی دکمه‌ها
   ===================================================================== */

/* انتخاب‌گر آیکون ربات (شبکه‌ای تمیز، بدون ایموجی دایره رنگی) */
.tg-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 7px; }
.tg-icon-cell {
    position: relative; display: flex; align-items: center; justify-content: center;
    height: 44px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--surface-2); font-size: 19px; cursor: pointer;
    transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.tg-icon-cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.tg-icon-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent-soft); }
.tg-icon-cell input { position: absolute; opacity: 0; pointer-events: none; }

/* انتخاب‌گر رنگ پس‌زمینه دکمه (پالت واقعی رنگ) */
.tg-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tg-color-swatch {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 9px 11px; border-radius: 11px; border: 1px solid var(--border);
    cursor: pointer; background: var(--surface-2);
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tg-color-swatch:hover { transform: translateY(-1px); border-color: var(--accent); }
.tg-color-swatch.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tg-color-swatch .dot { width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; box-shadow: inset 0 -3px 6px rgba(0,0,0,.18); }
.tg-color-swatch .cname { font-size: 11.5px; font-weight: 700; color: var(--text); }
.tg-color-swatch input { position: absolute; opacity: 0; pointer-events: none; }

/* دکمه‌های پیش‌نمایش با پس‌زمینه رنگی واقعی */
.tg-preview-btn.solid {
    color: #fff; font-weight: 700; border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.22);
    text-shadow: 0 1px 1px rgba(0,0,0,.18);
}
.icon-chip.solid { color: #fff; border: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

/* کارت وضعیت ربات در داشبورد */
.bot-status-card { border: 1px solid rgba(var(--accent-rgb), .35); box-shadow: 0 8px 26px rgba(var(--accent-rgb), .10); }

/* مقدارهای kv-row بلند روی همه اندازه‌ها نشکنند */
.kv-row { flex-wrap: wrap; }
.kv-row .v { overflow-wrap: anywhere; }

/* ---------- موبایل ≤۶۴۰px: جدول‌ها به کارت عمودی ---------- */
@media (max-width: 640px) {
    .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .toolbar .search-box { max-width: none; }
    .toolbar form { width: 100%; }
    .toolbar .filter-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .toolbar .filter-tabs::-webkit-scrollbar { display: none; }
    .toolbar .filter-tabs a, .toolbar .filter-tabs .filter-tab { white-space: nowrap; padding: 7px 12px; }

    .table-wrap { overflow-x: visible; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody { display: block; width: 100%; }
    .data-table tbody tr {
        display: block; width: 100%; background: var(--surface-2);
        border: 1px solid var(--border); border-radius: 14px;
        padding: 4px 12px; margin: 0 0 10px;
    }
    .data-table tbody td { display: block; width: 100%; border-bottom: 1px dashed var(--border); padding: 8px 2px; }
    .data-table tbody tr td:last-child { border-bottom: 0; padding-bottom: 10px; }
    .data-table tbody td::before {
        content: attr(data-label); display: block;
        font-size: 10.3px; font-weight: 700; color: var(--text-dim);
        margin-bottom: 3px; letter-spacing: .2px;
    }
    .data-table tbody td:not([data-label])::before,
    .data-table tbody td[data-label=""]::before { content: none; }
    .data-table tbody td .cell-name { font-size: 13.5px; }
    .data-table tbody td .cell-sub { overflow-wrap: anywhere; }
    .data-table tbody td .row-actions { display: flex; }
    .data-table tbody td .row-actions .btn-sm { flex: 1 1 0; justify-content: center; padding: 8px 12px; font-size: 11.5px; }
    .data-table tbody td .server-badge { margin-bottom: 3px; }
    /* ردیف اکشن خالی (سفارش‌های بدون اقدام) کارت موبایل را خراب نکند */
    .data-table tbody td.cell-actions:not(:has(*)) { display: none; }

    /* دکمه‌های اکشن بالای صفحه (مثل صفحه کاربر) دو ستونه و مرتب */
    .toolbar .row-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
    .toolbar .row-actions .btn { width: 100%; justify-content: center; }

    .tg-color-grid { grid-template-columns: 1fr 1fr; }
    .tg-icon-grid { grid-template-columns: repeat(5, 1fr); }
}

/* =====================================================================
   v27.8 — پالایش حرفه‌ای موبایل
   اهداف لمسی بزرگ‌تر، جلوگیری از زوم iOS، توست و مودال تمیز،
   عملکرد بهتر روی آیفون، و ریزتنظیم نوارهای موبایل
   ===================================================================== */

/* مرورگرهای قدیمی موبایل که color-mix را نمی‌شناسند: پس‌زمینه شفاف نشود */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .topbar { background: var(--surface); }
    .cs-bottom-nav { background: var(--surface); }
}

@media (max-width: 640px) {
    /* iOS: پس‌زمینه fixed هنگام اسکرول سنگین/لرزش و رفرش‌های پرهزینه دارد */
    body, .customer-body { background-attachment: scroll; }

    /* جلوگیری از زوم خودکار iOS هنگام فوکوس روی فیلدها (iOS زیر ۱۶px زوم می‌کند) */
    input[type=text], input[type=number], input[type=password], input[type=email],
    input[type=date], input[type=url], input[type=tel], input[type=search],
    select, textarea { font-size: 16px; }

    /* اهداف لمسی: حداقل اندازه استاندارد برای انگشت */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; }
    .btn-logout, .mobile-menu-btn, .topbar-bell { min-height: 38px; }
    .pagination a, .pagination span {
        min-width: 36px; min-height: 36px;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .cs-bottom-nav a { padding: 7px 2px 5px; min-height: 46px; }

    /* تاپ‌بار مدیر: فشرده‌تر بدون شکستن در ۳۲۰px */
    .topbar { gap: 8px; padding-inline: 12px; }
    .topbar-user { gap: 6px; }

    /* هدر کارت‌ها: عنوان بلند نشکند */
    .panel-card-title { min-width: 0; overflow-wrap: anywhere; }

    /* مودال: در ارتفاع کم اسکرول بخورد، نه بیرون‌زدگی */
    .modal-overlay { padding: 14px; }
    .modal-box {
        width: min(100%, 420px);
        max-height: min(86vh, 86dvh);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* توست‌ها: تمام‌عرض پایین صفحه؛ در پورتال کاربری بالای منوی پایین */
    .toast-stack { inset-inline: 12px; inset-inline-start: 12px; inset-inline-end: 12px; bottom: 14px; }
    .toast-stack .toast { width: 100%; }
    .customer-body .toast-stack { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

    /* اسکرول نرم لمسی در منوها */
    .sidebar, .customer-sidebar { -webkit-overflow-scrolling: touch; }

    /* نوار موبایل پورتال کاربری: تنفس بیشتر در فضای باریک */
    .cs-mobile-topbar { gap: 8px; padding-inline: 11px; }
    .cs-mobile-actions { gap: 6px; }
    .cs-mobile-actions .cs-wallet-chip { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }

    /* لینک اشتراک: کمی خواناتر */
    .service-link-text, .config-link-text { font-size: 11px; }

    /* پیام‌های سیستمی: خطوط بلند نشکنند */
    .alert { overflow-wrap: anywhere; }
}

/* صفحه‌های خیلی باریک (۳۲۰ تا ۳۸۰px) */
@media (max-width: 380px) {
    .compact-plan-grid { grid-template-columns: 1fr; }
    .cs-mobile-user-type { display: none; }
    .cs-mobile-actions .cs-wallet-chip { max-width: 30vw; }
    .stat-grid { gap: 8px; }
    .stat-value { font-size: 16px; }
    .quick-links { grid-template-columns: 1fr 1fr; }
    .topbar-title { font-size: 12.5px; }
}

/* صفحه‌های ۳۲۰px: جای برند و نام کاربر با حذف چیپ کیف‌پول آزاد می‌شود
   (موجودی در داشبورد و منو هست؛ چیپ فقط میان‌بُر است) */
@media (max-width: 360px) {
    .cs-mobile-actions .cs-wallet-chip { display: none; }
}

/* =====================================================================
   v28.0 — خرید مرحله‌ای (ویزارد) + فهرست سفارش‌ها دوستونه + ضدسرریز کارت
   ===================================================================== */

/* ---------- ویزارد خرید: پنل ← مدت ← نام و پرداخت — بازطراحی کامل v28.2 ----------
   کارت‌های رنگی گرادیانی + متن‌های خودمانی + دکمه‌های «تغییر پنل/تغییر مدت» واضح */

/* نوار مراحل ۱-۲-۳: قرصی گرادیانی با فلش‌های رابط؛ مراحل تمام‌شده قابل کلیک‌اند */
.buy-steps {
    display: flex; gap: 8px; list-style: none;
    margin: 0 0 18px; padding: 6px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
}
.buy-steps li {
    flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 10.5px; font-weight: 800; color: var(--text-faint);
    padding: 7px 8px; border-radius: 10px;
    transition: background .18s, color .18s, box-shadow .18s;
}
.buy-steps li + li { position: relative; }
.buy-steps li + li::before {
    content: '←';
    position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: var(--text-faint); opacity: .6; pointer-events: none;
}
.buy-steps .num {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    background: var(--surface); border: 1.5px solid var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
    transition: transform .18s;
}
.buy-steps li.active {
    background: var(--brand-gradient); color: #fff;
    box-shadow: 0 8px 18px -8px rgba(var(--brand2-rgb), .65);
}
.buy-steps li.active .num { background: rgba(255, 255, 255, .22); border-color: transparent; color: #fff; }
.buy-steps li.done { background: var(--success-soft); color: var(--success-2); }
.buy-steps li.done .num { background: transparent; border-color: transparent; color: var(--success-2); }
.buy-steps .buy-step-link { display: flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; border-radius: 10px; }
.buy-steps .buy-step-link:hover { color: var(--accent-dark); }
.buy-steps .buy-step-link:hover .num { transform: scale(1.1); }

/* گام ۱: کارت سرورها — v28.14: کارت گرادیانی مدرن (حباب آیکون + ردیف آمار + دکمه انتخاب پهن) و دکمه تست جدید
   v28.16: عرض کارت‌ها محدود و وسط‌چین شد — موبایل تک‌ستونه، دسکتاپ کارت‌های هم‌اندازه و مرتب */
.buy-panels {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 238px), 312px));
    justify-content: center;
}
.buy-panel-card {
    position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    border: 1.5px solid var(--border); border-radius: 18px; padding: 16px 14px 14px;
    background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    overflow: hidden;
}
/* هاله گرادیانی نرم گوشه کارت — حس عمق مدرن */
.buy-panel-card::after {
    content: ''; position: absolute; top: -46px; left: -38px; width: 132px; height: 132px;
    border-radius: 50%; filter: blur(38px); opacity: .55; pointer-events: none;
}
.buy-panel-card.bp-jangi::after { background: radial-gradient(circle, rgba(var(--brand1-rgb), .4), transparent 70%); }
.buy-panel-card.bp-pasargad::after { background: radial-gradient(circle, rgba(8, 145, 178, .34), transparent 70%); }
.buy-panel-card::before {
    content: ''; position: absolute; top: 0; right: 0; left: 0; height: 3.5px;
    background: var(--brand-gradient); opacity: 0; transition: opacity .2s;
}
.buy-panel-card:hover { border-color: var(--accent-2); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.buy-panel-card:hover::before { opacity: 1; }
.buy-panel-card.disabled { opacity: .62; pointer-events: none; }
/* v28.16 — رفع باگ «فقط یه جای خاص کارت کلیک می‌شد»: قبلا لایه لینک زیر محتوا بود (z-index:1 در برابر 2)
   و کلیک روی آیکون/عنوان/آمار به لینک نمی‌رسید. حالا لایه لینک روی همه محتواست؛ چون داخل کارت
   هیچ کنترل تعاملی نیست (دکمه تست بیرون کارت است)، کل کارت یک لینک امن و کامل است. */
.buy-panel-card .bp-cover { position: absolute; inset: 0; z-index: 3; border-radius: inherit; cursor: pointer; }
.buy-panel-card > * { position: relative; z-index: 2; }
.buy-panel-card .bp-cover:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.buy-panel-card .bp-head { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; }
.buy-panel-card .bp-icon {
    width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
    background: var(--brand-gradient);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 20px -8px rgba(var(--brand2-rgb), .75);
}
/* آیکون‌های SVG حرفه‌ای جای ایموجی — استروک سفید روی حباب گرادیانی */
.buy-panel-card .bp-icon svg { width: 21px; height: 21px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.buy-panel-card .bp-head > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.buy-panel-card .bp-title { font-weight: 900; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.buy-panel-card .bp-sub { font-size: 11px; color: var(--text-dim); line-height: 1.9; min-width: 0; overflow-wrap: anywhere; }
.bp-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bp-type {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 9.5px; font-weight: 800; padding: 2.5px 9px; border-radius: 999px;
    white-space: nowrap;
}
.bp-type.jangi { background: var(--purple-soft); color: var(--purple); }
.bp-type.pasargad { background: var(--blue-soft); color: var(--blue); }
/* v28.14: ردیف آمار کارت — تعداد پلن فعال و شروع قیمت، قرص‌های کوچک مرتب */
.bp-stats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; }
.bp-stat {
    display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%;
    font-size: 10.5px; font-weight: 700; color: var(--text-dim); line-height: 1.7;
    background: var(--surface-2); border: 1px solid var(--border);
    padding: 5px 11px; border-radius: 999px; overflow-wrap: anywhere;
}
.bp-stat b { color: var(--accent-dark); font-weight: 900; }
.bp-stat svg { flex-shrink: 0; opacity: .75; }
/* v28.14: دکمه انتخاب پهن پایین کارت — کل نوار دکمه است، دیگر فقط یک قرص کوچک نیست */
.bp-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 11.5px; font-weight: 900; color: var(--accent-dark);
    margin-top: auto; padding: 9px 14px; border-radius: 12px;
    background: var(--accent-soft); border: 1.5px solid transparent;
    transition: background .2s, color .2s, box-shadow .2s;
}
.bp-cta::after { content: '←'; transition: transform .2s; }
.buy-panel-card:hover .bp-cta {
    background: var(--brand-gradient); color: #fff;
    box-shadow: 0 10px 20px -10px rgba(var(--brand2-rgb), .75);
}
.buy-panel-card:hover .bp-cta::after { transform: translateX(-4px); }

/* دکمه تست کوچک و جدا — زیر کارت سرور، دور از لینک انتخاب تا اشتباهی زده نشود */
.buy-panel-wrap { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bp-test-form { display: flex; justify-content: center; width: 100%; }
.bp-test-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    font: inherit; font-size: 10.5px; font-weight: 800; color: var(--accent-dark);
    background: var(--accent-soft); border: 1.3px dashed var(--accent-2); border-radius: 999px;
    padding: 5px 14px; cursor: pointer; min-height: 28px;
    transition: color .2s, border-color .2s, background .2s, box-shadow .2s, transform .2s;
}
.bp-test-btn svg { opacity: .85; }
.bp-test-btn:hover {
    color: #fff; border-color: transparent; background: var(--brand-gradient);
    box-shadow: 0 8px 16px -8px rgba(var(--brand2-rgb), .7); transform: translateY(-1px);
}

/* نوار انتخاب فعلی: چیپ‌های بنفش + دکمه‌های «تغییر پنل/تغییر مدت» واضح و لمس‌پذیر */
.buy-selection-bar {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 13px; padding: 9px 11px; margin-bottom: 14px;
}
.buy-chip {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-width: 0;
    background: var(--accent-soft); color: var(--accent-dark);
    font-size: 10.5px; font-weight: 800; padding: 6px 12px; border-radius: 999px;
}
.buy-chip > span { min-width: 0; overflow-wrap: anywhere; }
.buy-change-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.buy-change-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 34px; padding: 6px 13px; border-radius: 999px; cursor: pointer;
    border: 1.5px dashed var(--accent-2); background: var(--surface);
    color: var(--accent-dark); font-size: 10.8px; font-weight: 800; font-family: inherit;
    text-decoration: none; white-space: nowrap;
    transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.buy-change-btn:hover {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 8px 16px -8px rgba(var(--accent-rgb), .7); text-decoration: none;
}

/* سوال خودمانی بالای لیست‌ها */
.buy-q { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; font-weight: 800; margin: 2px 0 12px; }
.buy-q .buy-q-hint { font-size: 10.5px; font-weight: 600; color: var(--text-faint); }

/* گام ۲ (v28.18): کارت پلن حرفه‌ای مثل اپ‌های فروش اشتراک —
   مربع حجم سمت راست + نام/توضیح/هر گیگ وسط + قیمت کل و نشان صرفه‌جویی سمت چپ */
.buy-plan-list { display: flex; flex-direction: column; gap: 11px; }
.buy-plan-card {
    position: relative; display: flex; align-items: center; gap: 12px;
    border: 1.5px solid var(--border); border-radius: 18px; padding: 14px 15px;
    background: var(--surface); color: var(--text); text-decoration: none;
    transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}
.buy-plan-card:hover {
    border-color: var(--accent-2); box-shadow: var(--shadow-lg);
    background: var(--surface-2); transform: translateY(-1.5px);
}
.buy-plan-card:focus-visible { outline: 2.5px solid var(--accent-2); outline-offset: 2px; }

/* مربع حجم: عدد درشت + برچسب «گیگ» */
.buy-plan-vol {
    flex-shrink: 0; width: 62px; height: 62px; border-radius: 16px;
    background: var(--accent-soft); color: var(--accent-dark);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.buy-plan-vol b { font-size: 19px; font-weight: 900; line-height: 1.15; }
.buy-plan-vol b.inf { font-size: 25px; line-height: 1; }
.buy-plan-vol i { font-style: normal; font-size: 10px; font-weight: 700; opacity: .82; }
.buy-plan-vol.ico svg { opacity: .92; }

/* میانه کارت: نام پلن + توضیح خودمونی + قیمت هر گیگ */
.buy-plan-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.buy-plan-name {
    font-size: 14.5px; font-weight: 900; line-height: 1.5;
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere;
}
.buy-plan-tag { font-size: 11px; font-weight: 600; color: var(--text-dim); line-height: 1.8; min-width: 0; overflow-wrap: anywhere; }
.buy-plan-pergb { font-size: 10.5px; font-weight: 600; color: var(--text-dim); }
.buy-plan-pergb b { font-weight: 800; }

/* انتهای کارت (سمت چپ در RTL): قیمت کل + نشان صرفه‌جویی */
.buy-plan-end { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.buy-plan-price { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.buy-plan-price b { font-size: 16.5px; font-weight: 900; color: var(--accent-dark); line-height: 1.3; white-space: nowrap; }
.buy-plan-price i { font-style: normal; font-size: 10px; font-weight: 600; color: var(--text-faint); }
.buy-plan-save {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 800; color: #047857;
    background: #ecfdf5; border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.buy-plan-save svg { opacity: .8; }

/* نشان «پیشنهاد ما»: قرص کهربایی کنار نام پلن */
.buy-plan-rec {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff;
    font-size: 10px; font-weight: 900; padding: 4px 10px; border-radius: 999px;
    box-shadow: 0 5px 12px -5px rgba(245, 158, 11, .75); white-space: nowrap;
}

/* پلن پیشنهادی: کل کارت گرادیان برند + متن سفید (مثل پلاس در اپ‌های معروف) */
.buy-plan-card.is-rec {
    background: var(--brand-gradient); border-color: transparent; color: #fff;
    box-shadow: 0 18px 32px -14px rgba(var(--accent-rgb), .65);
}
.buy-plan-card.is-rec:hover { background: var(--brand-gradient); box-shadow: 0 22px 38px -14px rgba(var(--accent-rgb), .8); }
.buy-plan-card.is-rec .buy-plan-vol { background: rgba(255, 255, 255, .17); color: #fff; }
.buy-plan-card.is-rec .buy-plan-tag,
.buy-plan-card.is-rec .buy-plan-pergb { color: rgba(255, 255, 255, .85); }
.buy-plan-card.is-rec .buy-plan-pergb b,
.buy-plan-card.is-rec .buy-plan-price b { color: #fff; }
.buy-plan-card.is-rec .buy-plan-price i { color: rgba(255, 255, 255, .78); }
.buy-plan-card.is-rec .buy-plan-save { background: rgba(255, 255, 255, .18); color: #fff; }

/* کارت مدت (روزها): همان زبان طراحی با آیکون ساعت داخل مربع */
.buy-plan-card.dur .buy-plan-vol { width: 54px; height: 54px; border-radius: 14px; }

/* گام ۳: خلاصه سفارش + جعبه حساب‌کتاب + دکمه گرادیانی پرداخت */
.buy-confirm-box {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 13px; padding: 12px 14px; font-size: 11.5px;
    display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px;
    position: relative; overflow: hidden;
}
.buy-confirm-box::before {
    content: ''; position: absolute; top: 0; right: 0; left: 0; height: 3px;
    background: var(--brand-gradient);
}
.buy-confirm-box.pay { border: 1px dashed var(--border-strong); }
.buy-confirm-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--text-dim); }
.buy-confirm-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.buy-confirm-row .lbl { color: var(--text-dim); font-weight: 600; flex-shrink: 0; }
.buy-confirm-row .val { font-weight: 800; min-width: 0; overflow-wrap: anywhere; text-align: start; }
.buy-pay-btn {
    width: 100%; min-height: 48px; border: none; border-radius: 12px; cursor: pointer;
    background: var(--brand-gradient); color: #fff;
    font-family: inherit; font-size: 13.5px; font-weight: 800;
    box-shadow: 0 12px 24px -10px rgba(var(--brand2-rgb), .7);
    transition: transform .18s, box-shadow .18s, filter .18s;
}
.buy-pay-btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 16px 28px -10px rgba(var(--brand2-rgb), .8); }
.buy-pay-btn:active { transform: translateY(0); filter: brightness(.98); }
.buy-name-check { display: block; font-size: 10.5px; min-height: 15px; margin-top: 4px; font-weight: 700; }
.buy-name-check.ok { color: var(--success-2); }
.buy-name-check.bad { color: var(--danger); }

/* دارک‌مود: چیپ‌ها و قیمت‌ها روی زمینه تیره روشن‌تر می‌شوند */
[data-theme="dark"] .buy-chip,
[data-theme="dark"] .buy-change-btn { color: var(--accent-light); }
[data-theme="dark"] .buy-change-btn { background: var(--surface-2); }
[data-theme="dark"] .buy-plan-vol { background: rgba(var(--brand2-rgb), .17); color: var(--accent-light); }
[data-theme="dark"] .buy-plan-price b { color: var(--accent-light); }
[data-theme="dark"] .buy-plan-save { background: rgba(16, 185, 129, .16); color: #6ee7b7; }

@media (max-width: 640px) {
    .buy-panels { grid-template-columns: 1fr; }
    .buy-steps { margin-bottom: 14px; }
    .buy-plan-card { padding: 13px 14px; border-radius: 16px; }
    .buy-plan-vol { width: 56px; height: 56px; border-radius: 14px; }
    .buy-plan-vol b { font-size: 17px; }
    .buy-plan-price b { font-size: 15px; }
    .buy-selection-bar { padding: 9px 10px; }
    .buy-change-group { margin-inline-start: 0; width: 100%; }
    .buy-change-btn { flex: 1 1 auto; }
}
@media (max-width: 480px) {
    .buy-steps { gap: 5px; padding: 5px; margin-bottom: 14px; }
    .buy-steps li { flex-direction: column; gap: 4px; font-size: 9px; padding: 7px 4px; text-align: center; }
    .buy-steps li + li::before { display: none; }
    .buy-steps .num { width: 21px; height: 21px; font-size: 9.5px; }
}

/* ---------- فهرست سفارش‌ها: موبایل یک‌ستونه، دسکتاپ دوستونه جمع‌وجور ---------- */
.orders-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
@media (min-width: 900px) {
    .orders-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
}

/* ---------- ضدسرریز کارت سرویس (موبایل و دسکتاپ): هیچ قسمتی از کارت بیرون نمی‌زند ----------
   علت بیرون‌زدگی: کلمات بدون فاصله (نام کاربری/لینک/نام پلن) در آیتم‌های flex/grid
   با min-width:auto عرض را می‌شکنند. راه‌حل: minmax(0,1fr) + min-width:0 + شکستن کلمه. */
.service-card { min-width: 0; max-width: 100%; }
.service-card .config-info { min-width: 0; max-width: 100%; }
.service-card .service-card-heading { min-width: 0; max-width: 100%; }
.service-card .config-name { overflow-wrap: anywhere; min-width: 0; }
.service-card .sc-info-val { overflow-wrap: anywhere; min-width: 0; }
.service-card .sc-info { min-width: 0; max-width: 100%; }
.service-card .sc-info-grid { min-width: 0; max-width: 100%; }
.service-card .service-credentials { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.service-card .service-credentials .mono { overflow-wrap: anywhere; }
.service-card .config-link-box { min-width: 0; max-width: 100%; }
.service-card .service-settlement-line,
.service-card .service-note-form,
.service-card .service-location-links { min-width: 0; max-width: 100%; }
.orders-list > * { min-width: 0; max-width: 100%; }

/* ---------- v28.1 — نام ترتیبی خودکار جنگی + بررسی زنده نام کاربری پاسارگارد + جستجوی زنده ---------- */
.buy-name-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.buy-name-row input[type="text"] { flex: 1 1 170px; min-width: 0; }
.buy-name-row .btn { flex: 0 0 auto; white-space: nowrap; }
.buy-name-check.soft { color: var(--warn, #b45309); }
#ordersListWrap, #servicesListWrap { transition: opacity 0.15s ease; }
@media (max-width: 640px) {
    .buy-name-row .btn { flex: 1 1 100%; min-height: 40px; }
}

/* ================= v28.3 — مصرف لحظه‌ای + نشان آنلاین + دستگاه‌ها + تنظیمات نمایندگی ================= */
/* نشان آنلاین/آفلاین سرویس (پنل‌های پاسارگارد) */
.online-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 700; line-height: 1;
    padding: 4px 9px; border-radius: 999px; white-space: nowrap;
    border: 1px solid transparent;
}
.online-badge[hidden] { display: none; }
.online-badge.online-on { background: rgba(16, 185, 129, .12); color: #059669; border-color: rgba(16, 185, 129, .35); }
.online-badge.online-off { background: rgba(100, 116, 139, .12); color: #64748b; border-color: rgba(100, 116, 139, .3); }
html[data-theme="dark"] .online-badge.online-on { background: rgba(16, 185, 129, .18); color: #34d399; }
html[data-theme="dark"] .online-badge.online-off { background: rgba(148, 163, 184, .15); color: #94a3b8; }

/* خط دستگاه‌های استفاده‌شده (فقط اگر API پنل برگرداند) */
.service-devices {
    font-size: 11.5px; color: var(--text-dim, #6b7280);
    margin-top: 4px; overflow-wrap: anywhere; min-width: 0;
}
.service-devices[hidden] { display: none; }

/* فهرست کاربران (جستجوی زنده) — محو شدن نرم هنگام بارگذاری */
#customersListWrap { transition: opacity 0.15s ease; }

/* کارت گزارش روزانه داشبورد */
.report-mini .stat-card { padding: 12px 14px; }

/* صفحه تنظیمات نمایندگی */
.rs-cap-row { display: flex; align-items: flex-start; gap: 11px; }
.rs-cap-row .stat-icon { flex-shrink: 0; width: 34px; height: 34px; }
.rs-preview-note { font-size: 11px; color: var(--text-dim, #6b7280); }
input[type="color"] { cursor: pointer; }

/* ================= v28.5 — کارت سرویس مرتب‌تر (موبایل) + کارت‌های متمایز تاریخچه خرید + ویزارد رنگی‌تر و درشت‌تر ================= */

/* --- سرصفحه دوخطی کارت سرویس: خط اول فقط نام سرویس، خط دوم ردیف نشان‌ها --- */
.sc-badges { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.sc-badges .badge, .sc-badges .online-badge, .sc-badges .server-badge { max-width: 100%; }
.sc-badges .service-server-badge { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- مشخصات سرویس: شبکه برچسب/مقدار به‌جای متن پیوسته (نظم کامل در موبایل) --- */
.sc-info-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 9px; margin-top: 9px; min-width: 0;
}
.sc-info {
    display: flex; flex-direction: column; gap: 1px; min-width: 0;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 9px; padding: 6px 9px;
}
/* v28.6: display:flex روی [hidden] غلبه می‌کرد و خانهٔ خالی «باقیمانده» (پلن نامحدود) دیده می‌شد */
.sc-info[hidden] { display: none; }
.sc-info-lbl { font-size: 9.3px; font-weight: 700; color: var(--text-faint); letter-spacing: .2px; }
.sc-info-val { font-size: 11.5px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; line-height: 1.7; }
@supports (background: color-mix(in srgb, red 50%, blue)) {
    .sc-info[data-remaining] { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
    .sc-info[data-remaining] .sc-info-val { color: var(--accent-dark); }
}

/* ================= v28.6 — چیدمان حرفه‌ای دسکتاپ کارت سرویس (فقط ≥۶۴۱px؛ موبایل دست‌نخورده) =================
   مشکل قبلی: چیدمان سه‌ستونهٔ [حلقه | ستون دکمه‌ها | ستون مشخصات] ستون مشخصات را له می‌کرد؛
   نام و نشان‌ها و خانه‌های مشخصات پراکنده و نامرتب می‌شدند. حالا:
   ردیف ۱ = [حلقه | اطلاعات کامل]، ردیف ۲ = نوار عملیات تمام‌عرض؛
   سربرگ تک‌خطی (نام + نشان‌ها در یک خط با خط جداکننده) و مشخصات به‌صورت نوار ۴ خانهٔ هم‌عرض. */
@media (min-width: 641px) {
    .service-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; align-items: start; container-type: inline-size; }
    .service-card .config-ring { grid-column: 1; grid-row: 1; margin-top: 3px; }
    .service-card .config-info { grid-column: 2; grid-row: 1; min-width: 0; }
    .service-card .js-service-manage { display: none; }

    /* نوار عملیات: تمام‌عرض زیر مشخصات، جدا با خط‌چین — دیگر ستون وسط کارت نیست */
    .service-card .service-direct-actions {
        grid-column: 1 / -1; grid-row: 2;
        display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
        margin-top: 13px; padding-top: 12px;
        border-top: 1px dashed var(--border);
    }

    /* سربرگ تک‌خطی حرفه‌ای: نام سمت راست، نشان‌ها سمت چپ، خط جداکننده زیر */
    .service-card .service-card-heading {
        flex-wrap: nowrap; justify-content: space-between; gap: 12px;
        margin-bottom: 11px; padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
    }
    .service-card .config-name { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .service-card .sc-badges { flex-shrink: 1; min-width: 0; flex-wrap: nowrap; gap: 6px; }

    /* مشخصات: نوار خانه‌های هم‌عرض برچسب/مقدار — منظم مثل داشبورد؛
       auto-fit: اگر خانهٔ باقیمانده مخفی باشد (پلن نامحدود) بقیه کل عرض را می‌گیرند */
    .service-card .sc-info-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 8px; margin-top: 0;
    }
    .service-card .sc-info { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 11px; border-radius: 10px; }
    .service-card .sc-info-lbl { font-size: 10px; }
    .service-card .sc-info-val { font-size: 12.5px; line-height: 1.6; }

    /* کارتِ باریک دسکتاپ (فهرست دونیمه روی لپ‌تاپ‌های کوچک): خانه‌ها ۲×۲ تا مقدارها نشکنند.
       مرورگرهای قدیمی بدون Container Query: همان ۴ستونه با شکستن سطر داخل خانه (کاهش تدریجی بی‌خطر). */
    @container (max-width: 540px) {
        .service-card .sc-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
}

/* --- نام کاربری/رمز: جعبه مجزا و مرتب --- */
.service-credentials {
    display: flex; align-items: center; flex-wrap: wrap; gap: 3px 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 9px; padding: 7px 10px; margin-top: 8px;
    font-size: 11px; color: var(--text-dim); min-width: 0;
}
.service-credentials .sc-cred { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; max-width: 100%; }
.service-credentials .sc-cred .mono { overflow-wrap: anywhere; }
.service-credentials .mono { font-weight: 700; color: var(--accent-dark); }

/* --- نوار رنگی وضعیت لبه کارت سرویس (فعال=سبز، در انتظار=نارنجی، ناموفق=قرمز) --- */
.service-card.st-completed { border-inline-start: 3px solid var(--success-2); }
.service-card.st-pending { border-inline-start: 3px solid var(--warn-2); }
.service-card.st-failed { border-inline-start: 3px solid var(--danger-2); }
.service-card.st-expired, .service-card.st-disabled, .service-card.st-cancelled { border-inline-start: 3px solid var(--border-strong); }

/* --- تاریخچه خرید: کارت‌ها با پس‌زمینه متمایز (ته‌رنگ بنفش/صورتی) از زمینه اصلی سایت --- */
.orders-list .service-card {
    background: linear-gradient(165deg, var(--surface) 32%, var(--accent-soft) 76%, var(--brand-soft) 100%);
    border-color: var(--border-strong);
}
html[data-theme="dark"] .orders-list .service-card {
    background: linear-gradient(165deg, var(--surface) 35%, var(--surface-3) 100%);
}

/* --- ویزارد خرید: رنگی‌تر + فونت فارسی درشت‌تر (Bold) --- */
/* کارت سرورها: گرادیان چندمرحله‌ای نوع‌دار (جنگی=بنفش/صورتی، پاسارگارد=آبی/فیروزه‌ای) + نوار بالایی همیشه نمایان */
.buy-panel-card { background: linear-gradient(150deg, var(--surface) 0%, color-mix(in srgb, var(--accent-soft) 60%, var(--surface)) 60%, var(--accent-soft) 100%); }
.buy-panel-card::before { opacity: 1; height: 3.5px; }
.buy-panel-card.bp-jangi { border-color: color-mix(in srgb, var(--brand-pink) 22%, var(--border)); background: linear-gradient(150deg, var(--surface) 0%, color-mix(in srgb, var(--brand-pink) 7%, var(--surface)) 55%, color-mix(in srgb, var(--brand-pink) 12%, var(--surface)) 100%); }
.buy-panel-card.bp-jangi::before { background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple)); }
.bp-jangi .bp-icon { background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px -8px rgba(var(--brand1-rgb), .7); }
.buy-panel-card.bp-pasargad { border-color: #cfe8f3; background: linear-gradient(150deg, #fcffff 0%, #eaf7fd 55%, #e2f4fc 100%); }
.buy-panel-card.bp-pasargad::before { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.bp-pasargad .bp-icon { background: linear-gradient(135deg, #0891b2, #0ea5e9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px -8px rgba(8, 145, 178, .7); }
.bp-pasargad .bp-cta { color: #0e7490; background: var(--blue-soft); }
.bp-pasargad:hover .bp-cta { background: linear-gradient(135deg, #0891b2, #0ea5e9); color: #fff; }
.bp-stat { background: rgba(255, 255, 255, .6); }

/* کارت‌های پلن: ته‌رنگ بنفش + قیمت گرادیانی پررنگ (v28.18) */
.buy-plan-card { background: linear-gradient(155deg, var(--surface) 0%, var(--accent-soft) 100%); }
.buy-plan-card:hover { background: var(--accent-soft); }
.buy-plan-card.is-rec { background: var(--brand-gradient); }
.buy-plan-card.is-rec:hover { background: var(--brand-gradient); }

/* نوار انتخاب فعلی و خلاصه سفارش: ته‌رنگ برند */
.buy-selection-bar { background: linear-gradient(135deg, var(--accent-soft), var(--brand-soft)); border-color: var(--accent-soft); }
.buy-confirm-box { background: linear-gradient(160deg, var(--surface-2) 0%, var(--accent-soft) 100%); }

/* فونت درشت (Bold) برای فارسی — خوانایی بهتر در کل ویزارد */
.buy-wizard-card .panel-card-title { font-weight: 900; }
.buy-q { font-weight: 900; font-size: 13.5px; }
.buy-q .buy-q-hint { font-weight: 700; }
.buy-panel-card .bp-title { font-weight: 900; }
.buy-panel-card .bp-sub { font-weight: 700; }
.buy-panel-card .bp-cta { font-weight: 900; }
.buy-plan-name { font-weight: 900; }
.buy-plan-tag { font-weight: 700; font-size: 11px; }
.buy-confirm-title { font-weight: 900; font-size: 11.5px; }
.buy-confirm-row .lbl { font-weight: 700; color: var(--text-dim); }
.buy-confirm-row .val { font-weight: 900; }
.buy-wizard-card .field > label { font-weight: 800; }
.buy-pay-btn { font-weight: 900; }

/* دارک‌مود: نسخه‌های تیره ته‌رنگ‌ها */
[data-theme="dark"] .buy-panel-card { background: linear-gradient(155deg, var(--surface-3) 0%, var(--surface) 100%); }
[data-theme="dark"] .buy-panel-card.bp-jangi { border-color: color-mix(in srgb, var(--brand-pink) 25%, var(--border)); background: linear-gradient(155deg, color-mix(in srgb, var(--brand-pink) 12%, var(--surface-2)) 0%, var(--surface) 100%); }
[data-theme="dark"] .buy-panel-card.bp-pasargad { border-color: #1d3a4e; background: linear-gradient(155deg, #12253a 0%, var(--surface) 100%); }
[data-theme="dark"] .buy-panel-card::after { opacity: .4; }
[data-theme="dark"] .buy-panel-card.bp-jangi::after { background: radial-gradient(circle, rgba(var(--brand1-rgb), .45), transparent 70%); }
[data-theme="dark"] .buy-panel-card.bp-pasargad::after { background: radial-gradient(circle, rgba(34, 211, 238, .38), transparent 70%); }
[data-theme="dark"] .bp-cta { background: rgba(var(--brand2-rgb), .16); color: var(--accent-light); }
[data-theme="dark"] .buy-panel-card:hover .bp-cta { background: var(--brand-gradient); color: #fff; }
[data-theme="dark"] .bp-pasargad .bp-cta { background: rgba(14, 165, 233, .14); color: #67e8f9; }
[data-theme="dark"] .bp-pasargad:hover .bp-cta { background: linear-gradient(135deg, #0891b2, #0ea5e9); color: #fff; }
[data-theme="dark"] .bp-jangi .bp-icon { background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple)); }
[data-theme="dark"] .bp-pasargad .bp-icon { background: linear-gradient(135deg, #0891b2, #0ea5e9); }
[data-theme="dark"] .bp-stat { background: rgba(255, 255, 255, .05); border-color: var(--border-strong); }
[data-theme="dark"] .bp-stat b { color: var(--accent-light); }
[data-theme="dark"] .bp-test-btn { color: var(--accent-light); background: rgba(var(--brand2-rgb), .14); border-color: var(--border-strong); }
[data-theme="dark"] .bp-test-btn:hover { color: #fff; border-color: transparent; background: var(--brand-gradient); }
[data-theme="dark"] .buy-plan-card { background: linear-gradient(155deg, var(--surface-3) 0%, var(--surface) 100%); }
[data-theme="dark"] .buy-plan-card:hover { background: var(--surface-3); }
[data-theme="dark"] .buy-plan-card.is-rec { background: var(--brand-gradient); }
[data-theme="dark"] .buy-plan-card.is-rec:hover { background: var(--brand-gradient); }
[data-theme="dark"] .buy-selection-bar { background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); border-color: var(--border-strong); }
[data-theme="dark"] .buy-confirm-box { background: linear-gradient(160deg, var(--surface-3) 0%, var(--surface) 100%); }
[data-theme="dark"] .sc-info[data-remaining] { border-color: rgba(var(--accent2-rgb), .42); background: rgba(var(--accent2-rgb), .09); }
[data-theme="dark"] .sc-info[data-remaining] .sc-info-val { color: var(--accent-light); }
[data-theme="dark"] .service-credentials .mono { color: var(--accent-light); }
[data-theme="dark"] .orders-list .service-card { border-color: var(--border-strong); }

/* v28.7 — صفحه پروفایل کاربر */
.cs-profile-list { padding: 2px 16px 16px; display: flex; flex-direction: column; }
.cs-profile-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.cs-profile-row:last-child { border-bottom: none; }
.cs-profile-row .stat-icon { width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; }
.cs-profile-main { flex: 1; min-width: 0; }
.cs-profile-label { font-size: 11px; color: var(--text-faint); font-weight: 700; }
.cs-profile-value { font-size: 13px; font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; }
/* مقادیر LTR (موبایل/کد) مثل بقیه سطرها به لبه راست بچسبند — نه لبه چپ صفحه */
.cs-profile-value[dir="ltr"] { text-align: right; }
.cs-profile-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
@media (max-width: 640px) {
    .cs-profile-row .stat-icon { width: 32px; height: 32px; border-radius: 10px; }
    .cs-profile-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- v28.16 — هماهنگی موبایل/دسکتاپ ویزارد خرید + فاصله‌های یکدست ----------
   بدنه ویزارد قبلا padding اینلاین 16px داشت؛ با 18px افقیِ هدر کارت هم‌راستا نبود.
   حالا کلاس buy-wizard-body: افقی همیشه 18px (دقیقا زیر عنوان کارت)، عمودی موبایل جمع و دسکتاپ نفس‌دار. */
.buy-wizard-body { padding: 14px 18px 18px; }
/* کارت‌های یک ردیف هم‌قد می‌شوند و دکمه انتخاب همه در یک خط پایین می‌نشیند */
.buy-panel-card { flex: 1 1 auto; }
@media (min-width: 641px) {
    .buy-wizard-body { padding: 20px 18px 22px; }
    .buy-panels { gap: 16px; }
    .buy-q { margin: 2px 0 14px; }
    .buy-plan-list { gap: 12px; }
    .buy-plan-card { padding: 14px 16px; }
    .buy-selection-bar { margin-bottom: 16px; }
    .buy-confirm-box { margin-bottom: 16px; }
}

/* ---------- v28.21 — تنظیمات مرتب‌شده در تب‌ها (پنل مدیریت) ----------
   همه فیلدها در یک فرم‌اند (یک دکمه ذخیره)؛ تب‌ها فقط پیدا کردن سریع گزینه‌ها را آسان می‌کنند. */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.settings-tab:hover { color: var(--text); border-color: var(--border-strong); }
.settings-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.settings-tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.settings-pane[hidden] { display: none; }
.settings-savebar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
    .settings-tab { padding: 7px 10px; font-size: 11.5px; }
}

/* ================= v28.22 — دروازهٔ مبهم: بنر ورود + مودال اعلان ================= */
.tvad-login-slot { margin: -6px 0 14px; }
.tvad-banner {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.tvad-banner-media img,
.tvad-modal-media img {
    display: block;
    width: 100%;
    max-height: 150px;
    object-fit: cover;
}
.tvad-banner-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tvad-sponsor {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-faint);
}
.tvad-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.tvad-banner-headline {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.9;
}
.tvad-banner-desc,
.tvad-modal-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 2;
}
.tvad-banner-cta,
.tvad-modal-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: filter .15s, transform .15s;
}
.tvad-banner-cta:hover,
.tvad-modal-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tvad-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 15, 40, .55);
    backdrop-filter: blur(3px);
    animation: tvadFade .2s ease;
}
.tvad-modal-box {
    position: relative;
    width: min(420px, 100%);
    max-height: min(85vh, 640px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px -18px rgba(20, 15, 40, .45);
    animation: tvadPop .22s ease;
}
.tvad-modal-video { display: block; width: 100%; max-height: 240px; background: #000; }
.tvad-modal-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 7px; }
.tvad-modal-headline { font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.9; }
.tvad-close {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 15, 40, .35);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background .15s;
}
.tvad-close:hover { background: rgba(20, 15, 40, .6); }
.tvad-close:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@keyframes tvadFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tvadPop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .tvad-banner { background: var(--navy-2); border-color: var(--navy-line); }
[data-theme="dark"] .tvad-banner-headline,
[data-theme="dark"] .tvad-modal-headline { color: var(--text); }
[data-theme="dark"] .tvad-banner-desc,
[data-theme="dark"] .tvad-modal-desc { color: var(--text-dim); }
[data-theme="dark"] .tvad-modal-box { background: var(--navy-2); border-color: var(--navy-line); }
@media (max-width: 480px) {
    .tvad-banner-media img,
    .tvad-modal-media img { max-height: 120px; }
    .tvad-modal { padding: 12px; }
}

/* ===== v28.81 — وضعیت بدهی کاربران (مدیریت کاربران) ===== */
.cu-debt-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.cu-debt-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit;
    border: 1.5px solid transparent; transition: transform .12s, box-shadow .12s; min-width: 0; }
.cu-debt-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.cu-debt-card.active { box-shadow: 0 0 0 2px currentColor inset; }
.cu-debt-ic { font-size: 20px; line-height: 1; flex: none; }
.cu-debt-txt { font-size: 12.5px; line-height: 1.7; min-width: 0; }
.cu-debt-txt b { font-size: 16px; margin-inline-end: 4px; }
.cu-debt-card.is-off  { background: rgba(127, 29, 29, .08);  border-color: rgba(127, 29, 29, .25);  color: #7f1d1d; }
.cu-debt-card.is-lock { background: rgba(220, 38, 38, .07);  border-color: rgba(220, 38, 38, .25);  color: #b91c1c; }
.cu-debt-card.is-due  { background: rgba(245, 158, 11, .09); border-color: rgba(245, 158, 11, .3);  color: #b45309; }
.cu-badge-off  { background: #7f1d1d; color: #fff; }
.cu-badge-lock { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.cu-badge-due  { background: rgba(245, 158, 11, .15); color: #b45309; }
td .cu-badge-off, td .cu-badge-lock, td .cu-badge-due { margin-top: 4px; display: inline-block; }
.data-table tr.cu-row-off  > td { background: rgba(127, 29, 29, .05); }
.data-table tr.cu-row-lock > td { background: rgba(220, 38, 38, .04); }
.data-table tr.cu-row-due  > td { background: rgba(245, 158, 11, .05); }
.data-table tr.cu-row-off  > td:first-child { box-shadow: inset -4px 0 0 #7f1d1d; }
.data-table tr.cu-row-lock > td:first-child { box-shadow: inset -4px 0 0 #dc2626; }
.data-table tr.cu-row-due  > td:first-child { box-shadow: inset -4px 0 0 #f59e0b; }
.data-table tr.cu-group-row > td { font-size: 12px; font-weight: 800; padding: 8px 12px; background: var(--surface-2, #f6f6f8); }
.data-table tr.cu-g-off > td  { color: #7f1d1d; }
.data-table tr.cu-g-lock > td { color: #b91c1c; }
.data-table tr.cu-g-due > td  { color: #b45309; }
.data-table tr.cu-g-rest > td { color: var(--text-dim, #666); }
@media (max-width: 640px) {
    .cu-debt-strip { grid-template-columns: 1fr; gap: 8px; }
    .data-table tbody tr.cu-group-row { display: block; border: 0; background: none; box-shadow: none; padding: 0; margin: 12px 0 6px; }
    .data-table tbody tr.cu-group-row > td { display: block; border-radius: 8px; border-bottom: 0; padding: 8px 12px; }
    .data-table tbody tr.cu-group-row > td::before { content: none !important; display: none !important; }
    .data-table tbody tr.cu-row-off  { border-inline-start: 4px solid #7f1d1d !important; }
    .data-table tbody tr.cu-row-lock { border-inline-start: 4px solid #dc2626 !important; }
    .data-table tbody tr.cu-row-due  { border-inline-start: 4px solid #f59e0b !important; }
    .data-table tbody tr.cu-row > td:first-child { box-shadow: none; }
    .data-table tbody tr.cu-row > td { background: transparent; }
    .data-table tbody tr.cu-row-off { background: rgba(127, 29, 29, .06); }
    .data-table tbody tr.cu-row-lock { background: rgba(220, 38, 38, .05); }
    .data-table tbody tr.cu-row-due { background: rgba(245, 158, 11, .06); }
}
html[data-theme="dark"] .cu-debt-card.is-off, html[data-theme="dark"] .data-table tr.cu-g-off > td { color: #fca5a5; }
html[data-theme="dark"] .cu-debt-card.is-lock, html[data-theme="dark"] .data-table tr.cu-g-lock > td, html[data-theme="dark"] .cu-badge-lock { color: #f87171; }
html[data-theme="dark"] .cu-debt-card.is-due, html[data-theme="dark"] .data-table tr.cu-g-due > td, html[data-theme="dark"] .cu-badge-due { color: #fbbf24; }
html[data-theme="dark"] .cu-badge-off { background: #991b1b; }

/* ===== v28.81 — لوگوی آپلودی پنل ===== */
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.cs-brand-icon:has(.brand-logo-img), .brand-logo:has(.brand-logo-img), .sidebar-brand-icon:has(.brand-logo-img) { background: none !important; box-shadow: none !important; padding: 0 !important; overflow: hidden; }

/* ================= v28.82 — موبایل: صفحهٔ محصولات، فرم محصول و تنظیمات مدیریت ================= */
.pm-list { display: none; }
@media (max-width: 640px) {
    /* محصولات: کارت فشرده به‌جای جدول بلند */
    .pm-table { display: none; }
    .pm-list { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
    .pm-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 9px; }
    .pm-card.pm-off { opacity: .72; background: var(--surface-2); }
    .pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
    .pm-name { font-weight: 800; font-size: 14px; line-height: 1.6; color: var(--text); }
    .pm-head .badge { flex-shrink: 0; }
    .pm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .pm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-dim); }
    .pm-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .pm-prices > div { background: var(--surface-2); border-radius: 10px; padding: 6px 4px; text-align: center; min-width: 0; }
    .pm-prices span { display: block; font-size: 10.5px; color: var(--text-faint); margin-bottom: 2px; }
    .pm-prices b { display: block; font-size: 12px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pm-edit { width: 100%; justify-content: center; }

    /* فرم محصول: حجم و مدت کنار هم، قیمت‌ها فشرده، دکمهٔ ذخیره همیشه در دسترس */
    .pf-card .form-grid { grid-template-columns: 1fr 1fr !important; gap: 2px 10px; align-items: end; }
    .pf-card .form-grid > .field { grid-column: 1 / -1; min-width: 0; }
    .pf-card .form-grid > .field.pf-half { grid-column: auto; }
    .pf-card .pf-prices { grid-template-columns: 1fr 1fr !important; gap: 2px 10px; }
    .pf-card .pf-prices > .field:last-child { grid-column: 1 / -1; }
    .pf-card { overflow: visible !important; }
    .pf-card .panel-card-body { padding: 12px; }
    .pf-savebar { position: sticky; bottom: 0; z-index: 20; margin: 16px -12px -12px !important; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgba(0,0,0,.06); }
    .pf-savebar .btn { flex: 1; justify-content: center; }

    /* تنظیمات: تب‌ها یک ردیف افقیِ چسبان، فیلدها تمام‌عرض، ذخیرهٔ چسبان پایین صفحه */
    .settings-card { padding: 12px !important; overflow: visible !important; }
    .settings-card-title { display: none !important; }
    .settings-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; position: sticky; top: var(--tv-topbar-h, 60px); z-index: 30; background: var(--surface); margin: -12px -12px 14px; padding: 10px 12px; scroll-snap-type: x proximity; }
    .settings-tabs::-webkit-scrollbar { display: none; }
    .settings-tab { flex-shrink: 0; white-space: nowrap; scroll-snap-align: center; padding: 8px 12px; font-size: 12px; }
    .settings-card .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),
    .settings-card .field select,
    .settings-card .field textarea { width: 100%; max-width: 100% !important; box-sizing: border-box; }
    .settings-card .field input[type=file] { max-width: 100%; font-size: 12px; }
    .settings-card .form-section-title { margin-top: 18px; }
    .settings-card .help-text { font-size: 11.5px; line-height: 1.85; }
    .settings-card .tvp-admin-grid { gap: 8px; }
    .settings-savebar { position: sticky; bottom: 0; z-index: 25; margin: 16px -12px -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -6px 16px rgba(0,0,0,.06); border-radius: 0 0 14px 14px; }
    .settings-savebar .btn { flex: 1; justify-content: center; }
    .settings-savebar .help-text, .settings-savebar .dim { display: none; }
}
