/* =====================================================================
   TATvip v28.54 — لایهٔ پرداخت ظاهری (Polish)
   بعد از style.css بارگذاری می‌شود و فقط ظاهر را بهبود می‌دهد؛ هیچ ساختار
   یا منطق صفحه‌ای به آن وابسته نیست (حذف این فایل = بازگشت ظاهر قبلی).
   ===================================================================== */

/* ---------- ۱) پایه: تایپوگرافی و دسترس‌پذیری ---------- */
body { text-rendering: optimizeLegibility; font-feature-settings: "ss01"; }
.mono, .table td, .stat-value, .dash-stat-val, .dash-hero-wallet-amt { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
.btn { min-height: 36px; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
input, select, textarea { font-size: 13px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 1; }

/* محتوای خیلی عریض روی مانیتورهای بزرگ وسط‌چین و خوانا بماند */
@media (min-width: 1600px) {
    .content { max-width: 1440px; width: 100%; margin-inline: auto; }
}

/* ---------- ۲) جدول‌ها: سرستون چسبان، ردیف هاور، اسکرول افقی نرم ---------- */
.table-wrap, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }

/* ---------- ۳) کارت‌ها: فاصله و سایهٔ یکدست ---------- */
.card { border-radius: var(--radius); }
.panel-card-header { gap: 12px; }
.empty-state { padding: 34px 18px; text-align: center; color: var(--text-dim); }

/* ---------- ۴) تب‌ها (صفحهٔ ربات تلگرام و صفحات چندبخشی) ---------- */
.tv-tabs {
    display: flex; gap: 6px; padding: 6px; margin-bottom: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow); position: sticky; top: 70px; z-index: 20;
    overflow-x: auto; scrollbar-width: none;
}
.tv-tabs::-webkit-scrollbar { display: none; }
.tv-tab {
    flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
    font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-dim); white-space: nowrap;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.tv-tab:hover { background: var(--surface-3); color: var(--text); }
.tv-tab.active { background: var(--brand-gradient); color: #fff; box-shadow: 0 6px 18px -8px rgba(var(--brand2-rgb), .8); }
.tv-tab svg { flex-shrink: 0; }
.tv-tab-pane[hidden] { display: none !important; }
.tv-tab-pane > .card:last-child { margin-bottom: 0; }
.tv-tab-pane .grid-2 { align-items: start; }
@media (max-width: 640px) {
    .tv-tabs { top: 58px; border-radius: 12px; }
    .tv-tab { padding: 8px 11px; font-size: 11.5px; }
}

/* ---------- ۵) داشبورد کاربر ---------- */
.dash-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: stretch; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius-lg); /* v28.92: فشرده‌تر */
    color: #fff; background: linear-gradient(135deg, var(--navy-3) 0%, var(--accent-dark) 48%, var(--brand-pink) 100%);
    box-shadow: 0 18px 40px -22px rgba(91, 33, 182, .75);
}
.dash-hero::before, .dash-hero::after {
    content: ""; position: absolute; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
}
.dash-hero::before { width: 260px; height: 260px; inset-inline-start: -80px; top: -120px; }
.dash-hero::after { width: 200px; height: 200px; inset-inline-end: 30%; bottom: -130px; }
.dash-hero-main { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; min-width: 0; }
.dash-hero-avatar {
    width: 42px; height: 42px; border-radius: 13px; font-size: 18px; flex-shrink: 0;
    background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
    display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.dash-hero-hello { font-size: 15px; font-weight: 800; line-height: 1.5; }
.dash-hero-sub { font-size: 11.5px; opacity: .82; margin-bottom: 4px; }
.dash-hero-badge {
    display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700;
    padding: 2px 9px; border-radius: 99px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
}
.dash-hero-wallet {
    position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center;
    padding: 10px 14px; border-radius: 16px; min-width: 220px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(6px);
}
.dash-hero-wallet-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; opacity: .85; }
.dash-hero-wallet-amt { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.dash-hero-wallet-amt.is-neg { color: #fecdd3; }
.dash-hero-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.dash-hero-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 10px;
    font-size: 12px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25); transition: background var(--transition), transform var(--transition);
}
.dash-hero-btn:hover { background: rgba(255, 255, 255, .24); color: #fff; transform: translateY(-1px); }
.dash-hero-btn.primary { background: #fff; color: var(--accent-dark); border-color: #fff; }
.dash-hero-btn.primary:hover { background: color-mix(in srgb, var(--accent) 8%, #fff); color: var(--accent-dark); }

.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.dash-stat {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.dash-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); color: var(--text); }
.dash-stat.is-alert { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.dash-stat-body { display: flex; flex-direction: column; min-width: 0; }
.dash-stat-val { font-size: 20px; font-weight: 800; line-height: 1.3; }
.dash-stat-val-sm { font-size: 14px; }
.dash-stat-lbl { font-size: 11.5px; color: var(--text-dim); font-weight: 600; }

.dash-alert {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius);
    background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); color: #92400e;
    font-size: 12.5px; font-weight: 600;
}
.dash-alert-icon { color: var(--warn); display: inline-flex; }
.dash-alert-text { flex: 1; }
[data-theme="dark"] .dash-alert { color: #fcd34d; }

.dash-tg {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.dash-tg-icon {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #229ed9, #0088cc); color: #fff;
}
.dash-tg-text { flex: 1; min-width: 0; }
.dash-tg-title { font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-tg-title .badge { font-size: 10px; }
.dash-tg-sub { font-size: 11.5px; color: var(--text-dim); }

.dash-reseller {
    display: flex; align-items: center; gap: 12px; padding: 11px 16px; margin-bottom: 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px dashed var(--border-strong); color: var(--text-dim); font-size: 12.5px;
    transition: border-color var(--transition), color var(--transition);
}
.dash-reseller b { color: var(--text); }
.dash-reseller:hover { border-color: var(--accent); color: var(--text); }
.dash-reseller .stat-icon { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; }
.dash-reseller span:nth-child(2) { flex: 1; }
.dash-reseller-arrow { font-size: 18px; color: var(--accent); }

@media (max-width: 900px) {
    .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 640px) {
    .dash-hero { padding: 12px; gap: 10px; border-radius: 18px; }
    .dash-hero-avatar { width: 38px; height: 38px; font-size: 16px; border-radius: 12px; }
    .dash-hero-hello { font-size: 14px; }
    .dash-hero-sub { margin-bottom: 3px; }
    .dash-hero-wallet { min-width: 0; width: 100%; padding: 9px 12px; }
    .dash-hero-wallet-amt { font-size: 17px; }
    .dash-hero-btn { padding: 6px 10px; }
    .dash-hero-actions .dash-hero-btn { flex: 1; justify-content: center; }
    .dash-stat { padding: 12px; gap: 10px; }
    .dash-stat .stat-icon { width: 34px; height: 34px; }
    .dash-stat-val { font-size: 17px; }
    .dash-alert { flex-wrap: wrap; }
    .dash-tg { flex-wrap: wrap; }
    .dash-tg .btn { width: 100%; justify-content: center; }
}

/* ---------- ۶) کارت سرویس: نوار باقیمانده ---------- */
.sc-usage { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; width: 100%; align-self: stretch; }
.sc-usage-track { min-width: 60px; }
.sc-usage-track { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.sc-usage-fill { display: block; height: 100%; border-radius: inherit; transition: width .6s ease; background: var(--success-2); }
.sc-usage-fill.tone-ok { background: linear-gradient(90deg, #10b981, #34d399); }
.sc-usage-fill.tone-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.sc-usage-fill.tone-danger { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.sc-usage-label { font-size: 11px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }

/* ---------- ۷) داشبورد مدیر: بخش‌های جمع‌شونده ---------- */
.tv-collapse { border-radius: var(--radius); }
.tv-collapse > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px; font-weight: 800; font-size: 13px;
}
.tv-collapse > summary::-webkit-details-marker { display: none; }
.tv-collapse > summary::after {
    content: ""; width: 9px; height: 9px; border-inline-end: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
    transform: rotate(45deg); transition: transform var(--transition); margin-inline-start: 6px; flex-shrink: 0;
}
.tv-collapse[open] > summary::after { transform: rotate(-135deg); }
.tv-collapse > summary .tv-collapse-sub { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.tv-collapse-body { padding: 0 18px 16px; }

/* ---------- ۸) موبایل: لمس‌پذیری و فاصله از ناوبری پایین ---------- */
@media (max-width: 640px) {
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; }
    .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    .customer-body .content, .customer-main .content { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
    .panel-card-header { flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr !important; }
}

/* ---------- ۹) کاهش حرکت برای کاربرانی که ترجیح می‌دهند ---------- */
@media (prefers-reduced-motion: reduce) {
    .dash-stat, .dash-hero-btn, .sc-usage-fill, .tv-tab { transition: none !important; }
}

/* کارت‌هایی که سرصفحهٔ جدا ندارند (عنوان مستقیم داخل کارت) فاصلهٔ داخلی یکدست بگیرند */
.tv-tab-pane .panel-card:has(> .panel-card-title) { padding: 18px 20px; }
@media (max-width: 640px) { .tv-tab-pane .panel-card:has(> .panel-card-title) { padding: 14px; } }

/* داشبورد مدیر: ۶ کاشی آماری در دسکتاپ یک ردیف کامل یا ۳×۲ (نه ۵ + ۱ تنها) */
.stat-grid { margin-top: 14px; }
@media (min-width: 1280px) { .stat-grid:has(> .stat-card:nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 900px) and (max-width: 1279px) { .stat-grid:has(> .stat-card:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tv-dismiss { border: 0; background: transparent; color: var(--text-faint); font: inherit; font-size: 11.5px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.tv-dismiss:hover { background: var(--surface-3); color: var(--text); }

/* v28.56: دایرهٔ حجم/زمان باقیمانده روی کارت سرویس (conic-gradient بر اساس --pct) */
.config-ring {
    --ring-c: var(--success-2, #10b981);
    border-radius: 50%;
    background: conic-gradient(var(--ring-c) calc(var(--pct, 0) * 1%), var(--surface-2, #eef0f6) 0);
    transition: background .4s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.config-ring.tone-warn { --ring-c: var(--warn-2, #f59e0b); }
.config-ring.tone-danger { --ring-c: var(--danger-2, #f43f5e); }
.config-ring.tone-hold { --ring-c: var(--primary, var(--accent)); }
.config-ring-inner { border-radius: 50%; text-align: center; }
.service-card .config-ring-inner { position: absolute; inset: 5px; width: auto; height: auto; }

/* =====================================================================
   v28.63 — بازبینی نهایی UI
   ===================================================================== */
/* کارت‌های بدون سرکارت/بدنه: فاصلهٔ داخلی متقارن (قبلاً محتوا به لبهٔ چپ می‌چسبید) */
.panel-card:not(:has(> .panel-card-header, > .panel-card-body, > .table-wrap, > table, > .table-responsive, > form > .panel-card-header)) { padding: 18px 20px; }
@media (max-width: 640px) { .panel-card:not(:has(> .panel-card-header, > .panel-card-body, > .table-wrap, > table, > .table-responsive, > form > .panel-card-header)) { padding: 14px 15px; } }

/* فیلدها در حالت شب هم با سطح کارت هماهنگ باشند */
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=number], [data-theme="dark"] input[type=password],
[data-theme="dark"] input[type=email], [data-theme="dark"] input[type=search], [data-theme="dark"] input[type=tel],
[data-theme="dark"] input[type=url], [data-theme="dark"] select, [data-theme="dark"] textarea { background-color: var(--surface-2); color: var(--text); border-color: var(--border); }

/* کارت سرویس موبایل: دکمهٔ مدیریت جمع‌وجورتر تا نام سرویس بریده نشود */
@media (max-width: 640px) {
  /* نوار مصرف تمام‌عرض؛ قبلاً در ستون اول می‌نشست و ستون نام را به ۴۰ پیکسل می‌رساند */
  .service-card .sc-usage { grid-column: 1 / -1; contain: inline-size; min-width: 0; }
}
@media (max-width: 480px) {
  .service-card.has-manage .js-service-manage { padding: 7px 9px; font-size: 11px; }
  .service-card .js-service-manage .sm-hide { display: none; }
  .service-card .config-name { font-size: 13px; }
}

/* نوار بالای موبایل مشتری: شلوغی کمتر */
@media (max-width: 430px) {
  #notifyMuteBtnCustomer { display: none; }
  .cs-mobile-user-type { display: none !important; }
  .cs-mobile-actions { gap: 6px; }
}

/* نشان‌های برند و دکمه‌های اصلی با پالت هماهنگ */
.badge-purple { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .badge-purple { color: var(--accent-light); }
.btn, .btn-accent { transition: filter var(--transition), transform var(--transition), box-shadow var(--transition); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table thead th { position: sticky; top: 0; z-index: 1; }

/* v28.72 — سوییچ‌های لینک پشتیبان پنل + جعبهٔ لینک پشتیبان در کارت سرویس */
.tv-switch-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.tv-switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius, 14px); cursor: pointer; margin: 0; background: var(--surface, transparent); }
.tv-switch-row:hover { border-color: var(--accent-light, var(--accent)); }
.tv-switch-row input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tv-switch { flex: 0 0 auto; position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong, #cbd5e1); transition: background .2s; margin-top: 2px; }
.tv-switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.tv-switch-row input:checked + .tv-switch { background: var(--accent); }
.tv-switch-row input:checked + .tv-switch::after { transform: translateX(-18px); }
.tv-switch-row input:focus-visible + .tv-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.tv-switch-text { display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.6; }
.tv-switch-text small { color: var(--text-dim, #6b7280); font-size: 11.5px; font-weight: 400; }
/* v28.72.1: کارت لینک پشتیبان — ردیفی و مرتب؛ تمام‌عرض در شبکهٔ موبایل تا دکمهٔ «مدیریت» کشیده نشود */
.tv-backup-box { margin-top: 8px; padding: 9px 10px; border: 1px dashed rgba(var(--accent-rgb), .55); border-radius: 12px; background: rgba(var(--accent-rgb), .06); min-width: 0; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; }
.tv-backup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tv-backup-title { font-size: 12.5px; font-weight: 800; color: var(--accent); }
.tv-backup-note { font-size: 11px; line-height: 1.7; color: var(--text-dim, #6b7280); }
.tv-backup-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 8px; border-radius: 9px; background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); }
.tv-backup-lbl { flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--text-dim, #6b7280); }
.tv-backup-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; font-size: 11px; }
.tv-backup-row .btn { flex-shrink: 0; }
@media (max-width: 640px) {
  .service-card .tv-backup-box { grid-column: 1 / -1; contain: inline-size; margin-top: 4px; }
  .service-card .tv-backup-url { display: none; }
  .service-card .tv-backup-lbl { flex: 1; }
  .service-card .tv-backup-row .btn { min-height: 32px; padding-inline: 10px; }
}

/* =====================================================================
   v28.73.0 — تیکت: چیپ وضعیت + بج زندهٔ خوانده‌نشده در منو (همهٔ صفحات)
   ===================================================================== */
/* ---------- چیپ وضعیت (مشترک فهرست و گفتگو) ---------- */
.tv-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 99px;
    font-size: 10.5px; font-weight: 800; line-height: 1.9; white-space: nowrap;
    border: 1px solid transparent;
}
.tv-chip::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .9; }
.tv-chip.st-open     { color: var(--warn);    background: var(--warn-soft);    border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.tv-chip.st-answered { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.tv-chip.st-waiting  { color: var(--blue);    background: var(--blue-soft);    border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.tv-chip.st-closed   { color: var(--text-faint); background: var(--surface-3); border-color: var(--border); }
.tv-chip.pr-high     { color: var(--danger);  background: var(--danger-soft);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.tv-chip.pr-high::before { content: none; }

/* بج تعداد خوانده‌نشده (منو و فهرست) */
.tv-badge {
    min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    font-size: 10.5px; font-weight: 800; line-height: 1;
    box-shadow: 0 2px 8px -2px rgba(var(--accent-rgb), .55);
}
.tv-nav-badge { margin-inline-start: auto; }
.tv-badge[hidden], .tv-nav-badge[hidden] { display: none !important; }
.cs-bottom-link { position: relative; }
.cs-bottom-link .tv-nav-badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 4px); min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }


/* ===================== v28.74 — فیلترهای هوشمند سرویس‌ها ===================== */
.tv-of-form { margin: 0; }
.tv-of { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 14px; }
.tv-of-chips {
    display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 6px;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.tv-of-chip {
    flex: 0 0 auto; scroll-snap-align: start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 99px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
    font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s;
}
.tv-of-chip:hover { border-color: var(--accent); color: var(--text); }
.tv-of-chip:active { transform: scale(.97); }
.tv-of-emo { font-size: 13px; line-height: 1; }
.tv-of-n {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 800;
}
.tv-of-chip.is-zero { opacity: .55; }
.tv-of-chip.is-on {
    background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1;
    box-shadow: 0 6px 16px -8px rgba(var(--accent-rgb), .7);
}
.tv-of-chip.is-on .tv-of-n { background: color-mix(in srgb, var(--surface) 25%, transparent); color: #fff; }
.tv-of-chip.of-ending:not(.is-on):not(.is-zero) .tv-of-n,
.tv-of-chip.of-time:not(.is-on):not(.is-zero) .tv-of-n { background: var(--warn-soft); color: var(--warn); }
.tv-of-chip.of-vol:not(.is-on):not(.is-zero) .tv-of-n { background: var(--danger-soft); color: var(--danger); }
.tv-of-chip.of-active:not(.is-on):not(.is-zero) .tv-of-n { background: var(--success-soft); color: var(--success); }
.tv-of-thr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--text-faint); }
.tv-of-thr label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; color: var(--text-faint); }
.tv-of-thr input {
    width: 64px; padding: 5px 8px; border-radius: 9px; text-align: center;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 800; font-size: 12.5px;
}
.tv-of-thr input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.tv-of-panel {
    display: inline-flex; align-items: center; gap: 6px; margin: 0;
    padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-dim);
}
.tv-of-panel select { border: 0 !important; background: transparent !important; color: var(--text); padding: 8px 2px !important; font: inherit; font-size: 13px; min-width: 130px; box-shadow: none !important; }
@media (max-width: 640px) {
    .tv-of-chips { margin-inline: -4px; padding-inline: 4px; }
    .tv-of-chip { padding: 7px 11px; font-size: 12px; }
    .tv-of-panel { width: 100%; }
    .tv-of-panel select { flex: 1; }
}

/* ===================== v28.74 — مدیریت پیام‌های پاپ‌آپ ===================== */
.tvpa-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.tvpa-live { position: sticky; top: 84px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 20px; background: var(--surface-2); }
.tvpa-live-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--text-faint); margin-bottom: 12px; }
@media (max-width: 960px) { .tvpa-grid { grid-template-columns: 1fr; } .tvpa-live { position: static; } }
.tvpa-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tvpa-style { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 8px 6px; border-radius: 14px; border: 2px solid var(--border); cursor: pointer; background: var(--surface); transition: border-color .15s, transform .12s; }
.tvpa-style input { position: absolute; opacity: 0; pointer-events: none; }
.tvpa-style-sw { width: 100%; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: linear-gradient(135deg, var(--tvpop-a), var(--tvpop-b)); }
.tvpa-style-l { font-size: 10.5px; font-weight: 700; color: var(--text-dim); text-align: center; line-height: 1.5; }
.tvpa-style:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.tvpa-style:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--ring); }
.tvpa-emo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tvpa-emo { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 18px; cursor: pointer; transition: transform .12s; }
.tvpa-emo:hover { transform: scale(1.12); }
.tvpa-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tvpa-title > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tvpa-title small { color: var(--text-faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.tvpa-sw { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: linear-gradient(135deg, var(--tvpop-a), var(--tvpop-b)); }
.tvpa-row-on td { background: var(--accent-soft); }
.tvpa-actions { min-width: 250px; }

/* ===================== v28.76 — صفحهٔ سفارش‌های مدیر: چیدمان واکنش‌گرا ===================== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* td.cell-actions با display:flex از حالت سلول جدول خارج می‌شد و ستون/خط ردیف‌ها (مثل فهرست کاربران) کج می‌شد */
@media (min-width: 641px) { .data-table tbody td.cell-actions { display: table-cell; } }

/* سربرگ: تب‌های وضعیت + دکمهٔ ثبت */
.ol-head { display: flex; align-items: center; gap: 10px 12px; margin-bottom: 14px; min-width: 0; }
.ol-tabs { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ol-tabs::-webkit-scrollbar { display: none; }
.ol-tabs a { white-space: nowrap; flex: 0 0 auto; }
.ol-tab-n { opacity: .7; font-weight: 600; }
.ol-new { flex: 0 0 auto; white-space: nowrap; }

/* کارت اصلی: پاپ‌اورها بریده نشوند */
.ol-card { overflow: visible; }
.ol-filters { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 4px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.ol-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ol-search { position: relative; flex: 1 1 320px; min-width: 0; display: flex; align-items: center; }
.ol-search-ic { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); display: inline-flex; pointer-events: none; }
.ol-search input[type=text] { width: 100%; min-width: 0; padding-inline-start: 36px; padding-inline-end: 96px; height: 40px; }
.ol-search-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); min-height: 32px !important; height: 32px; gap: 5px; }
.ol-filters .tv-of-panel { flex: 0 1 240px; min-width: 0; height: 40px; }
.ol-filters .tv-of-panel select { min-width: 0; width: 100%; text-overflow: ellipsis; }
.ol-hint { margin: 0; font-size: 11.5px; }
.ol-filters .tv-of { padding: 0 0 10px; gap: 8px; }
.ol-filters .tv-of-chips { flex-wrap: wrap; overflow: visible; padding: 0; }

/* جدول */
.ol-wrap { width: 100%; }
.ol-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px; }
.ol-table thead th {
    text-align: start; font-size: 11px; font-weight: 700; color: var(--text-dim); white-space: nowrap;
    background: var(--surface-2); padding: 10px 12px; border-bottom: 1.5px solid var(--border);
}
.ol-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; min-width: 0; overflow-wrap: anywhere; }
.ol-table tbody tr { transition: background var(--transition); }
.ol-table tbody tr:hover > td { background: var(--surface-2); }
.ol-table tbody tr:last-child > td { border-bottom: 0; }
.ol-table .ol-c-cust { width: 24%; }
.ol-table .ol-c-st { width: 122px; }
.ol-table .ol-c-exp { width: 132px; }
.ol-table .ol-c-price { width: 124px; }
.ol-table .ol-c-act { width: 136px; }
.ol-name { display: block; font-weight: 800; font-size: 12.8px; color: var(--accent-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; font-size: 10.8px; color: var(--text-faint); }
.ol-id { font-size: 10.5px; color: var(--text-faint); }
.ol-prod { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-user { margin-top: 2px; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: end; direction: ltr; unicode-bidi: plaintext; }
.ol-svc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 6px; min-width: 0; }
.ol-panel { max-width: 100%; min-width: 0; }
.ol-panel > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ol-panel svg { flex: 0 0 auto; }
.ol-links { display: inline-flex; align-items: center; gap: 4px; }
.ol-bk-tag { font-size: 10px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.ol-c-st .badge { white-space: nowrap; }
.ol-settled { display: inline-flex; align-items: center; gap: 3px; margin-top: 5px; font-size: 10.5px; font-weight: 700; color: var(--success); white-space: nowrap; }
.ol-c-st .ol-settled { display: flex; }
.ol-alt { display: none; margin-top: 5px; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.ol-exp { font-weight: 700; font-size: 12px; white-space: nowrap; }
.ol-left.is-warn { color: var(--warn); font-weight: 700; }
.ol-left.is-bad { color: var(--danger); font-weight: 700; }
.ol-usage { margin-top: 4px; font-size: 10.8px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-bar { margin-top: 4px; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; max-width: 120px; }
.ol-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.ol-bar.is-warn > i { background: var(--warn); }
.ol-bar.is-bad > i { background: var(--danger); }
.ol-price { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* دکمه‌های آیکونی فشرده */
.ol-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.ol-ib {
    position: relative; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-width: 32px; height: 32px; padding: 0 8px; border-radius: 9px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
    font: inherit; font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; list-style: none;
    text-decoration: none; transition: var(--transition);
}
.ol-ib::-webkit-details-marker { display: none; }
.ol-ib:hover, .ol-pop[open] > .ol-ib { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.ol-ib:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.ol-ib svg { flex: 0 0 auto; }
.ol-svc-meta .ol-ib { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; }
.ol-ib-txt { font-size: 10px; letter-spacing: .3px; }
.ol-ib-accent { color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.ol-ib-lbl { display: none; }
.ol-ib.has-dot::after { content: ''; position: absolute; top: 4px; inset-inline-end: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 2px var(--surface); }
.ol-ib.is-settled { color: var(--success); }
.ol-dots { font-size: 18px; line-height: 0; transform: translateY(-1px); }

/* پاپ‌اورها (یادداشت/تسویه + منوی ⋯) */
.ol-pop { position: relative; }
.ol-pop > summary { list-style: none; }
.ol-pop-body {
    position: absolute; z-index: 40; top: calc(100% + 6px); inset-inline-end: 0;
    min-width: 230px; max-width: min(300px, 86vw); padding: 10px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
    text-align: start;
}
.ol-pop.is-up > .ol-pop-body { top: auto; bottom: calc(100% + 6px); }
.ol-pop-title { font-size: 11.5px; font-weight: 800; color: var(--text-dim); }
.ol-note-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ol-note-form textarea { width: 100%; min-height: 70px; resize: vertical; font-size: 12.5px; }
.ol-note-form .check-row { padding: 0; font-size: 12px; }
.ol-note-form .btn { align-self: flex-start; }
.ol-menu-list { min-width: 200px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.ol-menu-list form { margin: 0; }
.ol-menu-list a, .ol-menu-list button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 9px;
    border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700;
    text-align: start; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ol-menu-list a:hover, .ol-menu-list button:hover { background: var(--surface-2); }
.ol-menu-list .ol-danger { color: var(--danger); }
.ol-menu-list .ol-danger:hover { background: var(--danger-soft); }

/* لپ‌تاپ کوچک / تبلت افقی: ستون مبلغ پنهان، مبلغ زیر وضعیت */
@media (max-width: 1280px) and (min-width: 1025px), (max-width: 900px) and (min-width: 768px) {
    .ol-table .ol-c-price { display: none; }
    .ol-alt { display: block; }
    .ol-table .ol-c-cust { width: 23%; }
}

/* موبایل (<۷۶۸px): هر ردیف یک کارت فشرده */
@media (max-width: 767.98px) {
    .ol-head { flex-direction: column; align-items: stretch; }
    .ol-head .ol-tabs { width: 100%; }
    .ol-new { justify-content: center; }
    .ol-filters { padding: 12px 12px 2px; }
    .ol-filter-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .ol-search { flex: 0 0 auto; }
    .ol-search input[type=text] { padding-inline-end: 46px; height: 44px; }
    .ol-search-btn span { display: none; }
    .ol-search-btn { padding: 0 9px; }
    .ol-filters .tv-of-panel { flex: 0 0 auto; width: 100%; height: 44px; }
    .ol-filters .tv-of-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding: 2px 12px 6px; scrollbar-width: none; }
    .ol-filters .tv-of-chips::-webkit-scrollbar { display: none; }
    .ol-filters .tv-of-thr { gap: 6px 12px; }

    .ol-wrap { padding: 10px; }
    .ol-table, .ol-table tbody { display: block; width: 100%; table-layout: auto; }
    .ol-table thead { display: none; }
    .ol-table tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "cust st" "svc svc" "exp price" "act act";
        gap: 0 10px; margin: 0 0 10px; padding: 12px 12px 10px;
        background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    }
    .ol-table tbody tr:last-child { margin-bottom: 0; }
    .ol-table tbody tr:hover > td { background: transparent; }
    .ol-table tbody td, .ol-table tbody tr:last-child > td { display: block; width: auto !important; padding: 0; border: 0; min-width: 0; }
    .ol-table td.ol-c-cust { grid-area: cust; }
    .ol-table td.ol-c-st { grid-area: st; text-align: end; }
    .ol-table td.ol-c-svc { grid-area: svc; margin-top: 10px; padding: 9px 10px; background: var(--surface-2); border-radius: 11px; }
    .ol-table td.ol-c-exp { grid-area: exp; margin-top: 10px; }
    .ol-table td.ol-c-price { grid-area: price; margin-top: 10px; text-align: end; display: block !important; }
    .ol-table td.ol-c-act { grid-area: act; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
    .ol-c-price .ol-sub { justify-content: flex-end; }
    .ol-alt { display: none !important; }
    .ol-c-st .ol-settled { justify-content: flex-end; }
    .ol-name { font-size: 13.5px; }
    .ol-user { text-align: start; direction: ltr; }
    .ol-bar { max-width: none; }
    .ol-actions { justify-content: stretch; flex-wrap: wrap; }
    .ol-actions > .ol-pop:first-child, .ol-actions > .ol-ib-accent { flex: 1 1 0; }
    .ol-actions .ol-ib { height: 38px; width: 100%; }
    .ol-actions .ol-menu .ol-ib { width: 42px; }
    .ol-ib-lbl { display: inline; }
    .ol-svc-meta .ol-ib { min-width: 32px; height: 32px; }
    /* پاپ‌اور در کارت موبایل به عرض کامل ردیف دکمه‌ها باز می‌شود */
    .ol-actions { position: relative; }
    .ol-pop { position: static; }
    .ol-pop-body { inset-inline: 0; max-width: none; min-width: 0; }
}
@media (max-width: 1280px) and (min-width: 768px) {
    .ol-c-st .badge { padding: 3px 8px; gap: 4px; font-size: 10px; }
    .ol-usage { white-space: normal; }
    .ol-table thead th, .ol-table tbody td { padding-inline: 9px; }
    .ol-table .ol-c-act { width: 128px; }
    .ol-table .ol-c-exp { width: 118px; }
    .ol-table .ol-c-st { width: 116px; }
    .ol-bk-txt { display: none; }
    .ol-bk-tag { padding: 2px 5px; }
    .ol-svc-meta { gap: 4px 5px; }
}
@media (max-width: 1100px) {
    .ol-tabs { -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); }
}

/* ==========================================================================
   v28.77 — پشتیبان‌گیری و بازیابی (maintenance.php + install.php) — فقط متغیرهای پالت
   ========================================================================== */
.bk-wrap { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.bk-hero { padding: 20px; position: relative; overflow: hidden; }
.bk-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--brand-gradient); }
.bk-hero-head { display: flex; gap: 14px; align-items: flex-start; }
.bk-hero-icon { flex: 0 0 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.bk-hero-txt h2 { margin: 0 0 4px; font-size: 17px; font-weight: 800; color: var(--text); }
.bk-hero-txt p { margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.9; }
.bk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 14px; }
.bk-stat { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.bk-stat-l { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.bk-stat-v { font-size: 13.5px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-stat-s { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--text-faint); flex: 0 0 8px; }
.bk-dot-on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-inline { display: inline; margin: 0; }
.bk-foot { margin-top: 12px; font-size: 11.5px; color: var(--text-dim); border-top: 1px dashed var(--border); padding-top: 10px; }
.bk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bk-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; margin-inline-start: 4px; }
.bk-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-dim); }
.bk-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.bk-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 110px 150px 80px 120px 272px; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.bk-row:first-child { border-top: 0; }
.bk-row:not(.bk-row-head):hover { background: var(--surface-2); }
.bk-row-head { background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--text-faint); padding-block: 8px; }
.bk-c-name { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bk-fname { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bk-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-dim); white-space: nowrap; }
.bk-chip-acc { background: var(--accent-soft); color: var(--accent); }
.bk-c-date { font-size: 12px; color: var(--text-dim); }
.bk-msize { display: none; }
.bk-c-size { font-size: 12px; color: var(--text); }
.bk-health { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; }
.bk-health::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.bk-h-ok { color: var(--success); }
.bk-h-bad { color: var(--danger); }
.bk-h-old { color: var(--warn); }
.bk-h-lock { color: var(--purple); }
.bk-c-act { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.bk-ib { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 32px; min-width: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; text-decoration: none; transition: var(--transition); }
.bk-ib:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.bk-ib-acc { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.bk-ib-acc:hover { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); }
.bk-ib-danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.bk-ib-l { display: none; }
.bk-ib-acc .bk-ib-l { display: inline; }
.bk-ib.is-busy, .btn.is-busy { opacity: .6; pointer-events: none; }
.btn.is-busy::after, .bk-ib.is-busy::after { content: ''; width: 12px; height: 12px; border-radius: 99px; border: 2px solid currentColor; border-inline-end-color: transparent; animation: bk-spin .7s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.bk-grid .panel-card { margin: 0; }
.bk-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 22px 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--text-dim); cursor: pointer; text-align: center; transition: var(--transition); position: relative; }
.bk-drop:hover, .bk-drop.has-file { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.bk-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.bk-drop-t { font-weight: 800; font-size: 13px; color: var(--text); }
.bk-drop-f { font-size: 11.5px; direction: ltr; word-break: break-all; }
.bk-flash { animation: bk-flash 1.6s ease; }
@keyframes bk-flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: var(--ring), var(--shadow); } }
.bk-set-sec { font-size: 12px; font-weight: 800; color: var(--accent-dark); margin: 14px 0 6px; padding-inline-start: 9px; border-inline-start: 3px solid var(--accent); }
.bk-set-sec:first-of-type { margin-top: 4px; }
.bk-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; margin-top: 6px; }
.bk-fields .field { margin-bottom: 10px; }
.bk-fields .field label { font-size: 11.5px; }
.bk-set .check-row { align-items: flex-start; line-height: 1.8; }
.bk-set .check-row input { margin-top: 5px; }
.bk-muted { color: var(--text-faint); font-weight: 500; }
.bk-set-foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
/* پنجرهٔ بازیابی */
html.bk-lock { overflow: hidden; }
.bk-modal[hidden] { display: none; }
.bk-modal-box { max-width: 520px; position: relative; max-height: min(92vh, 92dvh); overflow-y: auto; }
.bk-x { position: absolute; top: 14px; inset-inline-end: 14px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); display: grid; place-items: center; cursor: pointer; }
.bk-modal.is-running .bk-x { display: none; }
.bk-m-file { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); margin: 4px 0 12px; }
.bk-m-fname { font-size: 12px; color: var(--text); word-break: break-all; text-align: start; }
.bk-m-flabel { font-size: 11.5px; color: var(--text-dim); }
.bk-m-warn { font-size: 12px; line-height: 1.9; }
.bk-m-opts { margin: 4px 0 10px; }
.bk-m-opts .check-row { align-items: flex-start; line-height: 1.8; }
.bk-m-opts .check-row input { margin-top: 5px; }
.bk-m-opts .check-row[hidden], .bk-m-pwd[hidden] { display: none; }
.bk-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 10px 0 8px; }
.bk-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand-gradient); transition: width .35s ease; }
.bk-done .bk-bar i { background: var(--success); }
.bk-failed .bk-bar i { background: var(--danger); }
.bk-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bk-steps li { position: relative; padding: 8px 34px 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; line-height: 1.8; }
.bk-steps li::before { position: absolute; top: 8px; inset-inline-start: 10px; width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; content: '✓'; background: var(--success); }
.bk-steps li b { display: block; color: var(--text); font-weight: 700; }
.bk-steps li span { display: block; color: var(--text-dim); font-size: 11.5px; word-break: break-word; }
.bk-steps .bk-st-warn::before { content: '!'; background: var(--warn); }
.bk-steps .bk-st-err::before { content: '×'; background: var(--danger); }
.bk-steps .bk-st-err { border-color: var(--danger); background: var(--danger-soft); }
.bk-steps .bk-st-info::before { content: 'i'; background: var(--blue); }
.bk-run-step { min-height: 18px; }
.bk-done .bk-run-title { color: var(--success); }
.bk-failed .bk-run-title { color: var(--danger); }
/* نصب از روی بک‌آپ */
.inst-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 14px; }
.inst-mode label { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); transition: var(--transition); }
.inst-mode label b { font-size: 13px; color: var(--text); }
.inst-mode label span { font-size: 11px; color: var(--text-dim); line-height: 1.7; }
.inst-mode input { position: absolute; opacity: 0; pointer-events: none; }
.inst-mode label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.inst-check { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.inst-check li { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; line-height: 1.9; }
.inst-check li b { color: var(--text); }
.inst-cmd { display: block; direction: ltr; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; margin-top: 6px; word-break: break-all; color: var(--text); }
@media (max-width: 1280px) {
    .bk-row { grid-template-columns: minmax(0, 2fr) 100px 128px 72px 104px 228px; }
}
@media (max-width: 1100px) {
    .bk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bk-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .bk-row-head { display: none; }
    .bk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name type" "meta health" "act act"; gap: 8px 10px; padding: 13px; }
    .bk-c-name { grid-area: name; }
    .bk-c-type { grid-area: type; justify-self: end; }
    .bk-c-date { grid-area: meta; }
    .bk-c-size { grid-area: meta; justify-self: end; margin-inline-end: 0; display: none; }
    .bk-c-health { grid-area: health; justify-self: end; }
    .bk-c-act { grid-area: act; justify-content: stretch; border-top: 1px dashed var(--border); padding-top: 9px; }
    .bk-c-act > * { flex: 1 1 0; }
    .bk-c-act .bk-ib { width: 100%; flex-direction: column; gap: 2px; height: 46px; padding: 0 4px; font-size: 10.5px; }
    .bk-c-act .bk-ib-l { display: inline; }
    .bk-c-act form { display: flex; }
    .bk-msize { display: inline; }
}
@media (max-width: 640px) {
    .bk-hero { padding: 16px; }
    .bk-hero-icon { flex-basis: 40px; height: 40px; }
    .bk-hero-txt h2 { font-size: 15.5px; }
    .bk-stats { gap: 8px; }
    .bk-stat { padding: 9px 10px; }
    .bk-stat-v { font-size: 12.5px; }
    .bk-actions .btn, .bk-actions form { flex: 1 1 auto; }
    .bk-actions form .btn { width: 100%; }
    .bk-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .inst-mode { grid-template-columns: 1fr; }
}
.bk-modal { z-index: 3000; }
.bk-m-run .bk-steps { max-height: min(48vh, 420px); overflow-y: auto; padding-inline-end: 2px; }
.bk-steps li { padding-block: 6px; }

/* v28.77 — فهرست پیام‌های پاپ‌آپ (admin|mfaa/popups.php): ستون عملیات دیگر از جدول بیرون نمی‌زند */
.pp-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pp-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px 145px 112px 372px; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.pp-row:last-child { border-bottom: 0; }
.pp-row:not(.pp-row-head):hover { background: var(--surface-2); }
.pp-row-head { padding-block: 9px; background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--text-faint); }
.pp-row-on { background: var(--accent-soft) !important; box-shadow: inset -3px 0 0 var(--accent); }
.pp-c-msg { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pp-msg-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-body { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-c-st { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pp-sub { font-size: 11.5px; color: var(--text-dim); }
.pp-c-range, .pp-c-num { display: flex; flex-direction: column; gap: 2px; }
.pp-c-act { display: flex; flex-wrap: nowrap; gap: 4px; justify-content: flex-end; }
.pp-f { margin: 0; display: inline-flex; }
.pp-ib { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 34px; min-width: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; text-decoration: none; transition: var(--transition); }
.pp-ib:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.pp-ib-acc { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.pp-ib-acc:hover { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.pp-ib-on { color: var(--success); border-color: var(--success-soft); background: var(--success-soft); }
.pp-ib-danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.pp-ib-danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.pp-ib:disabled { opacity: .45; cursor: not-allowed; }
/* v28.78 — «ویرایش» و «حذف» همیشه با متن؛ بقیه از ۱۲۸۰px به بالا با متن و زیر آن فقط آیکون (title) */
.pp-ib-l { display: none; white-space: nowrap; }
.pp-ib-acc .pp-ib-l, .pp-ib-danger .pp-ib-l { display: inline; }
@media (min-width: 1280px) { .pp-ib-l { display: inline; } }
@media (max-width: 1439px) {
    .pp-row { grid-template-columns: minmax(0, 1fr) 170px 132px 372px; }
    .pp-c-num, .pp-row-head > span:nth-child(4) { display: none; }
}
@media (max-width: 1279px) {
    .pp-row { grid-template-columns: minmax(0, 1fr) 160px 128px 252px; }
}
@media (max-width: 900px) {
    .pp-row-head { display: none; }
    .pp-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "msg st" "meta meta" "act act"; gap: 8px 10px; padding: 13px 14px; }
    .pp-c-msg { grid-area: msg; }
    .pp-c-st { grid-area: st; align-items: flex-end; }
    .pp-c-st .pp-sub { display: none; }
    .pp-c-range { grid-area: meta; flex-direction: row; flex-wrap: wrap; gap: 2px 10px; }
    .pp-c-range::before { content: attr(data-meta); }
    .pp-c-num { display: none; }
    .pp-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.7; }
    .pp-c-act { grid-area: act; border-top: 1px dashed var(--border); padding-top: 9px; justify-content: stretch; }
    .pp-c-act > * { flex: 1 1 0; }
    .pp-c-act .pp-ib { width: 100%; flex-direction: column; gap: 2px; height: 46px; padding: 0 4px; font-size: 10.5px; }
    .pp-c-act .pp-ib-l { display: inline; }
}
[data-theme="dark"] .pp-c-msg .tvpa-sw { box-shadow: inset 0 0 0 1px var(--border-strong); }
.bk-m-err[hidden], #ir-err[hidden], .bk-m-run[hidden], .bk-m-form[hidden] { display: none !important; }

/* v28.78 — فرم پیام پاپ‌آپ در مودال (فقط وقتی JS فعال است: html.js-on؛ بدون JS همان فرم درون‌صفحه‌ای) */
.pp-modal-bd, .pp-modal-x { display: none; }
html.js-on .pp-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; }
html.js-on .pp-modal:not(.is-open) { display: none; }
html.js-on .pp-modal-bd { display: block; position: absolute; inset: 0; background: rgba(7, 10, 24, .55); backdrop-filter: blur(3px); animation: content-in .18s ease both; }
html.js-on .pp-modal-box { position: relative; width: 100%; max-width: 820px; max-height: min(92vh, 92dvh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: content-in .2s ease both; }
html.js-on .pp-modal-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
html.js-on .pp-modal-x { display: inline-flex; align-items: center; justify-content: center; position: absolute; top: 12px; inset-inline-end: 12px; z-index: 4; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; transition: var(--transition); }
html.js-on .pp-modal-x:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
html.js-on .pp-modal .tvpa-grid { margin-top: 0; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
html.js-on .pp-modal .tvpa-grid > .card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; }
html.js-on .pp-modal .pp-m-head { padding-inline-end: 44px; }
html.js-on .pp-modal .pp-cancel-inline { display: none; }
html.js-on .pp-modal .tvpa-live { top: 0; }
/* v28.78 — دسکتاپ: کارت پیش‌نمایش زیر دکمهٔ × شروع می‌شود (قبلاً × روی گوشهٔ کارت می‌افتاد)، در اسکرول هم زیر آن می‌چسبد */
@media (min-width: 961px) { html.js-on .pp-modal .tvpa-live { margin-top: 38px; top: 56px; } }
html:not(.js-on) .pp-m-err { display: none; }
html.pp-lock, html.pp-lock body { overflow: hidden; }
@media (max-width: 960px) { html.js-on .pp-modal .tvpa-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
    html.js-on .pp-modal { align-items: flex-end; padding: 0; }
    html.js-on .pp-modal-box { max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0; }
    html.js-on .pp-modal-scroll { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
    html.js-on .pp-modal-x { top: 10px; inset-inline-end: 10px; }
}
#ppResetWrap[hidden] { display: none !important; }

/* v28.78 — نگهداری: فهرست کپی‌های ناموفق آپدیت + بررسی سلامت فایل‌ها (فقط متغیرهای پالت) */
.mnt-fail-box { margin: 2px 0; }
.mnt-fail-title { font-weight: 800; margin-bottom: 8px; }
.mnt-fail-list, .fh-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.mnt-fail-list li, .fh-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.mnt-fail-list code, .fh-list code { font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.mnt-fail-perm, .fh-perm { margin-inline-start: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: lining-nums; font-size: 11.5px; font-weight: 700; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.mnt-fail-hint { font-weight: 700; }
.fh-result { margin-top: 12px; }
.fh-group { margin-top: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.fh-gt { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.fh-tag { font-size: 11px; font-weight: 700; color: var(--danger, var(--text)); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 7px; }

/* =====================================================================
   v28.89 — نوار «ورود مدیر به پنل کاربر» (ثابت بالای صفحه)
   ===================================================================== */
.tv-imp-bar {
    position: sticky; top: 0; z-index: 80; height: 44px; box-sizing: border-box;
    display: flex; align-items: center; gap: 10px; padding: 0 14px;
    background: linear-gradient(90deg, #b45309, #d97706); color: #fff;
    font-size: 12.5px; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .6);
}
.tv-imp-ic { flex-shrink: 0; font-size: 16px; }
.tv-imp-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-imp-txt b { font-weight: 800; }
.tv-imp-sub { opacity: .88; }
.tv-imp-form { margin: 0; flex-shrink: 0; }
.tv-imp-btn {
    height: 30px; padding: 0 12px; border-radius: 9px; cursor: pointer; white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .16); color: #fff;
    font: inherit; font-size: 12px; font-weight: 800;
}
.tv-imp-btn:hover { background: rgba(255, 255, 255, .28); }
.tv-imp-on .customer-sidebar { top: 44px; }
.tv-imp-on .cs-mobile-topbar { top: 44px; }
@media (max-width: 640px) { .tv-imp-sub { display: none; } .tv-imp-bar { padding: 0 10px; gap: 8px; } }

/* v28.96 — برچسب «مهمان» (پیام بدون ورود) */
.tv-chip.tv-guest-chip { color: #92400e; background: #fef3c7; border-color: #fcd34d; font-weight: 800; }
[data-theme="dark"] .tv-chip.tv-guest-chip { color: #fcd34d; background: rgba(252,211,77,.12); border-color: rgba(252,211,77,.35); }
.tvc-guest-card { border: 1.5px solid #fcd34d !important; }
