/* فونت وزیرمتن «خودمیزبان» است (بدونِ وابستگی به CDN: سریع‌تر در ایران، قابلِ بستن با CSP، بدونِ ردگیریِ شخصِ ثالث) */
@font-face { font-family: 'Vazirmatn'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); }

/* =====================================================================
   IranMTA — پنل مدیریت ادمین‌ها
   هویت بصری: نارنجیِ برند (#D9670F، از لوگوی GTA-style سرور نمونه‌برداری‌شده)
   روی زمینه‌ی گرافیتیِ تیره، با لهجه‌های زاویه‌دار (برش مورب) — حس یک
   اتاق فرماندهیِ تیم مدیریت سرور.
   ===================================================================== */

:root {
    --bg: #07080b;
    --surface: #0e0f1470;
    --surface-solid: #101116;
    --surface-alt: #17181f;
    --border: #24262e;
    --border-glow: #4a3820;
    --text: #eef0f5;
    --text-muted: #8b8d98;

    --primary: #D9670F;
    --primary-strong: #FF8A33;
    --primary-dim: #A34E0C;
    --primary-soft: rgba(217, 103, 15, .14);

    --secondary: #5b7fff;
    --secondary-soft: rgba(91, 127, 255, .16);

    --positive: #2fd97b;
    --positive-soft: rgba(47, 217, 123, .12);
    --negative: #ff3f5e;
    --negative-soft: rgba(255, 63, 94, .13);
    --warning: #ffb23f;
    --warning-soft: rgba(255, 178, 63, .13);

    --radius: 12px;
    --radius-sm: 8px;
    --cut: 10px; /* اندازه‌ی برش مورب گوشه — لهجه‌ی زاویه‌دارِ برند */
    --sidebar-w: 252px;
    --glow-primary: 0 0 18px rgba(217, 103, 15, .35);
    --glow-primary-lg: 0 0 32px rgba(217, 103, 15, .5);
    --transition: all .16s cubic-bezier(.4,0,.2,1);

    color-scheme: dark;
    --bg-image:
        radial-gradient(circle at 10% 6%, rgba(217,103,15,.10) 0%, transparent 38%),
        radial-gradient(circle at 90% 12%, rgba(91,127,255,.09) 0%, transparent 42%),
        radial-gradient(circle at 50% 100%, rgba(217,103,15,.05) 0%, transparent 50%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
    --login-image:
        radial-gradient(circle at 15% 20%, rgba(217,103,15,.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(91,127,255,.14) 0%, transparent 45%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
    --topbar-bg: rgba(7,8,11,.78);
    --panel-end: #0b0c10;
    --stat-end: #101116;
    --login-end: #08090c;
    --shadow-panel: 0 4px 18px rgba(0,0,0,.35);
    --shadow-panel-hover: 0 4px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(217,103,15,.08);
    --shadow-side: 4px 0 24px rgba(0,0,0,.35);
    --shadow-login: 0 10px 50px rgba(0,0,0,.5);
    --input-bg: #0a0b0f;
    --nav-active-text: #fff;
    --nav-active-border: rgba(217,103,15,.25);
    --strong: #fff;
    --btn-hover-text: #fff;
    --btn-primary-shadow: 0 4px 16px rgba(217,103,15,.35);
    --zebra: rgba(255,255,255,.02);
    --switch-off: #3b3e4c;
    --badge-rank-text: #ff8890;
    --badge-admin-text: #a9bcff;
    --logo-glow: drop-shadow(0 0 10px rgba(217,103,15,.45));
    --logo-glow-lg: drop-shadow(0 0 16px rgba(217,103,15,.5));
    --leave: #a78bfa;
}

/* =====================================================================
   حالتِ روشن — با دکمه‌ی ☀️/🌙 بالای صفحه عوض می‌شود (در مرورگر ذخیره می‌شود)
   ===================================================================== */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef0f5;
    --surface: rgba(255,255,255,.82);
    --surface-solid: #ffffff;
    --surface-alt: #f2f3f8;
    --border: #dcdfe8;
    --border-glow: #efc7a3;
    --text: #15161b;
    --text-muted: #5f6475;

    --primary: #D9670F;
    --primary-strong: #B04E08;
    --primary-dim: #E2A26A;
    --primary-soft: rgba(217,103,15,.12);
    --secondary: #3d5af1;
    --secondary-soft: rgba(61,90,241,.11);
    --positive: #0f8a47;
    --positive-soft: rgba(15,138,71,.11);
    --negative: #d01f3e;
    --negative-soft: rgba(208,31,62,.09);
    --warning: #a85f00;
    --warning-soft: rgba(168,95,0,.12);

    --glow-primary: 0 0 0 3px rgba(217,103,15,.14);
    --glow-primary-lg: 0 6px 20px rgba(217,103,15,.28);

    --bg-image:
        radial-gradient(circle at 8% 4%, rgba(217,103,15,.10) 0%, transparent 36%),
        radial-gradient(circle at 92% 10%, rgba(61,90,241,.07) 0%, transparent 40%);
    --login-image:
        radial-gradient(circle at 15% 20%, rgba(217,103,15,.16) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(61,90,241,.10) 0%, transparent 45%);
    --topbar-bg: rgba(255,255,255,.82);
    --panel-end: #fafbfd;
    --stat-end: #ffffff;
    --login-end: #f6f7fb;
    --shadow-panel: 0 1px 2px rgba(20,22,40,.06), 0 4px 16px rgba(20,22,40,.06);
    --shadow-panel-hover: 0 2px 4px rgba(20,22,40,.08), 0 8px 24px rgba(20,22,40,.10);
    --shadow-side: 2px 0 16px rgba(20,22,40,.07);
    --shadow-login: 0 10px 40px rgba(20,22,40,.14);
    --input-bg: #ffffff;
    --nav-active-text: #8f3f05;
    --nav-active-border: rgba(217,103,15,.35);
    --strong: #15161b;
    --btn-hover-text: #8f3f05;
    --btn-primary-shadow: 0 4px 14px rgba(217,103,15,.28);
    --zebra: rgba(20,22,40,.03);
    --switch-off: #c4c8d4;
    --badge-rank-text: #b3262f;
    --badge-admin-text: #3a52c9;
    --logo-glow: drop-shadow(0 0 1px rgba(0,0,0,.35));
    --logo-glow-lg: drop-shadow(0 2px 6px rgba(0,0,0,.25));
    --leave: #6d4fe0;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    background-image: var(--bg-image);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* حرکت فقط برای کسی که آن را نمی‌خواهد، خاموش می‌شود */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(217,103,15,.25); }
    50%      { box-shadow: 0 0 22px rgba(217,103,15,.55); }
}
@keyframes spinOnce {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes countUp {
    from { opacity: .2; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* حالت اولیه برای پنل‌ها — فقط وقتی جاوااسکریپت واقعاً فعال است (کلاس js-ready
   همان اول <head>، قبل از رندر شدن body، به صورت همزمان حذف/اضافه می‌شود؛
   بنابراین هیچ‌وقت یک لحظه «کامل نمایان → ناگهان مخفی → دوباره نمایان» دیده
   نمی‌شود — یا از همان اول مخفی است، یا اصلاً این افکت اعمال نمی‌شود) */
html.js-ready .panel { opacity: 0; transform: translateY(14px); }
html.js-ready .panel.is-visible { animation: fadeInUp .5s cubic-bezier(.16,1,.3,1) both; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- سایدبار ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface-solid);
    border-left: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    z-index: 20;
    box-shadow: var(--shadow-side);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 6px 8px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand img {
    width: 34px; height: 34px; flex-shrink: 0;
    filter: var(--logo-glow);
}
.sidebar-brand .brand-text {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: .2px;
    color: var(--text);
    line-height: 1.25;
}
.sidebar-brand .brand-text small {
    display: block;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .3px;
}

.nav-scroll { overflow-y: auto; display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
    border-inline-start: 2px solid transparent;
}

.nav-link:hover {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--border);
    border-inline-start-color: var(--primary-dim);
}
.nav-link.active {
    background: var(--primary-soft);
    color: var(--nav-active-text);
    border-color: var(--nav-active-border);
    border-inline-start-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.nav-sep { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 10px 4px; flex-shrink: 0; }
.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 14px 12px 4px;
    margin: 0;
    opacity: .75;
}
.nav-section-label:first-child { padding-top: 2px; }

.sidebar-footer { margin-top: auto; padding-top: 10px; flex-shrink: 0; }

/* دکمه‌ی همبرگری فقط روی موبایل/تبلت دیده می‌شود */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-backdrop { display: none; }

/* ---------- محتوای اصلی ---------- */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
}

.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.topbar h1 {
    font-size: 19px; font-weight: 800; margin: 0; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.topbar-user strong { color: var(--strong); font-weight: 700; }
.topbar-user .topbar-user-label { display: inline; }

.content {
    padding: 24px 28px 60px;
    max-width: 1180px;
    width: 100%;
}

/* ---------- کارت/پنل ---------- */
.panel {
    background: linear-gradient(180deg, var(--surface-solid), var(--panel-end));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-panel);
    transition: border-color .2s ease, box-shadow .2s ease;
    position: relative;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.panel:hover { border-color: var(--border-glow); box-shadow: var(--shadow-panel-hover); }

.panel h2 {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--text);
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel h2::before {
    content: '';
    display: inline-block;
    width: 4px; height: 16px;
    background: var(--primary);
    box-shadow: var(--glow-primary);
    flex-shrink: 0;
}

.panel h2 small { color: var(--text-muted); font-weight: 500; font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- آمار / HUD ---------- */
.stat {
    background: linear-gradient(155deg, var(--surface-alt), var(--stat-end));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(217,103,15,.55), transparent);
    height: 2px; top: 0;
    opacity: 0; transition: opacity .2s ease;
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-glow); box-shadow: var(--glow-primary); }
.stat:hover::after { opacity: 1; }
.stat .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; letter-spacing: .3px; }
.stat .stat-value { font-size: 27px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.stat .stat-value.counting { animation: countUp .5s ease both; }

/* ---------- بج امتیاز ---------- */
.points { font-weight: 800; font-variant-numeric: tabular-nums; }
.points.positive { color: var(--positive); }
.points.negative { color: var(--negative); }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    transition: var(--transition);
    background: var(--primary-soft);
    color: var(--badge-rank-text);
    border: 1px solid rgba(217,103,15,.3);
    letter-spacing: .2px;
}
.badge-owner { background: var(--warning-soft); color: var(--warning); border-color: rgba(255,178,63,.35); }
.badge-admin_manager { background: var(--positive-soft); color: var(--positive); border-color: rgba(47,217,123,.3); }
.badge-admin { background: var(--secondary-soft); color: var(--badge-admin-text); border-color: rgba(91,127,255,.35); }
.badge-status-pending { background: var(--warning-soft); color: var(--warning); border-color: rgba(255,178,63,.35); }
.badge-status-completed { background: var(--positive-soft); color: var(--positive); border-color: rgba(47,217,123,.3); }
.badge-status-missed { background: var(--negative-soft); color: var(--negative); border-color: rgba(255,63,94,.35); }
.badge-status-swapped { background: var(--secondary-soft); color: var(--badge-admin-text); border-color: rgba(91,127,255,.35); }

/* ---------- جدول (برای دیتای واقعاً جدولی — نه فرم) ---------- */
table { width: 100%; min-width: max-content; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
td.wrap-ok { white-space: normal; } /* برای ستون‌هایی مثل توضیح/دلیل که طولانی‌اند و باید بشکنند */
th { color: var(--text-muted); font-weight: 700; font-size: 11.5px; letter-spacing: .3px; }
tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-alt); }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty-row { color: var(--text-muted); text-align: center; padding: 24px 0; }

/* برای جدول‌هایی که یک ستونشان محتوای تو در توی پیچیده دارد (فرم، پنل جزئیات)
   نه دیتای ساده‌ی ردیفی — مثل لیست رتبه‌ها و لیست ادمین‌ها. برای این‌ها،
   قانونِ nowrap/min-width بالا (که مخصوص جدول‌های دیتاست) معکوس می‌شود؛
   وگرنه محتوای تو در تو کل جدول را به‌اندازه‌ی عرض طبیعیِ خودش عریض نگه
   می‌دارد، حتی اگر خودش به‌درستی داخل خودش بشکند. */
table.table-relaxed { min-width: 0; width: 100%; }
table.table-relaxed td, table.table-relaxed th { white-space: normal; }

/* ---------- لیستِ ردیفی با جزئیاتِ بازشونده (dlist) — ادمین‌ها، رتبه‌ها ----------
   اصول: ۱) هر آیتم «یک خط» است؛ ستون‌ها دقیقا زیرِ عنوان‌شان می‌نشینند چون هیچ ستونی
   با max-content/auto سایز نمی‌گیرد (فقط minmax(0,fr) یا عرضِ ثابت — پس ردیف‌ها با هم‌دیگر و با
   سرستون یک‌اندازه‌اند). ۲) دکمه‌های عملیات در یک ستونِ ثابتِ انتهایی‌اند، نه داخلِ سلول‌ها.
   ۳) جزئیات (ویرایش) با کلیک روی خودِ ردیف باز می‌شود و به‌صورت «بخش‌های برچسب‌دار» چیده می‌شود،
   نه جعبه‌ی تو در تو. ۴) روی موبایل هر ردیف یک کارتِ فشرده (نام+وضعیت / چیپ‌های اطلاعات / عملیات) است. */
.dlist { display: flex; flex-direction: column; margin: 0 -22px -20px; }
.dlist-head, .dlist-row {
    display: grid;
    grid-template-columns: var(--cols);
    align-items: center;
    column-gap: 14px;
    padding: 0 22px;
}
.dlist-head {
    min-height: 40px;
    background: var(--surface-alt);
    border-block: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
}
.dlist-head > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlist-item { border-bottom: 1px solid var(--border); }
.dlist-item:last-child { border-bottom: 0; }
.dlist-row { min-height: 60px; list-style: none; transition: background .14s ease; }
.dlist-row::-webkit-details-marker { display: none; }
details.dlist-item > .dlist-row { cursor: pointer; }
details.dlist-item > .dlist-row:hover { background: var(--surface-alt); }
details.dlist-item[open] > .dlist-row { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.dlist-meta { display: contents; }
.dlist .c { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.dlist .c-name { display: flex; align-items: center; gap: 10px; }
.dlist .avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; font-size: 14px; border: 1px solid var(--border-glow, var(--border)); text-transform: uppercase; }
.dlist .nm { min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.dlist .nm a { color: inherit; }
.dlist .nm a:hover { color: var(--primary-strong); }
.dlist .un { color: var(--text-muted); font-size: 11.5px; direction: ltr; unicode-bidi: isolate; flex-shrink: 0; }
.dlist .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.dlist .pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dlist .pill.on { color: var(--positive); background: var(--positive-soft); }
.dlist .pill.off { color: var(--negative); background: var(--negative-soft); }
.dlist-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.dlist-actions .btn { padding: 6px 11px; font-size: 12px; white-space: nowrap; }
.dlist-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--primary-dim); border-radius: var(--radius-sm); color: var(--primary-strong); font-size: 12px; font-weight: 700; white-space: nowrap; background: transparent; transition: var(--transition); }
.dlist-toggle::after { content: '▾'; font-size: 10px; transition: transform .18s ease; }
details.dlist-item > .dlist-row:hover .dlist-toggle { background: var(--primary-soft); }
details.dlist-item[open] .dlist-toggle { background: var(--primary); border-color: var(--primary); color: #fff; }
details.dlist-item[open] .dlist-toggle::after { transform: rotate(180deg); }

/* بخشِ بازشده: بخش‌های برچسب‌دار کنارِ هم (نه جعبه‌ی داخلِ جعبه) */
.dlist-more { padding: 20px 22px 24px; background: var(--surface-alt); border-top: 1px solid var(--border); }
.dlist-info { margin: 0 0 16px; font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 18px; }
.dlist-info b { color: var(--text); font-weight: 700; }
.dlist-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px 0; }
.dlist-section { padding: 0 22px; min-width: 0; }
.dlist-section + .dlist-section { border-inline-start: 1px solid var(--border); }
.dlist-section:first-child { padding-inline-start: 0; }
.dlist-section:last-child { padding-inline-end: 0; }
.dlist-section.wide { grid-column: span 2; }
.dlist-section h4 { margin: 0 0 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.dlist-section h4 small { color: var(--text-muted); font-weight: 400; font-size: 11.5px; }
.dlist-section.danger h4 { color: var(--negative); }
.dlist-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.dlist-fields .full { grid-column: 1 / -1; }
.dlist-more .field { margin-bottom: 12px; }
.dlist-more .field label { font-size: 12px; }
.dlist-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlist-more .checkbox-row { min-height: 42px; }

@media (max-width: 1180px) {
    .dlist .hide-md { display: none; }
    .dlist-head .hide-md { display: none; }
}
@media (max-width: 899px) {
    .dlist { margin: 0 -14px -14px; }
    .dlist-head { display: none; }
    .dlist-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "name status" "meta meta" "actions actions";
        row-gap: 10px; padding: 14px;
    }
    .dlist .c-name { grid-area: name; }
    .dlist .c-status { grid-area: status; }
    .dlist-meta { display: flex; flex-wrap: wrap; gap: 6px; grid-area: meta; }
    .dlist-meta > .c { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 12px; }
    .dlist-meta > .c[data-label]::before { content: attr(data-label) ':'; color: var(--text-muted); font-size: 11px; }
    .dlist .hide-md { display: inline-flex; }
    .dlist-actions { grid-area: actions; flex-wrap: wrap; justify-content: stretch; }
    .dlist-actions .btn, .dlist-toggle { flex: 1 1 auto; justify-content: center; min-height: 40px; }
    .dlist-more { padding: 16px 14px 20px; }
    .dlist-sections { grid-template-columns: 1fr; gap: 0; }
    .dlist-section, .dlist-section:first-child, .dlist-section:last-child { padding: 16px 0; }
    .dlist-section + .dlist-section { border-inline-start: 0; border-top: 1px solid var(--border); }
    .dlist-section.wide { grid-column: auto; }
    .dlist-fields { grid-template-columns: 1fr; }
}

/* هر پنلی که (به‌اشتباه یا از روی عادت) داخلِ پنلِ دیگر بیفتد، به «بخش» تبدیل می‌شود نه جعبه‌ی تو در تو */
.panel .panel { background: none; border: 0; box-shadow: none; clip-path: none; padding: 0; margin: 0 0 18px; }
.panel .panel:hover { box-shadow: none; }

/* ---------- لیست دسترسی‌ها (چک‌لیستِ فرم‌گونه — نه جدولِ دیتا، پس با خودِ table اشتباه گرفته نمی‌شود) ----------
   قبلاً این چک‌لیست هم از تگ table استفاده می‌کرد و بی‌خودی قانونِ nowrap/اسکرول‌افقیِ
   بالا (که مخصوص جدول‌های دیتاست) رویش اعمال می‌شد — همین باعث می‌شد توضیح هر
   دسترسی به‌جای شکستنِ طبیعی، کل چک‌لیست را افقی و غیرقابل‌استفاده کند. */
.perm-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; white-space: normal; }
.perm-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: normal;
}
.perm-item:hover { background: var(--surface-alt); }
.perm-item input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.perm-item .perm-text { min-width: 0; font-size: 13px; white-space: normal; word-break: break-word; }
.perm-item .perm-text .perm-desc { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: normal; }

.perm-override-grid { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; white-space: normal; }
.perm-override-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    white-space: normal;
}
.perm-override-row:hover { background: var(--surface-alt); }
.perm-override-row .perm-override-label { min-width: 0; word-break: break-word; white-space: normal; }
.perm-override-row .perm-override-opt { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); flex-direction: column; }

/* هر جایی که یک بخشِ فرم‌گونه (نه دیتای جدولی) داخل یک <td> تو در تو قرار می‌گیرد،
   باید صریحاً از حالت nowrapِ جدول بیرون بیاید — این شامل خودِ فرم‌ها و پنل‌های
   تو در تو هم می‌شود، نه فقط چک‌لیست بالا */
td .field, td .form-row, td form, td .perm-list, td .perm-override-grid { white-space: normal; }

/* ---------- فرم‌ها ---------- */
label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.field { margin-bottom: 14px; min-width: 0; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=file], select, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    max-width: 100%;
}
/* اعداد/تاریخ/ساعت همیشه چپ‌به‌راست نمایش داده شوند تا در صفحه‌ی راست‌به‌چپ درست دیده شوند */
input[type=number], input[type=date], input[type=time] {
    direction: ltr;
    text-align: right;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}
/* فوکوس با کیبورد باید همیشه قابل دیدن باشد */
a:focus-visible, button:focus-visible, .btn:focus-visible, .nav-link:focus-visible {
    outline: 2px solid var(--primary-strong);
    outline-offset: 2px;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; accent-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.form-row .field { flex: 1; min-width: 160px; }

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: .2px;
    -webkit-tap-highlight-color: transparent;
}
.settings-tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn:hover { border-color: var(--primary); color: var(--btn-hover-text); box-shadow: var(--glow-primary); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--btn-primary-shadow);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 100%, 8px 100%);
    padding-inline: 20px;
}
.btn-primary:hover { color: #fff; filter: brightness(1.12); box-shadow: var(--glow-primary-lg); }
.btn-danger { border-color: var(--negative); color: var(--negative); background: var(--negative-soft); }
.btn-danger:hover { background: var(--negative); color: #fff; box-shadow: 0 0 18px rgba(255,63,94,.4); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-sm.btn-primary { clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 100%, 6px 100%); }

/* بازخوردِ کوتاهِ کلیک، با JS اضافه می‌شود (assets/app.js) */
.btn.is-pressed { transform: scale(.95); }

/* ---------- پیام‌ها ---------- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    animation: slideDown .3s ease both;
    border: 1px solid;
}
.flash-success { background: var(--positive-soft); color: var(--positive); border-color: rgba(47,217,123,.35); }
.flash-error { background: var(--negative-soft); color: var(--negative); border-color: rgba(255,63,94,.35); }

.muted { color: var(--text-muted); }
.text-left-num { direction: ltr; unicode-bidi: plaintext; text-align: start; display: inline-block; }   /* عدد/تاریخ ⇒ چپ‌به‌راست؛ اگر کلمه‌ی فارسی دارد (مثلا «ثبت نشده»، «۱۸:۰۰ تا ۱۹:۰۰») خودکار راست‌به‌چپ می‌شود */

/* ---------- گرید برنامه‌ی هفتگی ---------- */
.schedule-grid-wrap { max-height: 560px; overflow-y: auto; }
.schedule-grid { font-size: 12.5px; }
.schedule-grid th, .schedule-grid td { padding: 5px 6px; text-align: center; }
.schedule-grid thead th {
    position: sticky; top: 0; background: var(--surface-solid); z-index: 1;
    border-bottom: 2px solid var(--border);
}
.schedule-grid .hour-label { text-align: left; color: var(--text-muted); font-weight: 600; }
.schedule-grid input[type=checkbox] { width: 15px; height: 15px; }
.schedule-grid tbody tr:nth-child(even) { background: var(--zebra); }

/* ---------- لاگین ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
    background-image: var(--login-image);
}
.login-box {
    width: 100%;
    max-width: 370px;
    background: linear-gradient(180deg, var(--surface-solid), var(--login-end));
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 36px 30px;
    box-shadow: var(--shadow-login), var(--glow-primary);
    animation: popIn .4s ease both;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login-logo img { width: 64px; height: 64px; filter: var(--logo-glow-lg); }
.login-box h1 {
    font-size: 19px;
    text-align: center;
    margin: 0 0 4px;
    letter-spacing: .3px;
    color: var(--strong);
}
.login-box p.sub { text-align: center; color: var(--text-muted); font-size: 13px; margin: 0 0 22px; }

/* =====================================================================
   ریسپانسیو — موبایل، تبلت، لپ‌تاپ/ویندوز باریک، دسکتاپ بزرگ
   ===================================================================== */

/* لپ‌تاپ‌های ویندوزِ معمولی (۱۲۸۰ تا ۱۴۴۰) هم جا بیفتند، نه فقط دسکتاپ خیلی بزرگ */
@media (max-width: 1300px) {
    .content { max-width: 100%; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* تبلت و لپ‌تاپ باریک: سایدبار جمع می‌شود و با دکمه باز/بسته می‌شود */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        inset-inline-start: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(105%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
        width: min(280px, 82vw);
        overflow-y: auto;
    }
    [dir="rtl"] .sidebar, .sidebar { transform: translateX(105%); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
    .sidebar-backdrop {
        display: none;
        position: fixed; inset: 0; z-index: 90;
        background: rgba(0,0,0,.55);
        backdrop-filter: blur(2px);
    }
    .sidebar-backdrop.is-open { display: block; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .topbar h1 { font-size: 16px; }
    .topbar-user-label { display: none; } /* «سلام، X» جمع می‌شود، فقط اسم می‌ماند */
    .form-row { flex-direction: column; align-items: stretch !important; }
    .form-row .field { width: 100%; min-width: 0; }
    .panel { padding: 16px; }
    .perm-override-row { grid-template-columns: 1fr; gap: 4px; text-align: center; }
    .perm-override-row .perm-override-label { text-align: right; margin-bottom: 4px; }
    .perm-override-row { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 4px; }
}

@media (max-width: 480px) {
    .stat .stat-value { font-size: 22px; }
    .login-box { padding: 26px 20px; }
    table, th, td { font-size: 12.5px; }
    .btn { padding: 8px 14px; }
}

/* =====================================================================
   پاپ‌آپ دسترسی‌ها (perm-modal.js)
   ===================================================================== */
body.perm-modal-open { overflow: hidden; }
.perm-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.perm-btn .perm-count { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); }
.perm-btn.is-custom .perm-count { background: var(--warning-soft); color: var(--warning); }

.pm-overlay {
    position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(4, 5, 8, .72); backdrop-filter: blur(3px);
    opacity: 0; transition: opacity .15s ease;
}
.pm-overlay.open { opacity: 1; }
.pm-dialog {
    width: min(820px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
    background: var(--surface-solid); border: 1px solid var(--border-glow, var(--border)); border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55); overflow: hidden; transform: translateY(8px) scale(.985); transition: transform .15s ease;
}
.pm-overlay.open .pm-dialog { transform: none; }
.pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.pm-head h3 { margin: 0 0 4px; font-size: 17px; }
.pm-head p { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.7; }
.pm-x { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); cursor: pointer; font-size: 15px; }
.pm-x:hover { border-color: var(--primary); color: var(--primary-strong); }

.pm-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.pm-search { flex: 1 1 240px; min-width: 0; margin: 0 !important; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-chip { padding: 6px 12px; font-size: 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text-muted); cursor: pointer; font-family: inherit; }
.pm-chip:hover { color: var(--text); border-color: var(--text-muted); }
.pm-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pm-copy { flex: 0 1 250px; }
.pm-copy-sel { width: 100%; margin: 0 !important; font-size: 12.5px; padding: 6px 8px !important; }

.pm-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 20px 14px; min-height: 160px; }
.pm-group { margin-top: 14px; }
.pm-group-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 4px; background: var(--surface-solid); border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pm-gcount { font-size: 11.5px; color: var(--text-muted); }
.pm-gbtns { margin-inline-start: auto; display: flex; gap: 6px; }
.pm-gbtn { font-size: 11.5px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-family: inherit; }
.pm-gbtn:hover { color: var(--primary-strong); border-color: var(--primary); }

.pm-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; transition: background .12s ease; }
.pm-row:hover { background: var(--surface-alt); }
.pm-row.is-changed { border-color: var(--warning); background: var(--warning-soft); }
.pm-text { flex: 1 1 auto; min-width: 0; }
.pm-title { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-desc { max-width: 560px; }
.pm-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.7; }
.pm-code { margin-inline-start: auto; font-size: 10.5px; font-weight: 400; color: var(--text-muted); opacity: .7; direction: ltr; }
.pm-risk { font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--negative-soft); color: var(--negative); }

.pm-switch { position: relative; flex-shrink: 0; width: 46px; height: 26px; margin: 0; cursor: pointer; }
.pm-switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.pm-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background .15s ease; }
.pm-slider::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pm-switch input:checked + .pm-slider { background: var(--positive); }
.pm-switch input:checked + .pm-slider::after { transform: translateX(-20px); }
.pm-switch input:focus-visible + .pm-slider { outline: 2px solid var(--primary); outline-offset: 2px; }

.pm-seg { display: flex; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pm-seg-btn { padding: 7px 11px; font-size: 12px; border: 0; border-inline-start: 1px solid var(--border); background: var(--surface-solid); color: var(--text-muted); cursor: pointer; font-family: inherit; white-space: nowrap; }
.pm-seg-btn:first-child { border-inline-start: 0; }
.pm-seg-btn.active.seg-inherit { background: var(--surface-alt); color: var(--text); font-weight: 700; }
.pm-seg-btn.active.seg-on { background: var(--positive); color: #06210f; font-weight: 800; }
.pm-seg-btn.active.seg-off { background: var(--negative); color: #fff; font-weight: 800; }
.pm-result { flex-shrink: 0; min-width: 62px; text-align: center; font-size: 12px; font-weight: 700; }
.pm-row.is-on .pm-result { color: var(--positive); }
.pm-row:not(.is-on) .pm-result { color: var(--negative); }
.pm-empty { padding: 40px 10px; text-align: center; color: var(--text-muted); }

.pm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-alt); }
.pm-summary { font-size: 12.5px; color: var(--text-muted); }
.pm-summary strong { color: var(--text); }
.pm-add { color: var(--positive); font-weight: 700; }
.pm-rem { color: var(--negative); font-weight: 700; }
.pm-dirty { color: var(--warning); font-weight: 700; }
.pm-actions { display: flex; gap: 8px; }
.pm-save:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 720px) {
    .pm-overlay { padding: 0; align-items: flex-end; }
    .pm-dialog { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
    .pm-row { flex-wrap: wrap; }
    .pm-seg { width: 100%; }
    .pm-seg-btn { flex: 1; padding: 9px 4px; font-size: 11.5px; }
    .pm-result { margin-inline-start: auto; }
    .pm-actions { width: 100%; }
    .pm-actions .btn { flex: 1; }
}

/* ساعتِ تهران در topbar */
.topbar-clock { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); font-size: 12.5px; font-variant-numeric: tabular-nums; direction: ltr; }
.topbar-clock .tc-time { font-weight: 800; color: var(--text); }
.topbar-clock .tc-date { color: var(--text-muted); }
.topbar-clock .tc-zone { font-size: 11px; color: var(--primary-strong); font-weight: 700; direction: rtl; }
@media (max-width: 720px) { .topbar-clock .tc-date { display: none; } .topbar-clock { padding: 4px 8px; } }

/* ورودیِ تاریخ/ساعتِ میلادی (gdate) */
.gdate { position: relative; display: block; direction: ltr; }
.gdate .gdate-input { width: 100%; padding-right: 42px; padding-left: 12px; direction: ltr; text-align: left; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gdate .gdate-btn { position: absolute; top: 0; bottom: 0; right: 0; width: 40px; min-height: 0; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.gdate .gdate-btn:hover { color: var(--primary-strong); }
.gdate-pop { position: absolute; z-index: 1100; width: 296px; padding: 12px; background: var(--surface-solid); border: 1px solid var(--border-glow, var(--border)); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5); direction: rtl; }
.gdate-pop .gp-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.gdate-pop .gp-nav { width: 32px; height: 32px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); color: var(--text); cursor: pointer; font-size: 14px; }
.gdate-pop .gp-nav:hover { border-color: var(--primary); color: var(--primary-strong); }
.gdate-pop select { margin: 0 !important; padding: 6px 8px !important; font-size: 12.5px; min-width: 0; }
.gdate-pop .gp-month { flex: 1.5; } .gdate-pop .gp-year { flex: 1; }
.gdate-pop .gp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; direction: rtl; }
.gdate-pop .gp-wd { text-align: center; font-size: 11px; color: var(--text-muted); padding: 4px 0; }
.gdate-pop .gp-wd.fri { color: var(--negative); }
.gdate-pop .gp-day { height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; font-family: inherit; }
.gdate-pop .gp-day:hover:not(:disabled) { background: var(--surface-alt); }
.gdate-pop .gp-day.fri { color: var(--negative); }
.gdate-pop .gp-day.today { outline: 1px solid var(--primary); }
.gdate-pop .gp-day.sel { background: var(--primary); color: #fff; font-weight: 800; }
.gdate-pop .gp-day:disabled { opacity: .28; cursor: not-allowed; }
.gdate-pop .gp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.gdate-pop .gp-link { border: 0; background: transparent; color: var(--primary-strong); cursor: pointer; font-size: 12.5px; font-family: inherit; }
.gdate-pop .gp-hint { margin-top: 6px; text-align: center; font-size: 11px; color: var(--text-muted); direction: ltr; }
.gtime-pop { width: 252px; }
.gtime-pop .gp-grid { grid-template-columns: repeat(6, 1fr); direction: ltr; }
.gtime-pop .gp-title { margin: 6px 0 4px; font-size: 11.5px; color: var(--text-muted); text-align: center; }


/* =====================================================================
   ریسپانسیوِ واقعی (موبایل/تبلت)
   ===================================================================== */
/* جدول‌های پهن (بیش از ۹ ستون: گزارش هفتگی و ...) به‌جای کارت، اسکرولِ افقی با «ستونِ اولِ چسبیده» */
table.sticky-first { border-collapse: separate; border-spacing: 0; }
table.sticky-first th:first-child, table.sticky-first td:first-child { position: sticky; right: 0; z-index: 2; background: var(--surface-solid); box-shadow: -6px 0 8px -6px rgba(0,0,0,.5); }

@media (max-width: 860px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .stat { padding: 14px 14px; }
    .stat .stat-value { font-size: 21px; }
    .panel h2 { flex-wrap: wrap; gap: 4px 10px; line-height: 1.7; }
    .panel h2 small { font-size: 12px; }
    .flash { word-break: break-word; }
}

@media (max-width: 720px) {
    /* --- نوارِ بالا: عنوان کوتاه نشود، ساعت فشرده، نامِ کاربر کوتاه --- */
    .topbar { gap: 8px; padding: 10px 12px; }
    .topbar-title { flex: 1 1 auto; min-width: 0; gap: 8px; }
    .topbar h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
    .topbar-clock { flex-shrink: 0; padding: 4px 8px; font-size: 12px; }
    .topbar-clock .tc-zone { display: none; }
    .topbar-user { flex-shrink: 0; max-width: 92px; }
    .topbar-user strong { display: block; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
    .content { padding: 12px; }
    .panel { padding: 14px; border-radius: 12px; }

    /* --- لمس‌پذیری: ارتفاعِ مناسب و جلوگیری از زومِ خودکارِ iOS --- */
    input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; min-height: 44px; }
    .btn { min-height: 42px; }
    .btn-sm { min-height: 36px; }
    .nav-link { min-height: 44px; }

    /* --- جدول‌ها: هر ردیف یک کارت (برچسبِ ستون بالای مقدار؛ برای متنِ ساده کنارِ مقدار) --- */
    .table-wrap.wrap-stacked { overflow-x: visible; }
    table.stack-table { min-width: 0 !important; display: block; font-size: 13.5px; }
    table.stack-table thead { display: none; }
    table.stack-table tbody { display: block; }
    table.stack-table tr { display: block; margin: 0 0 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); }
    table.stack-table tbody tr:hover { background: var(--surface-alt); }
    table.stack-table td { display: block; padding: 8px 0; border-bottom: 1px dashed var(--border); white-space: normal !important; text-align: right; word-break: break-word; }
    table.stack-table tr td:last-child { border-bottom: 0; }
    table.stack-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 11px; font-weight: 700; }
    table.stack-table td.td-inline { display: grid; grid-template-columns: minmax(84px, 38%) 1fr; gap: 10px; align-items: baseline; }
    table.stack-table td.td-inline::before { margin-bottom: 0; }
    table.stack-table td:empty { display: none; }
    table.stack-table td.empty-row, table.stack-table td[colspan] { display: block; text-align: center; border-bottom: 0; }
    table.stack-table td[colspan]::before { display: none; }
    table.stack-table td .btn, table.stack-table td form { margin-top: 2px; }
    table.stack-table td input[type=number], table.stack-table td input[type=text] { width: 100% !important; max-width: none !important; }

    /* فرم‌ها */
    .form-row { gap: 10px; }
    .gdate-pop { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px !important; width: auto; max-width: none; box-shadow: 0 -10px 40px rgba(0,0,0,.6); }
    .gtime-pop { width: auto; }
}

@media (max-width: 400px) {
    .grid-3 { grid-template-columns: 1fr 1fr !important; }
    .stat .stat-label { font-size: 11px; }
    .topbar-clock .tc-time { font-size: 12px; }
    .topbar-user { display: none; }   /* روی گوشی‌های خیلی باریک، فضا را به عنوانِ صفحه بده */
}

.topbar-clock.clock-warn { border-color: var(--warning); }
.topbar-clock .tc-warn { font-size: 13px; cursor: help; }

/* ---------- صفحه‌ی جزئیاتِ کاملِ گزارش تایم (کارتِ هر ادمین) ---------- */
.tr-card { margin-bottom: 14px; }
.tr-card-warn { border-color: var(--warning); }
.tr-card-off { padding-top: 10px; padding-bottom: 10px; opacity: .8; }
.tr-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.tr-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tr-col { min-width: 0; }
.tr-sub { font-size: 12px; font-weight: 800; color: var(--text-muted); margin-bottom: 8px; }
.tr-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.tr-line > span { color: var(--text-muted); font-size: 12px; }
.tr-line strong.ok { color: var(--positive); } .tr-line strong.bad { color: var(--negative); }
.tr-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--primary-soft); color: var(--primary-strong); }
.tr-chip-muted { background: var(--surface-alt); color: var(--text-muted); }
.tr-chip-warn { background: var(--warning-soft); color: var(--warning); display: block; padding: 6px 10px; border-radius: 10px; }
.tr-chip-ok { background: var(--positive-soft); color: var(--positive); }
.tl-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.tl-bar { display: flex; direction: ltr; height: 18px; border-radius: 9px; overflow: hidden; background: var(--border); }
.tl-seg { display: block; height: 100%; min-width: 2px; }
.tl-axis { display: flex; justify-content: space-between; direction: ltr; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11px; color: var(--text-muted); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.tl-checks { margin-top: 8px; font-size: 12px; }
.tl-checks summary { cursor: pointer; color: var(--primary-strong); }
.tl-check-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; direction: ltr; }
.tl-check { padding: 3px 9px; border-radius: 8px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 11.5px; }
@media (max-width: 720px) {
    .tr-card-body { grid-template-columns: 1fr; gap: 12px; }
    .tl-check-list { gap: 4px; }
}

.tr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .tr-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cell-stack .btn { white-space: nowrap; }


/* دکمه‌ی تغییرِ تم */
.theme-toggle { flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); color: var(--text); cursor: pointer; font-size: 17px; line-height: 1; transition: var(--transition); padding: 0; }
.theme-toggle:hover { border-color: var(--primary); box-shadow: var(--glow-primary); }
.theme-toggle-login { position: fixed; top: 14px; inset-inline-start: 14px; z-index: 30; }
:root[data-theme="light"] .pm-overlay { background: rgba(30, 34, 52, .45); }
:root[data-theme="light"] .badge { box-shadow: none; }
:root[data-theme="light"] .nav-link.active { box-shadow: none; }
:root[data-theme="light"] .sidebar-brand img { filter: var(--logo-glow); }

/* نشانِ «تاییدِ aduty» کنار اکسترا و جابجایی */
.duty-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; cursor: help; }
.duty-ok { background: var(--positive-soft); color: var(--positive); border-color: rgba(47,217,123,.28); }
.duty-low { background: var(--negative-soft); color: var(--negative); border-color: rgba(255,63,94,.3); }
.duty-live { background: var(--secondary-soft); color: var(--badge-admin-text); border-color: rgba(91,127,255,.3); }
.duty-upcoming { background: var(--warning-soft); color: var(--warning); border-color: rgba(255,178,63,.3); }
.duty-none { background: var(--surface-alt); color: var(--text-muted); border-color: var(--border); }

/* لیستِ کاملِ هر تایم */
.slot-block { padding-top: 14px; }
.slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.slot-head .slot-sum { flex: 1 1 260px; font-size: 12.5px; color: var(--text-muted); }
.slot-head .slot-sum b { color: var(--text); }
.delay-cell input[type=number]:disabled { opacity: .45; }

/* ستونِ رفرال/اعداد در جدول‌ها هم‌ترازِ بقیه‌ی سلول‌ها (وسطِ ردیف) و رفرالِ بلند بریده نشود */
/* باگِ قدیمی: .text-left-num سلولِ جدول را inline-block می‌کرد و ردیف‌ها را جابه‌جا می‌چید */
td.text-left-num, th.text-left-num { display: table-cell; vertical-align: middle; }
td.text-left-num { word-break: break-all; }


/* =====================================================================
   گزارش هفتگیِ جدید (rpt) — نمودارها/ماتریس/KPI؛ PDF همین طرح و رنگ‌ها را دوباره می‌کشد
   ===================================================================== */
.rpt-head .presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.presets-gap { flex: 1; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { position: relative; padding: 16px 18px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: linear-gradient(155deg, var(--surface-alt), var(--stat-end)); overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--tone, var(--primary)); }
.kpi .k-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.kpi .k-value { font-size: 27px; font-weight: 800; line-height: 1.35; color: var(--tone, var(--text)); font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.7; }
.kpi .k-ring { position: absolute; top: 12px; inset-inline-end: 14px; width: 54px; height: 54px; }
.kpi .ring-track { stroke: var(--border); }
.chip-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 12px; color: var(--text); }
.chip-pos { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.chip-neg { background: var(--negative-soft); color: var(--negative); border-color: transparent; }
.rpt-grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; }
.rpt-grid-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rpt-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .axis { fill: var(--text-muted); font-size: 10px; }
.chart .val { fill: var(--text); font-size: 11px; font-weight: 700; }
.chart .cat { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart .cat2 { fill: var(--text-muted); font-size: 10px; }
.chart .donut-track { stroke: var(--surface-alt); }
.chart .donut-center { fill: var(--text); font-size: 30px; font-weight: 800; }
.chart .donut-sub { fill: var(--text-muted); font-size: 11px; }
.donut-wrap { max-width: 250px; margin: 4px auto 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.legend.center { justify-content: center; }
.legend i:not(.dot) { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.legend b { color: var(--text); }
.hbar-row { display: grid; grid-template-columns: minmax(100px, 1.2fr) 3fr 54px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-i { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 6px; background: var(--primary-soft); color: var(--primary-strong); font-size: 11px; margin-inline-end: 4px; }
.hbar-track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-alt); overflow: hidden; }
.hbar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 6px; }
.hb-val { font-weight: 800; text-align: end; font-variant-numeric: tabular-nums; }
.attn .attn-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.attn .attn-row:last-child { border-bottom: 0; }
.attn h2 { font-size: 14px; }
/* ماتریسِ حضور */
table.mx { border-collapse: separate; border-spacing: 0; width: 100%; }
table.mx th, table.mx td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
table.mx th.mx-day small { display: block; font-weight: 400; color: var(--text-muted); font-size: 10.5px; }
table.mx td.mx-name { text-align: start; min-width: 190px; }
table.mx td.mx-name span { margin-inline-start: 8px; }
table.mx td.mx-cell { min-width: 84px; }
table.mx td.mx-cell.is-leave { background: rgba(167,139,250,.07); }
.mx .dots { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 92px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.s-present { background: var(--positive); }
.s-absent { background: var(--negative); }
.s-pending { background: var(--warning); }
.s-upcoming { background: transparent; border: 1.5px dashed var(--text-muted); }
.s-swapped { background: var(--secondary); }
.s-leave { background: var(--leave); }
.dot.swap-in { outline: 2px solid var(--secondary); outline-offset: 1px; }
.mx-meta { display: flex; gap: 6px; justify-content: center; font-size: 10.5px; margin-top: 3px; color: var(--text-muted); }
.mx-meta .m-delay { color: var(--warning); font-weight: 700; }
.mx-meta .m-rep { color: var(--secondary); font-weight: 700; }
.mx-meta .m-et { color: var(--primary-strong); font-weight: 700; }
.mx-total b { font-size: 14px; }
.mx-total small { display: block; color: var(--text-muted); font-size: 10.5px; }
.pbar { display: inline-block; width: 54px; height: 7px; border-radius: 4px; background: var(--surface-alt); vertical-align: middle; overflow: hidden; margin-inline-end: 4px; }
.pbar i { display: block; height: 100%; background: var(--positive); }
#perf-table th[data-dir=asc]::after { content: ' ▲'; font-size: 9px; }
#perf-table th[data-dir=desc]::after { content: ' ▼'; font-size: 9px; }
#perf-table tfoot tr.tf td { font-weight: 800; background: var(--surface-alt); border-top: 2px solid var(--border); }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rpt-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .rpt-grid-2, .rpt-grid-2.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .kpi-grid { gap: 10px; } .kpi .k-value { font-size: 22px; } .kpi .k-ring { width: 40px; height: 40px; } .rpt-grid-4 { grid-template-columns: minmax(0, 1fr); } .hbar-row { grid-template-columns: minmax(80px, 1fr) 2fr 48px; } }

/* پنل تستِ تایم (تنظیمات) */
.dt-timeline-wrap { margin: 14px 0 4px; }
.dt-timeline { position: relative; height: 30px; border-radius: 8px; background: var(--surface-alt); border: 1px solid var(--border); overflow: hidden; }
.dt-timeline > span { position: absolute; top: 0; bottom: 0; }
.dt-timeline .tl-on { background: var(--positive); }
.dt-timeline .tl-off { background: var(--warning); }
.dt-timeline .tl-offline { background: var(--negative); }
.dt-timeline .tl-now { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--surface-solid); border-radius: 2px; }
.dt-ticks { position: relative; height: 26px; font-size: 10.5px; color: var(--text-muted); }
.dt-ticks span { position: absolute; top: 2px; transform: translateX(50%); white-space: nowrap; text-align: center; }
.dt-ticks span i { display: block; width: 1px; height: 6px; background: var(--text-muted); margin: 0 auto 2px; }

/* ورود: کپچا */
.captcha-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.captcha-row img { border-radius: 10px; border: 1px solid var(--border); background: #f4f1ea; max-width: 100%; height: auto; }
.captcha-row .btn { flex: 0 0 auto; min-width: 40px; justify-content: center; }
.backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; padding: 14px 16px; border: 1px dashed var(--warning); border-radius: 10px; background: var(--warning-soft); direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: 1.5px; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--border); line-height: 0; }

/* جدولِ پوینتِ همه‌ی اکشن‌ها */
.pt-group { margin: 18px 0 8px; font-size: 14px; color: var(--text); padding-inline-start: 10px; border-inline-start: 3px solid var(--primary); }
.pt-prev { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pt-prev.pos { background: var(--positive-soft); color: var(--positive); }
.pt-prev.neg { background: var(--negative-soft); color: var(--negative); }
.pt-prev.zero { background: var(--surface-alt); color: var(--text-muted); }

/* وضعیت سرور */
.ss-pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 0 var(--positive); animation: ss-pulse 1.8s infinite; vertical-align: middle; margin-inline-end: 4px; }
@keyframes ss-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.ss-kpis { margin-bottom: 16px; }
.ss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.ss-card { background: var(--surface-alt); border: 1px solid var(--border); border-inline-start: 4px solid var(--border-strong, var(--border)); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.ss-card.ss-ok { border-inline-start-color: var(--positive); }
.ss-card.ss-warn { border-inline-start-color: var(--warning); }
.ss-card.ss-bad { border-inline-start-color: var(--negative); }
.ss-card.ss-wait { border-inline-start-color: var(--primary-strong); }
.ss-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.ss-name { font-weight: 800; font-size: 15px; }
.ss-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ss-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-alt); border: 1px solid var(--border); }
.ss-b-ok { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.ss-b-warn { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.ss-b-bad { background: var(--negative-soft); color: var(--negative); border-color: transparent; }
.ss-b-wait { background: rgba(251,146,60,.14); color: var(--primary-strong); border-color: transparent; }
.ss-tl { position: relative; height: 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.ss-tl > span { position: absolute; top: 0; bottom: 0; }
.ss-tl .tl-on { background: var(--positive); } .ss-tl .tl-off { background: var(--warning); } .ss-tl .tl-offline { background: var(--negative); }
.ss-tl .ss-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.ss-metrics { list-style: none; margin: 0; padding: 0; font-size: 12.8px; line-height: 2; }
.ss-metrics .neg { color: var(--negative); } .ss-metrics .pos { color: var(--positive); }
.ss-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.ss-feed { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; font-size: 13px; line-height: 2.1; }
.ss-feed li { border-bottom: 1px dashed var(--border); padding: 2px 0; }
.ss-feed .t { color: var(--text-muted); margin-inline-end: 6px; font-size: 12px; }
.ss-ev-absent { color: var(--negative); }
@media (max-width: 600px) { .ss-grid { grid-template-columns: 1fr; } }

@media (min-width: 1100px) { .ss-kpis { grid-template-columns: repeat(5, 1fr); } }

/* دسته‌های تلگرام */
.tg-cat { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: var(--surface-alt); }
.tg-cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tg-cat-head h3 { margin: 0; font-size: 15px; }

/* ===== گزارش تایم: لیستِ سه‌حالته + جزئیات + فرمِ کارتی ===== */
.tr-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 18px; font-size: 12.5px; color: var(--text-muted); margin: -4px 0 12px; line-height: 1.9; }
.tr-legend b { color: var(--text); }
.tr-scope { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tr-todo { margin: 0 0 12px; }
.tr-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tr-tab { text-align: right; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--text); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font: inherit; }
.tr-tab .t { font-weight: 800; font-size: 14px; }
.tr-tab .n { min-width: 26px; text-align: center; padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 800; font-size: 13px; }
.tr-tab small { grid-column: 1 / -1; color: var(--text-muted); font-size: 11.5px; }
.tr-tab.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--primary); }
.tr-tab.active .n { background: var(--primary); color: #fff; border-color: var(--primary); }
.tr-pane[hidden] { display: none; }
.tr-filter { padding-bottom: 6px; }
.dlist .pill.wait { color: var(--warning); background: var(--warning-soft); }
.dlist .neg { color: var(--negative); }
.tr-more { padding: 16px 18px 20px; }
.trd-bar { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 13px; margin-bottom: 14px; line-height: 2; }
.trd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.trd-card { background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.trd-card.trd-ok { border-inline-start-color: var(--positive); } .trd-card.trd-warn { border-inline-start-color: var(--warning); } .trd-card.trd-bad { border-inline-start-color: var(--negative); } .trd-card.trd-wait { border-inline-start-color: var(--primary-strong); }
.trd-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trd-line { font-size: 12.8px; line-height: 2; } .trd-line .neg, .trd-rec .neg { color: var(--negative); } .trd-line .pos { color: var(--positive); }
.trd-rec { font-size: 12.8px; line-height: 2; padding-top: 8px; border-top: 1px dashed var(--border); }
.trd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
/* فرمِ کارتیِ هر ادمین */
.trc-steps { margin: 0 0 14px; padding-inline-start: 22px; font-size: 13px; line-height: 2.1; color: var(--text-muted); } .trc-steps b { color: var(--text); }
.trc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.trc { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.trc-muted { opacity: .75; }
.trc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14.5px; }
.trc-sec { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.trc-sec:first-of-type { border-top: 0; padding-top: 0; }
.trc-lab { font-size: 11.5px; font-weight: 800; color: var(--text-muted); letter-spacing: .2px; }
.trc-tick { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-height: 46px; font-weight: 700; }
.trc-tick input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--primary); }
.trc-tick:has(input:checked) { border-color: var(--positive); background: var(--positive-soft); }
.trc-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.9; }
.trc-sysdelay { font-size: 13px; }
.trc-total { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 8px; }
.trc-submit { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: 10px; z-index: 5; }
@media (max-width: 700px) { .tr-tabs { grid-template-columns: 1fr; } .trc-grid, .trd-grid { grid-template-columns: 1fr; } }

/* رنگِ رتبه */
.rk-color { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.rk-color-in { width: 54px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.rk-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.badge.rank-colored { font-weight: 800; }
[data-theme="light"] .badge.rank-colored { color: color-mix(in srgb, var(--rk) 72%, #000) !important; }

/* گزارش هفتگی: خلاصه‌ی ساده + پرش به بخش + راهنما */
.rp-jump { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; padding: 8px 0; margin-bottom: 14px; background: var(--bg, transparent); backdrop-filter: blur(8px); }
.rp-jump a { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--text); }
.rp-jump a:hover { border-color: var(--primary); color: var(--primary-strong); }
.rp-summary ul { margin: 0 0 12px; padding-inline-start: 20px; line-height: 2.2; font-size: 14px; }
.rp-summary li b { color: var(--primary-strong); }
.rp-guide-body { margin-top: 12px; padding: 14px 16px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; line-height: 2.1; }
.rp-guide-body p { margin: 0 0 6px; }
[id^="rp-"] { scroll-margin-top: 64px; }
/* لیستِ گزارش تایم در موبایل: چیپ‌ها بشکنند، بیرون نزنند */
.tr-item .c-name, .tr-item .dlist-meta > .c { white-space: normal; flex-wrap: wrap; }
.tr-item .dlist-meta > .c { max-width: 100%; border-radius: 14px; row-gap: 4px; }
.tr-item .chip { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 899px) { .tr-item .dlist-meta > .c[data-label="ادمین‌ها"] { flex: 1 1 100%; } }

/* جدولِ هفته‌ی گزارش تایم */
.tr-tabs-4 { grid-template-columns: repeat(4, 1fr); }
a.tr-tab { text-decoration: none; }
.tg-top .tg-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tg-stats { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; }
.tg-stats .ok { color: var(--positive); } .tg-stats .wait { color: var(--warning); } .tg-stats .none, .tg-stats .bad { color: var(--negative); } .tg-stats .next { color: var(--text-muted); }
.tg-wrap { max-height: 70vh; overflow: auto; }
.tg-table { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 760px; }
.tg-table th, .tg-table td { text-align: center; padding: 0; background: transparent; border: 0; }
.tg-table thead th { font-size: 12.5px; padding: 8px 4px; position: sticky; top: 0; background: var(--surface); z-index: 3; }
.tg-table thead th small { display: block; color: var(--text-muted); font-weight: 400; font-size: 11px; }
.tg-table .tg-h { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 4; width: 64px; font-size: 12.5px; padding: 0 6px; }
.tg-table .tg-today { background: var(--primary-soft); border-radius: 8px; }
.tg-cell { width: 100%; min-height: 54px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; padding: 4px 2px; }
.tg-cell b { font-size: 16px; line-height: 1.1; } .tg-cell span { font-size: 10.5px; color: var(--text-muted); } .tg-cell i { font-size: 10px; color: var(--negative); font-style: normal; }
.tg-cell:hover { border-color: var(--primary); transform: translateY(-1px); }
.tg-cell.sel { outline: 2px solid var(--primary); outline-offset: 1px; }
.tg-cell.mine { box-shadow: 0 0 0 2px var(--secondary, #5b7fff) inset; }
.tg-cell.tg-none { background: var(--negative-soft); border-color: transparent; } .tg-cell.tg-none span { color: var(--negative); }
.tg-cell.tg-wait { background: var(--warning-soft); border-color: transparent; } .tg-cell.tg-wait span { color: var(--warning); }
.tg-cell.tg-ok { background: var(--positive-soft); border-color: transparent; } .tg-cell.tg-ok span { color: var(--positive); }
.tg-cell.tg-bad { background: var(--negative-soft); border: 1px dashed var(--negative); }
.tg-cell.tg-now { background: var(--primary-soft); border-color: var(--primary); animation: ss-pulse 1.8s infinite; }
.tg-cell.tg-next { opacity: .85; }
.tg-empty { color: var(--border); }
.tg-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.tg-sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: -8px; background: var(--surface-alt); border: 1px solid var(--border); }
.tg-sw.none, .tg-sw.bad { background: var(--negative-soft); } .tg-sw.wait { background: var(--warning-soft); } .tg-sw.ok { background: var(--positive-soft); } .tg-sw.now { background: var(--primary-soft); border-color: var(--primary); }
@media (max-width: 700px) { .tr-tabs-4 { grid-template-columns: 1fr 1fr; } }

/* بن‌ها */
.bn-info { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; font-size: 12.5px; color: var(--text-muted); }
.bn-raw pre { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 11.5px; max-width: 520px; max-height: 260px; overflow: auto; text-align: left; margin: 6px 0 10px; }

.tg-chk { list-style: none; margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); line-height: 2.1; font-size: 12.8px; }
.tg-chk .ok { color: var(--positive); } .tg-chk .bad { color: var(--negative); }

/* UCP */
.ucp-list { display: flex; flex-direction: column; gap: 10px; }
.ucp-row { display: grid; grid-template-columns: 150px 1.2fr 140px 2.4fr; gap: 10px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-inline-start: 4px solid var(--border); border-radius: 12px; background: var(--surface-alt); }
.ucp-row.ucp-excellent { border-inline-start-color: var(--positive); } .ucp-row.ucp-late { border-inline-start-color: var(--warning); } .ucp-row.ucp-bad { border-inline-start-color: var(--negative); } .ucp-row.ucp-leave { border-inline-start-color: var(--secondary, #5b7fff); }
.ucp-time small { display: block; font-size: 11.5px; } .ucp-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.ucp-act input[type=text] { flex: 1 1 140px; min-width: 120px; }
@media (max-width: 900px) { .ucp-row { grid-template-columns: 1fr 1fr; } .ucp-act { grid-column: 1 / -1; } }

/* چینشِ راست‌به‌چپ/چپ‌به‌راست: متنِ هر المانِ درون‌خطی جدا (isolate) تا علامت‌ها (پرانتز، _ ، -) به متنِ فارسیِ اطراف نچسبند */
bdi, .nm, .chip, .badge, strong, b { unicode-bidi: plaintext; }
bdi[dir="ltr"], .nm[style*="direction:ltr"] { unicode-bidi: isolate; direction: ltr; }
.tr-day { color: var(--text-muted); font-size: 11.5px; margin-inline-start: 8px; unicode-bidi: plaintext; }
.muted, small, .un-fa { unicode-bidi: plaintext; }
input[type=text], input[type=search], textarea { unicode-bidi: plaintext; text-align: start; }
input[dir="ltr"], .text-left-num input { text-align: left; }

/* لیستِ بن‌ها */
.bn-table td { vertical-align: top; }
.bn-has-proof { background: rgba(52,211,153,.06); }
a.pill.bn-proof { text-decoration: none; display: inline-block; }
a.pill.bn-proof:hover { filter: brightness(1.15); }
.bn-more summary { cursor: pointer; display: inline-block; margin-inline-start: 6px; font-size: 12px; opacity: .7; }
.bn-more[open] summary { opacity: 1; }
.bn-table .pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bn-table .pill.on { background: var(--positive-soft); color: var(--positive); }
.bn-table .pill.wait { background: var(--warning-soft); color: var(--warning); }
.bn-table .pill.off { background: var(--negative-soft); color: var(--negative); }

/* اطلاع‌رسانی: انتخابِ گیرنده */
.aud { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 6px 0 0; background: var(--surface-alt); }
.aud legend { padding: 0 8px; font-weight: 700; }
.aud-all { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.aud-custom { display: grid; gap: 12px; transition: opacity .2s; } .aud-custom.off { opacity: .35; pointer-events: none; }
.aud-block { border-top: 1px dashed var(--border); padding-top: 10px; } .aud-h { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.aud-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.chip-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.aud-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 240px; overflow: auto; margin-top: 8px; padding: 4px; }
.aud-person { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.aud-person:hover { background: var(--surface); } .aud-person:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.aud-count { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); font-size: 13.5px; } .aud-count.zero b { color: var(--negative); }
.aud-tools { display: inline-flex; gap: 6px; }


/* ======================================================================
   لایه‌ی افکت‌ها (IRAN GAME): فضای متحرک، درخششِ لبه‌ها، دکمه‌های زنده، واترمارک
   همه‌ی حرکت‌ها با prefers-reduced-motion خاموش می‌شود.
   ====================================================================== */
body::before {            /* شفقِ رنگی پشتِ صفحه */
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(38vmax 30vmax at 12% 18%, rgba(217,103,15,.16), transparent 62%),
        radial-gradient(34vmax 28vmax at 88% 12%, rgba(91,127,255,.12), transparent 60%),
        radial-gradient(40vmax 30vmax at 70% 92%, rgba(167,139,250,.10), transparent 62%);
}
body::after {             /* واترمارکِ انگلیسی */
    content: attr(data-wm); position: fixed; inset: 0; z-index: -1; pointer-events: none; user-select: none;
    display: grid; place-items: center; text-align: center; direction: ltr; unicode-bidi: isolate;
    font: 900 clamp(64px, 15vw, 210px)/1 'Vazirmatn', 'Segoe UI', Arial, sans-serif; letter-spacing: .18em; white-space: nowrap;
    color: var(--text); opacity: .026; transform: rotate(-22deg);
}
@keyframes aurora { 0% { transform: translate3d(-2%, -1%, 0) scale(1); } 50% { transform: translate3d(3%, 2%, 0) scale(1.06); } 100% { transform: translate3d(-1%, 3%, 0) scale(1.03); } }

/* امضای پایینِ صفحه */
.app-credit { position: relative; z-index: 1; text-align: center; padding: 22px 12px 26px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.app-credit b { color: var(--primary-strong); letter-spacing: .2em; text-shadow: 0 0 14px rgba(255,138,51,.45); }
.app-credit i { opacity: .5; font-style: normal; margin: 0 6px; }
.app-credit .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--positive); margin-inline-end: 8px; box-shadow: 0 0 0 0 rgba(47,217,123,.6); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,217,123,.55); } 70% { box-shadow: 0 0 0 9px rgba(47,217,123,0); } 100% { box-shadow: 0 0 0 0 rgba(47,217,123,0); } }

/* نوارِ پیشرفتِ اسکرول */
.scroll-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 9999; transform-origin: 100% 50%; transform: scaleX(0);
    background: linear-gradient(90deg, var(--primary-strong), var(--secondary), var(--positive)); box-shadow: 0 0 12px rgba(255,138,51,.6); }

/* پنل‌ها و کارت‌ها: درخششِ لبه + بالا آمدن */
.panel, .kpi { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.panel:hover { border-color: var(--border-glow); box-shadow: 0 10px 40px -18px rgba(217,103,15,.45); }
.kpi:hover { transform: translateY(-4px); border-color: var(--border-glow); box-shadow: 0 14px 34px -16px var(--tone, rgba(217,103,15,.6)); }
.panel h2 small { opacity: .8; }

/* دکمه‌ها: نورِ عبوری + ریپل */
.btn { position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { box-shadow: 0 6px 22px -8px rgba(217,103,15,.75); }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 42%; inset-inline-start: -60%; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); animation: shine 4.2s ease-in-out infinite; }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 8px 28px -6px rgba(255,138,51,.85); }
@keyframes shine { 0%, 62% { inset-inline-start: -60%; } 100% { inset-inline-start: 140%; } }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.35); pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* جدول‌ها و لیست‌ها */
table tbody tr { transition: background .15s ease; } table tbody tr:hover { background: var(--primary-soft); }
.dlist-item, .tr-tab, .chip-check, .aud-person { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.dlist-item:hover { transform: translateX(-3px); }
.tr-tab:hover { transform: translateY(-2px); }

/* منو */
.sidebar a, .nav a { transition: transform .18s ease, background .18s ease, color .18s ease; }
.sidebar a:hover, .nav a:hover { transform: translateX(-4px); }

/* وضعیت‌های زنده */
.pill.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-inline-end: 6px; vertical-align: middle; }
.skeleton, .muted:is(:empty) { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface) 37%, var(--surface-alt) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ورود به صفحه */

/* گزارشِ هفتگی: نمودارِ ریسپانسیو + بخشِ پوینت */
.chart-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: thin; }
.chart-scroll .chart { display: block; width: 100%; height: auto; }
.pt-formula { border: 1px dashed var(--border-glow); border-radius: 12px; padding: 12px 16px; background: var(--primary-soft); line-height: 2.1; font-size: 13.5px; }
.pt-formula ul { margin: 8px 0 0; padding-inline-start: 20px; font-size: 12.5px; color: var(--text-muted); }
.pf { display: inline-block; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.pf-pos { background: var(--positive-soft); color: var(--positive); } .pf-week { background: var(--secondary-soft); color: var(--secondary); } .pf-neg { background: var(--negative-soft); color: var(--negative); }
.pt-table tfoot td { font-weight: 700; border-top: 2px solid var(--border-glow); background: var(--surface-alt); }
.pt-table .pos, td.pos, b.pos { color: var(--positive); } .pt-table .neg, td.neg, b.neg { color: var(--negative); }
@media (max-width: 700px) { .pt-formula { font-size: 12.5px; padding: 10px 12px; } .app-credit { font-size: 10px; letter-spacing: .1em; } }

@media (prefers-reduced-motion: reduce) {
    .btn-primary::after, .app-credit .dot, .skeleton { animation: none !important; }
    .panel, .kpi, .btn { transition: none; }
}
@media print { body::before, body::after, .scroll-progress, .app-credit { display: none !important; } }


/* ---- وضعیتِ سرور: تغییرِ نرم، نه پرش ---- */
@keyframes ssFlash { 0% { box-shadow: 0 0 0 0 rgba(255,138,51,.55); } 100% { box-shadow: 0 0 0 10px rgba(255,138,51,0); } }
.ss-flash { animation: ssFlash .9s ease-out 1; }
.ss-card { transition: border-color .35s ease, background .35s ease; }
.ss-badge { transition: background .35s ease, color .35s ease; }

/* ---- اسکرولِ روان روی موبایل/لمسی: بدونِ blurِ زنده، بدونِ سایه/ترنزیشنِ هاور، رندرِ تنبلِ پنل‌های پایین ---- */
@media (max-width: 900px), (hover: none) {
    .topbar, .rp-jump, .pm-overlay, .sidebar-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
    .topbar { background: var(--surface-solid); }
    .rp-jump { background: var(--surface-solid); }
    .panel, .kpi, .btn, .dlist-item, .tr-tab, .ucp-row { transition: none; }
    .panel:hover, .kpi:hover, .dlist-item:hover, .tr-tab:hover, .btn:hover { transform: none; box-shadow: none; }
    .scroll-progress { display: none; }
    .ss-pulse, .tg-cell.tg-now, .btn-primary::after, .app-credit .dot { animation: none !important; }   /* انیمیشنِ بی‌نهایتِ box-shadow هر فریم را دوباره می‌کشد */
    .ss-card, .ss-badge { transition: none; }
}

/* رندرِ تنبلِ پنل‌های پایینِ صفحه (فقط ارتفاع؛ «contain-intrinsic-size» عرض را هم قفل می‌کرد و پنل از صفحه بیرون می‌زد) */
@supports (contain-intrinsic-block-size: auto 420px) {
    @media (max-width: 900px), (hover: none) {
        .panel + .panel { content-visibility: auto; contain-intrinsic-block-size: auto 420px; }
    }
}


/* ---- نوارِ پیشرفتِ آپلود (متحرک) ---- */
.up-box { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border-glow, var(--border)); border-radius: 14px; background: var(--surface-alt); animation: upIn .25s ease both; }
@keyframes upIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.up-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; unicode-bidi: plaintext; }
.up-pct { font-size: 18px; min-width: 52px; text-align: end; font-variant-numeric: tabular-nums; color: var(--primary-strong); }
.up-track { position: relative; height: 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.up-bar { position: relative; height: 100%; width: 0; border-radius: 999px; transition: width .18s ease-out;
    background: linear-gradient(90deg, var(--primary-strong, #ff8a33), var(--secondary, #5b7fff) 60%, var(--positive, #2fd97b));
    box-shadow: 0 0 14px rgba(255,138,51,.55); }
.up-bar::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 10px, transparent 10px 20px); background-size: 28px 28px; animation: upStripes .8s linear infinite; }
.up-glow { position: absolute; inset-block: -3px; inset-inline-end: -8px; width: 22px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); filter: blur(2px); animation: upPulse 1.1s ease-in-out infinite; }
@keyframes upStripes { to { background-position: 28px 0; } }
@keyframes upPulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.up-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.up-saving .up-bar { width: 100% !important; animation: upSaving 1.2s ease-in-out infinite; } @keyframes upSaving { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.up-done { border-color: var(--positive); } .up-done .up-pct { color: var(--positive); animation: upPop .4s ease; } @keyframes upPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.up-done .up-bar::before, .up-done .up-glow { display: none; }
.up-err { border-color: var(--negative); color: var(--negative); }
@media (prefers-reduced-motion: reduce) { .up-bar::before, .up-glow, .up-saving .up-bar, .up-done .up-pct { animation: none !important; } }

/* مدیریتِ فایل‌ها / S3 */
.file-deleted { opacity: .55; } .file-edit { display: inline-block; vertical-align: top; } .file-edit > summary { list-style: none; cursor: pointer; }
.file-edit-form { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); min-width: 240px; }
.file-edit-form label { display: grid; gap: 4px; font-size: 12px; }
.s3-crumbs { font-size: 13px; line-height: 2; } .s3-dirs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; } .pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }


/* ---- مدیریتِ ادمین‌ها: نام و رتبه‌ی بلند (بدونِ سرریز؛ شکستنِ خط) ---- */
.dlist-row, .dlist-row > *, .c-name, .c, .dlist-meta > .c, .dlist-info > span, .dlist-fields .field { min-width: 0; }
.c-name { align-items: flex-start; }
.nm { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; word-break: break-word; line-height: 1.5; }
.nm a { overflow-wrap: anywhere; }
.un { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.dlist-meta .c, .dlist-row .c-status { overflow-wrap: anywhere; }
.badge, .rank-badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; line-height: 1.45; }
.dlist-actions { flex-wrap: wrap; row-gap: 6px; }
.dlist-info { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.dlist-info > span { overflow-wrap: anywhere; }
.restore-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; } .restore-form select, .restore-form input { width: auto; min-width: 130px; flex: 1 1 140px; }
@media (max-width: 900px) { .dlist-row { align-items: flex-start; } }

.pm-row.pm-locked { opacity: .55; filter: grayscale(.4); } .pm-lock { margin-inline-start: 8px; }

/* متن‌های پیام‌ها */
.tpl-group { margin: 18px 0 6px; font-size: 14px; color: var(--primary-strong); } .tpl-item { padding: 10px 0; border-top: 1px dashed var(--border); }
.tpl-title { display: block; font-weight: 700; margin-bottom: 6px; } .tpl-text { width: 100%; min-height: 70px; font-family: inherit; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; } .tpl-var { cursor: pointer; direction: ltr; font-size: 12px; }
.tpl-preview { margin-top: 6px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* تنظیماتِ آپلود: فرمت‌ها */
.upl-box { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 12px 0; background: var(--surface-alt); } .upl-box legend { padding: 0 8px; font-weight: 700; }
.upl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; } .upl-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

.tpl-cat { border: 1px solid var(--border); border-radius: 14px; margin: 14px 0; padding: 4px 14px 12px; background: var(--surface-alt); } .tpl-cat > summary { cursor: pointer; font-weight: 800; padding: 10px 0; font-size: 15px; }

/* مدیریت تایم */
.tm-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0; } .tm-stat { border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 2px; } .tm-stat b { font-size: 24px; } .tm-stat span { font-size: 12.5px; color: var(--muted); } .tm-stat.bad { border-color: #e5484d; } .tm-stat.bad b { color: #e5484d; } .tm-stat.warn { border-color: #f5a524; } .tm-stat.warn b { color: #f5a524; } .tm-stat.good b { color: #30a46c; }
.tm-grid th, .tm-grid td { text-align: center; padding: 4px 6px; } .tm-grid td a { display: block; text-decoration: none; font-weight: 700; } .tm-cell.tm-c0 { background: rgba(229, 72, 77, .22); } .tm-cell.tm-low { background: rgba(245, 165, 36, .22); } .tm-cell.tm-ok { background: rgba(48, 164, 108, .16); } .tm-daysel { outline: 2px solid var(--primary); }
.tm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.tm-badge { display: inline-block; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; } .tm-badge.tm-c0 { background: #e5484d; color: #fff; } .tm-badge.tm-low { background: #f5a524; color: #1a1a1a; } .tm-badge.tm-ok { background: #30a46c; color: #fff; }
.tm-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-alt); text-decoration: none; max-width: 100%; overflow-wrap: anywhere; } .tm-chip:hover { border-color: var(--primary); } .tm-empty { color: #e5484d; font-weight: 700; }
.tm-now td { box-shadow: inset 0 0 0 2px var(--primary); } .tm-c0-row td { background: rgba(229, 72, 77, .06); } .tm-add { display: flex; gap: 6px; } .tm-add select { min-width: 0; flex: 1; } .tm-name { font-weight: 700; overflow-wrap: anywhere; }

.rc-badge { display: inline-block; padding: 1px 9px; margin: 0 6px; border-radius: 999px; background: rgba(99,102,241,.16); border: 1px solid rgba(99,102,241,.45); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* پیش‌نمایش */
.pv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; } .pv-box { display: flex; justify-content: center; padding: 8px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px; }
.pv-img { max-width: 100%; max-height: 78vh; border-radius: 10px; } .pv-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: 12px; background: #fff; } .pv-media { max-width: 100%; max-height: 78vh; border-radius: 10px; } .pv-audio { width: 100%; }
.pv-text { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 12px; max-height: 70vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.proof-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .proof-file-card { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-alt); }

/* جدولِ کاملِ عملکرد + راهنمای پوینت */
#perf-table th.sep-l, #perf-table td.sep-l { border-inline-start: 3px double var(--border-strong, var(--primary)); } .pt-sub { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; white-space: nowrap; }
.pts-guide > summary { cursor: pointer; padding: 4px 0; } .pts-guide-body { margin-top: 10px; line-height: 2; font-size: 13.5px; } .pts-guide-body h3 { margin: 14px 0 4px; font-size: 14.5px; color: var(--primary-strong); } .pts-guide-body ul { margin: 0; padding-inline-start: 22px; }

/* پنجره‌ی (پاپ‌آپِ) تغییر رنک — روی صفحه، وسطِ صفحه، با پس‌زمینه‌ی تیره */
.rc-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(2px); overflow-y: auto; }
.rc-modal[hidden] { display: none !important; }
.rc-box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface, #14151b); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.rc-box h3 { margin: 0 0 14px; font-size: 16px; }
.rc-dir { margin-top: 6px; font-size: 13px; font-weight: 700; }
.rc-items { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.rc-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 8px; }
.rc-item input[type=number] { width: 100%; } .rc-pair { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .rc-pair input { flex: 1; min-width: 120px; }
body.rc-open { overflow: hidden; }

/* پوینتِ دستی */
.pt-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr); gap: 18px; } @media (max-width: 760px) { .pt-grid { grid-template-columns: 1fr; } }
.pt-col { display: flex; flex-direction: column; gap: 10px; } .pt-lbl { font-weight: 700; font-size: 13.5px; }
.pt-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 2px; }
.pt-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; } .pt-item:hover { background: rgba(255, 255, 255, .06); } .pt-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-choices { display: flex; gap: 8px; flex-wrap: wrap; } .pt-choice { flex: 1; min-width: 140px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; cursor: pointer; background: var(--surface-alt); } .pt-choice small { display: block; font-size: 11.5px; color: var(--muted); } .pt-choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.pt-effect { padding: 8px 12px; border-radius: 10px; background: rgba(99, 102, 241, .12); font-weight: 700; } .pt-rev td { opacity: .55; text-decoration: line-through; } .pt-rev td:last-child, .pt-rev td:nth-child(3) { text-decoration: none; }
.points { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.adm-sortbar { display: flex; justify-content: flex-end; margin: 4px 0 8px; font-size: 12.5px; } .adm-sortbar select { margin-inline-start: 6px; padding: 3px 8px; border-radius: 8px; }

/* جدولِ کاملِ عملکرد: بدونِ اسکرولِ افقی در دسکتاپ؛ در موبایل کارتی */
#perf-table.rp-fit { width: 100%; table-layout: auto; font-size: 12px; } #perf-table.rp-fit th { white-space: normal; line-height: 1.5; padding: 6px 4px; font-size: 11.5px; text-align: center; vertical-align: bottom; } #perf-table.rp-fit td { text-align: center; padding: 6px 4px; } #perf-table.rp-fit td:first-child, #perf-table.rp-fit th:first-child { text-align: right; min-width: 92px; }
#rp-table .table-wrap, #rp-table { overflow-x: visible; } #perf-table .pbar { display: inline-block; width: 28px; height: 5px; border-radius: 3px; background: var(--surface-alt); vertical-align: middle; overflow: hidden; margin-inline-end: 3px; } #perf-table .pbar i { display: block; height: 100%; background: var(--positive); }
.rp-legend { font-size: 12.5px; line-height: 2; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 12px; margin: 4px 0 12px; background: var(--surface-alt); }
.points.muted, .muted.points { color: var(--muted); } .points.warning { color: var(--warning); } .points.secondary { color: var(--secondary); }
.rpt-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; } .tops-card h3 { font-size: 14px; margin: 0 0 8px; }
@media (max-width: 900px) { #perf-table.rp-fit, #perf-table.rp-fit tbody, #perf-table.rp-fit tr, #perf-table.rp-fit td { display: block; width: 100%; } #perf-table.rp-fit thead { display: none; } #perf-table.rp-fit tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 10px; } #perf-table.rp-fit td { display: flex; justify-content: space-between; text-align: left !important; border: 0; padding: 3px 0; } #perf-table.rp-fit td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; } #perf-table.rp-fit tfoot { display: none; } }

/* جدولِ کاملِ عملکرد: عرضِ ثابت و فشرده تا هیچ ستونی بیرون از کادر نرود (بدونِ اسکرولِ افقی) */
#perf-table.rp-fit { table-layout: fixed; width: 100%; font-size: 11.5px; } #perf-table.rp-fit th, #perf-table.rp-fit td { padding: 5px 1px; overflow-wrap: anywhere; word-break: break-word; } #perf-table.rp-fit th { width: 44px; font-size: 10.5px; } #perf-table.rp-fit th:first-child { width: 96px; } #perf-table.rp-fit th:nth-child(3) { width: 76px; } #perf-table.rp-fit th:nth-child(9) { width: 52px; }
#perf-table .pbar { width: 22px; } #perf-table.rp-fit td:first-child b { font-size: 11.5px; }

#perf-table.rp-fit th:nth-child(8) { width: 54px; }

.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--warning, #f59e0b); color: #000; font-size: 11px; font-weight: 800; text-align: center; margin-inline-start: 4px; }

.tm-chip-warn { opacity: .7; border-style: dashed; }

/* =====================================================================
   داشبورد v2 — «HUDِ شیفت»: نمای بازیِ MTA، گوشه‌های بُریده‌ی برند، رادارِ ۲۴ساعته‌ی امروز
   ===================================================================== */
:root { --hud-off: rgba(255, 255, 255, .075); --hud-ink: #fff; --st: var(--text-muted); }
[data-theme="light"] { --hud-off: rgba(20, 24, 36, .09); --hud-ink: #11131a; }

.hud { position: relative; display: grid; grid-template-columns: minmax(190px, .8fr) minmax(230px, 1.1fr) minmax(300px, 1.7fr); gap: 20px 32px; align-items: center;
    margin-bottom: 18px; padding: 24px 28px 30px; border: 1px solid var(--border);
    background: linear-gradient(120deg, rgba(217, 103, 15, .17) 0%, transparent 46%), repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 9px), var(--surface-solid);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px)); }
[data-theme="light"] .hud { background: linear-gradient(120deg, rgba(217, 103, 15, .14) 0%, transparent 48%), #fff; }
.hud::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--st), transparent 75%); }
.hud-ok { --st: var(--positive); } .hud-warn { --st: var(--warning); } .hud-info { --st: var(--secondary); } .hud-next { --st: var(--primary-strong); } .hud-leave { --st: var(--leave); } .hud-idle { --st: var(--text-muted); }

.hud-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hud-avatar { flex: none; width: 54px; height: 54px; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: var(--rc, var(--primary-strong)); background: var(--surface-alt); border: 2px solid var(--rc, var(--primary));
    clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.hud-hello { font-size: 17px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; } .hud-hello b { font-weight: 800; }
.hud-rank { margin-top: 2px; }

.hud-status { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.hud-dot { flex: none; width: 12px; height: 12px; margin-top: 9px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st) 22%, transparent), 0 0 14px var(--st); }
.hud-warn .hud-dot, .hud-ok .hud-dot { animation: hudPulse 2.2s ease-in-out infinite; }
.hud-status-main { font-size: 19px; font-weight: 800; line-height: 1.5; } .hud-status-sub { margin-top: 2px; font-size: 13px; color: var(--text-muted); line-height: 1.8; }

.hud-day { min-width: 0; }
.hud-day-grid { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 34px; direction: ltr; }
.hud-cell { position: relative; border-radius: 3px; background: var(--hud-off); }
.hud-cell.k-regular { background: var(--primary); box-shadow: 0 0 10px rgba(217, 103, 15, .35); }
.hud-cell.k-swap_in { background: var(--positive); } .hud-cell.k-extra { background: var(--secondary); }
.hud-cell.k-swapped_out { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-muted); opacity: .8; }
.hud-cell.past { opacity: .5; }
.hud-cell.now { outline: 2px solid var(--hud-ink); outline-offset: 2px; opacity: 1; z-index: 1; }
.hud-cell.now::after { content: ''; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); border: 4px solid transparent; border-bottom-color: var(--hud-ink); }
.hud-day-axis { display: flex; justify-content: space-between; direction: ltr; margin-top: 8px; font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hud-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 11.5px; color: var(--text-muted); }
.hud-legend i { display: inline-block; width: 10px; height: 10px; margin-inline-end: 6px; border-radius: 2px; vertical-align: -1px; background: var(--hud-off); }
.hud-legend i.k-regular { background: var(--primary); } .hud-legend i.k-swap_in { background: var(--positive); } .hud-legend i.k-extra { background: var(--secondary); } .hud-legend i.k-swapped_out { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-muted); }

/* کارهای منتظر */
.dx-todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dx-todo-i { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-solid); border: 1px solid var(--border); border-inline-start: 4px solid var(--tc, var(--primary)); border-radius: 10px; color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.dx-todo-i:hover { background: var(--surface-alt); border-color: var(--tc, var(--primary)); }
.dx-todo-i.t-bad { --tc: var(--negative); } .dx-todo-i.t-warn { --tc: var(--warning); } .dx-todo-i.t-info { --tc: var(--secondary); }
.dx-todo-ic { font-size: 18px; flex: none; } .dx-todo-t { flex: 1; font-size: 13.5px; line-height: 1.7; }
.dx-todo-go { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: var(--tc, var(--primary)); background: color-mix(in srgb, var(--tc, var(--primary)) 14%, transparent); }
.dx-clear { margin-bottom: 18px; padding: 10px 16px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-muted); font-size: 13.5px; }

/* کارت‌ها */
.dx-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 18px; } .dx-grid-b { grid-template-columns: 1.7fr 1fr; }
.dx-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 20px; min-width: 0; }
.dx-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 14px; font-size: 15.5px; font-weight: 800; }
.dx-h::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: var(--primary); } .dx-h small { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.dx-meters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dx-meter { padding: 12px 14px 11px; background: var(--surface-alt); border: 1px solid var(--border); border-bottom: 3px solid var(--mc, var(--border)); border-radius: 8px; }
.dx-meter.m-up { --mc: var(--positive); } .dx-meter.m-down { --mc: var(--negative); } .dx-meter.m-av { --mc: var(--primary); } .dx-meter.m-warn { --mc: var(--warning); }
.dx-m-l { display: block; font-size: 12px; color: var(--text-muted); } .dx-m-v { display: block; margin-top: 2px; font-size: 26px; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; } .dx-m-v small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.dx-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--text-muted); } .dx-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.dx-pay { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; } .dx-pay div { display: flex; justify-content: space-between; gap: 10px; color: var(--text-muted); } .dx-pay b { color: var(--text); font-weight: 700; } .dx-pay .sum { padding-top: 7px; border-top: 1px solid var(--border); color: var(--text); font-weight: 700; } .dx-pay .sum b { color: var(--primary-strong); }

.dx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
.dx-tile { display: flex; flex-direction: column; gap: 1px; padding: 14px 14px 13px; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: background .15s, border-color .15s;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
.dx-tile:hover { background: var(--primary-soft); border-color: var(--primary); }
.dx-tile-ic { font-size: 22px; line-height: 1.4; } .dx-tile-t { font-weight: 800; font-size: 14px; } .dx-tile-s { font-size: 11.5px; color: var(--text-muted); }

.dx-feed-l { list-style: none; margin: 0; padding: 0; } .dx-feed-l li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dx-feed-l li:last-child { border-bottom: 0; } .dx-f-d { font-size: 11.5px; color: var(--text-muted); } .dx-f-p { min-width: 54px; font-weight: 800; }

.dx-announce { margin-bottom: 14px; padding: 14px 18px; border: 1px solid var(--primary); border-inline-start-width: 5px; border-radius: 10px; background: linear-gradient(100deg, var(--primary-soft), transparent 70%), var(--surface-solid); }
.dx-announce-h { font-weight: 800; margin-bottom: 4px; } .dx-announce-f { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.dx-online { border-inline-start: 4px solid var(--positive); }
.dx-board .table-wrap { margin-top: 0; }

@keyframes hudPulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--st) 22%, transparent), 0 0 14px var(--st); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--st) 6%, transparent), 0 0 20px var(--st); } }
@media (prefers-reduced-motion: reduce) { .hud-dot { animation: none !important; } }
@media (max-width: 1100px) { .hud { grid-template-columns: 1fr 1fr; } .hud-day { grid-column: 1 / -1; } .dx-grid, .dx-grid-b { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .hud { grid-template-columns: 1fr; padding: 20px 18px 26px; } .hud-status-main { font-size: 17px; } .hud-day-grid { height: 30px; gap: 2px; } .dx-todo { grid-template-columns: 1fr; } .dx-m-v { font-size: 23px; } .dx-tiles { grid-template-columns: repeat(2, 1fr); } }

/* ===== جلای کلیِ سایت: فوکوسِ دیدنی، اسکرولِ نازک، هاورِ ردیفِ جدول، فشارِ دکمه ===== */
:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
tbody tr { transition: background .12s; } tbody tr:hover { background: var(--primary-soft); }
.btn { transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; } .btn:hover { transform: translateY(-1px); } .btn:active { transform: translateY(0); }
.sidebar a:hover { background: var(--primary-soft); }

.dx-grid { align-items: start; }

/* جدولِ گزارشِ هفتگی: عرضِ ستون‌ها کمی فشرده‌تر تا در ۱۲۸۰px هم داخلِ کادر بماند */
#perf-table.rp-fit th { width: 41px; } #perf-table.rp-fit th:first-child { width: 90px; } #perf-table.rp-fit th:nth-child(3) { width: 70px; } #perf-table.rp-fit th:nth-child(8) { width: 52px; } #perf-table.rp-fit th:nth-child(9) { width: 48px; }

.frag-table { table-layout: fixed; width: 100%; } .frag-table td, .frag-table th { overflow-wrap: anywhere; white-space: normal; vertical-align: top; } .frag-table pre { white-space: pre-wrap; overflow-wrap: anywhere; } .frag-table textarea { box-sizing: border-box; }
@media (max-width: 900px) { .frag-table { table-layout: auto; } }
.frag-table pre, .frag-table textarea { unicode-bidi: plaintext; text-align: start; }

/* راهنمای اختصارهای جدولِ عملکرد: شبکه‌ی اصطلاح ⇒ معنی (به‌جای یک پاراگرافِ بلند و قاطی) */
.rp-legend { padding: 12px 16px; } .rp-legend-t { display: block; margin-bottom: 8px; font-size: 13px; }
.rp-legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px 22px; margin: 0; }
.rp-legend-grid > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12.5px; line-height: 1.8; } .rp-legend-grid dt { margin: 0; font-weight: 800; color: var(--primary-strong); white-space: nowrap; } .rp-legend-grid dd { margin: 0; color: var(--text-muted); }
.rp-legend-more { display: block; margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }
#perf-table th bdi { unicode-bidi: isolate; }

/* ریزِ پوینت‌ها در پروفایل */
.bp-totals { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bp-chip { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; background: var(--surface-alt); border: 1px solid var(--border); border-inline-start: 3px solid var(--border); border-radius: 8px; min-width: 96px; }
.bp-chip small { font-size: 11px; color: var(--text-muted); } .bp-chip b { font-size: 18px; font-variant-numeric: tabular-nums; }
.bp-chip.pos { border-inline-start-color: var(--positive); } .bp-chip.neg { border-inline-start-color: var(--negative); } .bp-chip.net { border-inline-start-color: var(--primary); }
.bp-custom input[type=date] { min-width: 150px; }

/* فیش حقوقی */
.slip { max-width: 980px; }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid var(--primary); margin-bottom: 14px; }
.slip-title { font-size: 20px; font-weight: 800; } .slip-state { text-align: left; }
.slip-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.slip-meta > div { padding: 9px 12px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; } .slip-meta small { display: block; font-size: 11px; color: var(--text-muted); } .slip-meta b { font-size: 14px; }
.slip-table .slip-sec td { background: var(--primary-soft); padding: 8px 12px; } .slip-sub { float: left; font-weight: 800; }
.slip-sum { margin-top: 14px; display: grid; gap: 6px; max-width: 420px; margin-inline-start: auto; } .slip-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.slip-sum .slip-total { border-bottom: 0; border-top: 2px solid var(--primary); padding-top: 10px; font-size: 17px; font-weight: 800; } .slip-sum .slip-total b { color: var(--primary-strong); }
@media print {
    body { background: #fff !important; color: #000 !important; } .sidebar, .topbar, .no-print, .site-footer, #reload-btn { display: none !important; }
    .main, .content, main { margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: none !important; }
    .panel.slip { border: 0 !important; box-shadow: none !important; background: #fff !important; color: #000 !important; max-width: none; }
    .slip *, .slip .muted { color: #000 !important; } .slip-table .slip-sec td { background: #eee !important; } .slip-meta > div { background: #fff !important; border-color: #999 !important; }
}

/* ===== پروفایلِ تصویری و نشان‌های افتخار ===== */
.pf-av { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; vertical-align: middle; background: var(--surface-alt); }
.pf-av-i { font-weight: 800; border: 2px solid var(--border); color: var(--primary-strong); border-color: var(--primary); }
.pf-card { padding: 0; overflow: hidden; }
.pf-banner { height: 120px; } .pf-body { display: flex; gap: 16px; align-items: flex-start; padding: 0 22px 8px; margin-top: -46px; flex-wrap: wrap; }
.pf-av-wrap { position: relative; flex: none; } .pf-av-wrap .pf-av { border: 4px solid var(--surface-solid); box-shadow: 0 0 0 2px var(--rc, var(--primary)); }
.pf-online { position: absolute; bottom: 8px; inset-inline-end: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--positive); border: 3px solid var(--surface-solid); }
.pf-main { flex: 1; min-width: 220px; padding-top: 52px; } .pf-name { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-status { display: inline-block; margin: 4px 0; padding: 2px 12px; border-radius: 99px; background: var(--primary-soft); font-size: 13px; } .pf-bio { margin: 8px 0 4px; line-height: 2; } .pf-meta { font-size: 12.5px; } .pf-on { color: var(--positive); }
.pf-msg { margin-top: 56px; } .pf-badges { padding: 6px 22px 8px; } .pf-badges h3 { margin: 10px 0 6px; font-size: 15px; }
.pf-badge-list { display: flex; gap: 8px; flex-wrap: wrap; } .pf-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: color-mix(in srgb, var(--bc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--bc) 55%, transparent); font-size: 13px; font-weight: 700; }
.pf-badge-ic { font-size: 17px; } .pf-badge-x { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; } .pf-badge-x:hover { color: var(--negative); }
.pf-more { margin: 0 22px 12px; } .pf-more summary { cursor: pointer; font-weight: 700; color: var(--primary-strong); padding: 6px 0; } .pf-more ul { margin: 6px 0 0; padding-inline-start: 18px; line-height: 2; }
.pf-swatches { display: flex; gap: 8px; flex-wrap: wrap; } .pf-sw { position: relative; display: inline-flex; width: 92px; height: 40px; border-radius: 8px; cursor: pointer; overflow: hidden; border: 2px solid transparent; }
.pf-sw input { position: absolute; opacity: 0; } .pf-sw span { margin: auto; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); } .pf-sw:has(input:checked) { border-color: var(--text); }
.pf-ban-ember { background: linear-gradient(120deg, #D9670F, #7a2e05 60%, #1a0f08); } .pf-ban-ocean { background: linear-gradient(120deg, #1d6fd1, #0a3f7a 60%, #07182c); }
.pf-ban-forest { background: linear-gradient(120deg, #1f9d55, #0b5a2e 60%, #07180f); } .pf-ban-royal { background: linear-gradient(120deg, #7c4dff, #3b1d99 60%, #120a2b); }
.pf-ban-rose { background: linear-gradient(120deg, #e83e8c, #8e1a4e 60%, #2a0916); } .pf-ban-steel { background: linear-gradient(120deg, #6b7a90, #36414f 60%, #12161c); }
.pf-ban-gold { background: linear-gradient(120deg, #f5b301, #a06a00 60%, #2a1c00); } .pf-ban-night { background: linear-gradient(120deg, #3b4a6b, #151d33 60%, #05070d); }

/* =====================================================================
   پیام‌رسان (شبیهِ تلگرام) — سه‌ستونه، حبابِ پیام، ری‌اکشن، پین، پیوست
   ===================================================================== */
.msgr { display: flex; height: calc(100vh - 128px); min-height: 520px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.msgr-side { width: 340px; flex: none; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.msgr-side-top { display: flex; gap: 6px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); } .msgr-side-top input { flex: 1; min-width: 0; margin: 0; }
.msgr-ic { background: transparent; border: 0; color: var(--text); font-size: 18px; cursor: pointer; border-radius: 8px; padding: 6px 8px; line-height: 1; } .msgr-ic:hover { background: var(--primary-soft); }
.msgr-list { flex: 1; overflow-y: auto; } .msgr-hint { padding: 18px; text-align: center; color: var(--text-muted); font-size: 13px; }
.msgr-item { display: flex; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); } .msgr-item:hover { background: var(--surface-alt); } .msgr-item.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.msgr-item-av { position: relative; flex: none; } .msgr-on { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--positive); border: 2px solid var(--surface-solid); }
.msgr-item-b { flex: 1; min-width: 0; } .msgr-item-1, .msgr-item-2 { display: flex; align-items: center; gap: 6px; } .msgr-item-1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; } .msgr-item-1 small { color: var(--text-muted); font-size: 11px; flex: none; }
.msgr-snip { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 13px; } .msgr-typing { color: var(--primary-strong); }
.msgr-badge { background: var(--primary); color: #fff; border-radius: 99px; min-width: 20px; padding: 1px 6px; font-size: 11.5px; font-weight: 800; text-align: center; } .msgr-badge.mute { background: var(--text-muted); }
.msgr-results { max-height: 40%; overflow-y: auto; border-bottom: 1px solid var(--border); background: var(--surface-alt); } .msgr-res-h { padding: 6px 12px; font-size: 11.5px; color: var(--text-muted); }
.msgr-res { padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--border); } .msgr-res:hover { background: var(--primary-soft); } .msgr-res span { color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .msgr-res small { font-size: 11px; color: var(--text-muted); }

.msgr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 55%), var(--bg, var(--surface-solid)); position: relative; }
.msgr-empty { margin: auto; text-align: center; color: var(--text-muted); font-size: 42px; } .msgr-empty-in h3 { margin: 6px 0; color: var(--text); font-size: 18px; } .msgr-empty-in p { font-size: 13px; margin: 0; }
.msgr-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.msgr-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-solid); border-bottom: 1px solid var(--border); } .msgr-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .msgr-head-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .msgr-head-t small { color: var(--text-muted); font-size: 12px; }
.msgr-back { display: none; }
.msgr-findbar { padding: 8px 12px; background: var(--surface-alt); border-bottom: 1px solid var(--border); } .msgr-findbar input { width: 100%; margin: 0; } #msgr-findres { max-height: 180px; overflow-y: auto; }
.msgr-pin { display: flex; gap: 8px; align-items: center; padding: 6px 14px; background: var(--surface-solid); border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; } .msgr-pin div { display: flex; flex-direction: column; min-width: 0; } .msgr-pin div span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-scroll { flex: 1; overflow-y: auto; padding: 10px 14px; min-height: 0; } .msgr-msgs { display: flex; flex-direction: column; }
.msgr-day { text-align: center; margin: 12px 0 6px; } .msgr-day span { background: color-mix(in srgb, var(--surface-alt) 90%, transparent); border: 1px solid var(--border); border-radius: 99px; padding: 2px 12px; font-size: 12px; color: var(--text-muted); }
.msgr-sys { text-align: center; margin: 8px 0; } .msgr-sys span { background: var(--surface-alt); border-radius: 99px; padding: 3px 12px; font-size: 12px; color: var(--text-muted); }
.msgr-row { display: flex; gap: 8px; margin: 1px 0; align-items: flex-end; position: relative; } .msgr-row.head { margin-top: 8px; } .msgr-row.mine { justify-content: flex-end; }
.msgr-row-av { width: 34px; flex: none; } .msgr-row.flash .msgr-bub { box-shadow: 0 0 0 2px var(--primary); }
.msgr-bub { position: relative; max-width: min(78%, 560px); padding: 6px 10px 18px; border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--border); min-width: 70px; word-break: break-word; }
.msgr-row.mine .msgr-bub { background: color-mix(in srgb, var(--primary) 20%, var(--surface-solid)); border-color: color-mix(in srgb, var(--primary) 45%, transparent); } .msgr-row.head:not(.mine) .msgr-bub { border-start-end-radius: 4px; } .msgr-row.mine.head .msgr-bub { border-start-start-radius: 4px; }
.msgr-sender { font-size: 12.5px; font-weight: 800; margin-bottom: 2px; } .msgr-sender a { color: inherit; text-decoration: none; } .msgr-bdg { margin-inline-start: 4px; font-size: 12px; }
.msgr-text { line-height: 1.9; white-space: normal; } .msgr-text a { color: var(--secondary); } .msgr-text code, .msgr-pre { background: rgba(0,0,0,.25); padding: 1px 5px; border-radius: 4px; direction: ltr; unicode-bidi: plaintext; font-family: ui-monospace, monospace; font-size: 12.5px; } .msgr-pre { display: block; padding: 8px; white-space: pre-wrap; margin: 4px 0; }
.msgr-meta { position: absolute; bottom: 2px; inset-inline-end: 9px; font-size: 10.5px; color: var(--text-muted); display: flex; gap: 4px; } .msgr-tick { color: var(--text-muted); letter-spacing: -2px; } .msgr-tick.read { color: var(--secondary); }
.msgr-more { position: absolute; top: 2px; inset-inline-start: 4px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; opacity: 0; font-size: 15px; } .msgr-bub:hover .msgr-more { opacity: 1; }
.msgr-quote { border-inline-start: 3px solid var(--primary); background: rgba(0,0,0,.14); padding: 3px 8px; border-radius: 6px; margin-bottom: 4px; cursor: pointer; display: flex; flex-direction: column; font-size: 12.5px; } .msgr-quote span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.msgr-fwd { font-size: 12px; color: var(--primary-strong); margin-bottom: 3px; }
.msgr-img img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin: 2px 0 4px; } .msgr-vid { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin: 2px 0 4px; background: #000; }
.msgr-file { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; padding: 4px 0 6px; } .msgr-file-ic { font-size: 26px; } .msgr-file-t { display: flex; flex-direction: column; min-width: 0; } .msgr-file-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; } .msgr-file-t small { color: var(--text-muted); }
.msgr-reacts { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 4px 0; } .msgr-row .msgr-reacts { position: absolute; bottom: -12px; inset-inline-start: 10px; } .msgr-row { margin-bottom: 4px; }
.msgr-react { border: 1px solid var(--border); background: var(--surface-solid); border-radius: 99px; padding: 0 8px; font-size: 12px; cursor: pointer; color: var(--text); } .msgr-react.mine { background: var(--primary-soft); border-color: var(--primary); }
.msgr-down { position: absolute; bottom: 86px; inset-inline-end: 18px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 99px; padding: 6px 12px; cursor: pointer; color: var(--text); box-shadow: 0 3px 12px rgba(0,0,0,.35); z-index: 3; }
.msgr-reply, .msgr-attach { display: flex; gap: 10px; align-items: center; padding: 6px 14px; background: var(--surface-solid); border-top: 1px solid var(--border); font-size: 13px; } .msgr-reply div { display: flex; flex-direction: column; flex: 1; min-width: 0; } .msgr-reply div span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-attach img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; } .msgr-attach div { display: flex; flex-direction: column; flex: 1; min-width: 0; } .msgr-prog { height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden; } .msgr-prog i { display: block; height: 100%; width: 0; background: var(--primary); }
.msgr-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; background: var(--surface-solid); border-top: 1px solid var(--border); position: relative; } .msgr-form textarea { flex: 1; margin: 0; resize: none; max-height: 160px; border-radius: 18px; padding: 9px 14px; line-height: 1.7; }
.msgr-sendbtn { background: var(--primary); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 16px; cursor: pointer; flex: none; } .msgr-sendbtn:hover { background: var(--primary-strong); } .msgr-readonly { padding: 14px; text-align: center; color: var(--text-muted); background: var(--surface-solid); border-top: 1px solid var(--border); font-size: 13px; }
.msgr-pop { position: absolute; bottom: 56px; inset-inline-end: 10px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; box-shadow: 0 8px 28px rgba(0,0,0,.45); z-index: 6; max-width: 300px; } .msgr-pop button { border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 6px; padding: 3px; } .msgr-pop button:hover { background: var(--primary-soft); }
.msgr-ctx { position: fixed; z-index: 9999; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 34px rgba(0,0,0,.5); padding: 6px; min-width: 190px; display: flex; flex-direction: column; } .msgr-ctx button { text-align: start; border: 0; background: transparent; color: var(--text); padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; } .msgr-ctx button:hover { background: var(--primary-soft); } .msgr-ctx .danger { color: var(--negative); }
.msgr-emojis { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; } .msgr-emojis button { font-size: 20px; padding: 2px 5px; }
.msgr-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9998; display: grid; place-items: center; padding: 14px; } .msgr-box { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; padding: 18px; width: min(440px, 100%); max-height: 86vh; overflow-y: auto; } .msgr-box h3 { margin: 0 0 10px; }
.msgr-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; } .msgr-tabs button { border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 99px; padding: 5px 14px; cursor: pointer; } .msgr-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.msgr-box input[type=text], .msgr-box input[type=search] { width: 100%; margin: 0 0 8px; } .msgr-contacts { max-height: 300px; overflow-y: auto; margin-bottom: 10px; } .msgr-contact { display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer; border-radius: 8px; } .msgr-contact:hover { background: var(--surface-alt); } .msgr-contact small { display: block; color: var(--text-muted); font-size: 11.5px; } .msgr-grp-act { display: flex; gap: 8px; flex-wrap: wrap; }
.msgr-lb { background: rgba(0,0,0,.88); } .msgr-lb img { max-width: 94vw; max-height: 84vh; border-radius: 8px; } .msgr-lb a { margin-top: 10px; }
.msgr-prof { text-align: center; } .msgr-prof .pf-banner { margin: -18px -18px 0; border-radius: 14px 14px 0 0; } .msgr-prof-av { margin-top: -44px; display: inline-block; } .msgr-prof-av .pf-av { border: 4px solid var(--surface-solid); } .msgr-prof h3 { margin: 6px 0 2px; } .msgr-prof-act { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.msgr-toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%); background: var(--surface-solid); border: 1px solid var(--border); padding: 9px 18px; border-radius: 99px; z-index: 10000; box-shadow: 0 6px 20px rgba(0,0,0,.4); } .msgr-toast.bad { border-color: var(--negative); color: var(--negative); }
.msgr-grp { background: var(--primary-soft) !important; }
@media (max-width: 860px) {
    .msgr { height: calc(100vh - 96px); } .msgr-side { width: 100%; border: 0; } .msgr-main { display: none; position: absolute; inset: 0; z-index: 4; } .msgr.chat-open .msgr-main { display: flex; } .msgr.chat-open .msgr-side { visibility: hidden; }
    .msgr-back { display: inline-block; } .msgr-bub { max-width: 88%; } .msgr-more { opacity: 1; }
}
.msgr [hidden], .msgr-modal[hidden] { display: none !important; }
.msgr-side-top input[type=search], .msgr-findbar input, .msgr-box input[type=text], .msgr-box input[type=search] { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 99px; padding: 8px 14px; color: var(--text); font: inherit; outline: none; } .msgr-side-top input:focus, .msgr-findbar input:focus, .msgr-box input:focus { border-color: var(--primary); }
.msgr-form textarea { background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); font: inherit; outline: none; } .msgr-form textarea:focus { border-color: var(--primary); }
.pf-ban-rank { background: linear-gradient(120deg, var(--rc, #D9670F), color-mix(in srgb, var(--rc, #D9670F) 38%, #000) 58%, #0b0d12); }
video.pf-av { background: #000; }

/* محیط تست API */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.lab-card { margin: 0; } .lab-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; } .lab-head code { font-size: 12px; opacity: .8; }
.lab-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 6px; } .lab-note { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-muted); line-height: 1.8; }
.lab-sum { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; } .lab-sum th { text-align: start; width: 38%; color: var(--text-muted); font-weight: 600; padding: 5px 6px; border-bottom: 1px dashed var(--border); vertical-align: top; } .lab-sum td { padding: 5px 6px; border-bottom: 1px dashed var(--border); word-break: break-word; }
.lab-det { margin: 6px 0; } .lab-det summary { cursor: pointer; color: var(--primary-strong); font-size: 13px; } .lab-det pre { background: rgba(0,0,0,.28); padding: 10px; border-radius: 8px; max-height: 280px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; text-align: left; }
@media (max-width: 860px) { .lab-grid { grid-template-columns: 1fr; } }

/* ===== «کی چند ریپورت باز کرده» (وضعیت سرور + گزارش تایم) ===== */
.rcb { margin: 12px 0 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--primary) 5%, var(--surface-alt)); }
.rcb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .rcb-title { font-weight: 800; font-size: 15px; }
.rcb-tot { display: flex; gap: 8px; } .rcb-chip { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: 4px 12px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border); } .rcb-chip small { font-size: 10.5px; color: var(--text-muted); } .rcb-chip b { font-size: 20px; line-height: 1.2; }
.rcb-list { display: flex; flex-direction: column; gap: 6px; }
.rcb-row { display: grid; grid-template-columns: minmax(120px, 30%) 1fr 54px; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border); }
.rcb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rcb-tag { display: inline-block; margin-inline-start: 6px; padding: 0 7px; border-radius: 99px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.rcb-bar { height: 12px; border-radius: 99px; background: var(--surface-alt); overflow: hidden; } .rcb-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.rcb-n { text-align: center; font-size: 20px; font-weight: 800; color: var(--primary-strong); background: var(--primary-soft); border-radius: 8px; padding: 1px 0; } .rcb-row.zero { opacity: .62; } .rcb-row.zero .rcb-n { color: var(--text-muted); background: var(--surface-alt); } .rcb-row.outside { border-style: dashed; }
.rcb-empty { margin: 4px 0; font-size: 13px; } .rcb-foot { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.ss-rc { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 10px; border-radius: 99px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent); font-size: 12px; } .ss-rc b { font-size: 16px; color: var(--primary-strong); } .ss-rc.zero { background: var(--surface-alt); border-color: var(--border); } .ss-rc.zero b { color: var(--text-muted); }
@media (max-width: 640px) { .rcb-row { grid-template-columns: 1fr 44px; } .rcb-bar { grid-column: 1 / -1; order: 3; } }
