@import url('https://cdn.jsdelivr.net/gh/rastikerdar/sahel-font@v3.4.0/dist/font-face.css');

:root {
    --bg: #060607;
    --bg-soft: #0d0d10;
    --card: #131316;
    --card-hover: #17171b;
    --card-2: #17171b;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.16);
    --red: #6B6690;
    --red-2: #8B85B0;
    --red-glow: rgba(107,102,144,0.55);
    --red-soft: rgba(107,102,144,0.12);
    --text: #F2F2F3;
    --text-dim: #9a9aa3;
    --text-mute: #63636b;
    --success: #22c37c;
    --success-glow: rgba(34,195,124,.35);
    --success-soft: rgba(34,195,124,.12);
    --warning: #e0a23a;
    --warning-soft: rgba(224,162,58,.12);
    --gold: #e0a84e;
    --teal: #2dd4bf;
    --radius: 20px;
    --radius-sm: 13px;
    --ease: cubic-bezier(.16,.84,.44,1);
    --shadow-ambient: 0 30px 60px -30px rgba(0,0,0,.6);
    --shadow-contact: 0 1px 0 rgba(255,255,255,.04) inset;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100vw; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
    /* استثنا: انیمیشن پازلِ ورود، چون یه‌بار و کوتاهه (نه پیوسته/آزاردهنده)،
       عمداً از این محدودیت مستثنا شده که روی گوشی‌هایی با «کاهش حرکت» روشن هم
       واقعاً دیده بشه، نه اینکه در ۰.۰۰۱ میلی‌ثانیه نامرئی تموم بشه. */
    .puzzle-tile { animation-duration: 0.5s !important; }
    .auth-card { animation-duration: 0.6s !important; }
}

@keyframes meshDrift {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(3%,-4%) scale(1.06); }
    66% { transform: translate(-3%,3%) scale(0.97); }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Sahel', 'Vazirmatn', -apple-system, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* هاله‌ی گرادیانت متحرک پس‌زمینه — خیلی آروم و ظریف، فقط یه حس زندگی به تم تیره میده */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(650px circle at 15% 8%, rgba(107,102,144,0.16), transparent 60%),
        radial-gradient(550px circle at 90% 18%, rgba(45,212,191,0.05), transparent 55%),
        radial-gradient(700px circle at 50% 100%, rgba(107,102,144,0.12), transparent 60%);
    animation: meshDrift 26s ease-in-out infinite;
}
.dash-shell, .auth-shell { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============ صفحه‌ی ورود — مطابق طرح مرجع: نقطه‌چین ساده + کارت تخت ============ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow-x: hidden;
    background: #0d0d10;
    padding: 60px 16px;
}
/* گرید نقطه‌چین ساده و ثابت (بدون انیمیشن پرزرق‌وبرق) */
.auth-shell::before{
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}
.auth-shell::after{ display: none; }
.auth-glow { display: none; }
.auth-glow-line { display: none; }
.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
    text-align: right;
    background: var(--card, #131316);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.5);
}
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 28px;
    color: var(--text-dim);
    font-size: .8rem;
    letter-spacing: .5px;
}
.auth-brand .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--red);
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}
.auth-title .accent { color: var(--red); }
.auth-sub {
    color: var(--text-dim);
    font-size: .85rem;
    margin-bottom: 28px;
    line-height: 1.8;
}
.auth-field-wrap{ position: relative; margin-bottom: 0; }
.auth-field-icon{
    position: absolute; top: 50%; right: 16px; transform: translateY(-50%);
    color: var(--text-mute); font-size: 1rem; pointer-events: none;
}
/* نوار پیشرفتِ آبی زیر فیلد کد — با هر کاراکتری که تایپ می‌شه، یه بخشِ کوچیک
   روشن و به قبلی «متصل» می‌شه (دقیقاً حسِ تیکه‌هایی که آبی می‌شن و بهم می‌چسبن) */
.code-progress{
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    margin: 8px 0 16px;
    overflow: hidden;
    position: relative;
}
.code-progress-fill{
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--red), var(--red-2));
    box-shadow: 0 0 10px 1px var(--red-glow);
    transition: width .18s cubic-bezier(.2,1,.4,1);
    border-radius: 4px;
}
.auth-field {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 44px 14px 16px;
    border-radius: 10px;
    font-size: .95rem;
    text-align: right;
    letter-spacing: .5px;
    font-family: inherit;
    margin-bottom: 0;
    transition: border-color .2s;
}
.auth-field:focus {
    outline: none;
    border-color: var(--text-dim);
    background: rgba(255,255,255,0.05);
}
.auth-field::placeholder { color: var(--text-mute); letter-spacing: normal; }

.auth-btn {
    width: 100%;
    background: #fff;
    color: #060607;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    margin-top: 6px;
    transition: transform .15s, opacity .15s;
}
.auth-btn:hover { opacity: .9; }
.auth-btn:active { transform: scale(.98); }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.auth-alert {
    background: rgba(107,102,144,0.1);
    border: 1px solid rgba(107,102,144,0.3);
    color: #B0ACC8;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    margin-bottom: 20px;
    text-align: right;
}
.auth-alert.ok {
    background: rgba(47,174,102,0.1);
    border-color: rgba(47,174,102,0.3);
    color: #6fe0a0;
}
.auth-footnote {
    margin-top: 26px;
    color: var(--text-mute);
    font-size: .78rem;
}
.otp-digits {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
    direction: ltr;
}
.otp-digits input {
    width: 46px;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}
.otp-digits input:focus {
    outline: none;
    border-color: var(--red);
    background: rgba(107,102,144,0.06);
}

/* ============ چیدمان داشبورد ============ */
.dash-shell { display: flex; min-height: 100vh; position: relative; overflow: hidden; }
.dash-shell::before, .dash-shell::after{
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: .3;
    z-index: 0;
}
.dash-shell::before{
    width: 500px; height: 500px;
    top: -150px; left: -120px;
    background: radial-gradient(circle, rgba(107,102,144,0.5) 0%, transparent 70%);
    animation: authFloat1 18s ease-in-out infinite;
}
.dash-shell::after{
    width: 460px; height: 460px;
    bottom: -160px; right: -110px;
    background: radial-gradient(circle, rgba(90,190,190,0.35) 0%, transparent 70%);
    animation: authFloat2 22s ease-in-out infinite;
}
.dash-shell .sidebar, .dash-shell .main-area{ position: relative; z-index: 1; }
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px 28px;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: -.01em;
}
.sidebar-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red-glow); }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: .88rem;
    font-weight: 500;
    margin-bottom: 3px;
    cursor: pointer;
    position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: var(--red-soft); color: var(--red); font-weight: 700; }
.nav-item.active::before {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--red);
    border-radius: 3px 0 0 3px;
    box-shadow: 0 0 10px var(--red-glow);
}
.nav-footer {
    position: absolute;
    bottom: 20px;
    width: calc(240px - 32px);
}
.logout-link {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--text-mute);
    font-size: .8rem;
    border-radius: var(--radius-sm);
}
.logout-link:hover { background: rgba(255,255,255,0.03); color: var(--text-dim); }

.main-area { flex: 1; padding: 28px 34px; max-width: 100%; overflow-x: hidden; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title { font-size: 1.4rem; font-weight: 700; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.select-pill, .btn-pill {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: .82rem;
    cursor: pointer;
    font-family: inherit;
}
.btn-pill.primary { background: var(--red-soft); color: var(--red); border-color: rgba(107,102,144,0.3); font-weight: 600; }
.btn-pill:hover { background: var(--card-hover); }

/* ============ کارت‌ها (شیشه‌ای، با عمق نرم) ============ */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-ambient), var(--shadow-contact);
    position: relative;
}
.card-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
.metric-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-ambient), var(--shadow-contact);
    position: relative;
    overflow: hidden;
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    opacity: .55;
}
.metric-label { color: var(--text-mute); font-size: .78rem; margin-bottom: 10px; }
.metric-value { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; letter-spacing: -.02em; }
.metric-value .unit { font-size: .8rem; color: var(--text-dim); font-weight: 500; margin-left: 4px; }
.metric-sub { color: var(--text-mute); font-size: .74rem; margin-top: 6px; }

.chart-wrap { position: relative; height: 260px; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-badge {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 800;
    flex-shrink: 0;
}
.rank-badge.gold { background: rgba(224,168,78,0.18); color: var(--gold); }
.rank-badge.mid { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.rank-badge.low { background: rgba(255,255,255,0.04); color: var(--text-mute); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { color: var(--text-mute); font-size: .74rem; margin-top: 2px; }
.rank-value { text-align: left; direction: ltr; font-weight: 700; font-size: .88rem; flex-shrink: 0; }
.rank-value .pct { display: block; font-size: .7rem; color: var(--text-mute); font-weight: 500; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.badge-flag {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px; border-radius: 999px; font-size: .68rem; color: var(--text-dim);
}

.mobile-tabbar { display: none; }
@media (max-width: 980px) {
    .sidebar { display: none; }
    .metric-row { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .main-area { padding: 16px; padding-bottom: 88px; }
    .action-grid { grid-template-columns: repeat(2, 1fr) !important; }

    .mobile-tabbar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: rgba(10,10,14,0.92);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        z-index: 50;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        overflow: hidden;
    }
    .mtab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 2px;
        color: var(--text-mute, #8a8894);
        font-size: .68rem;
        border-radius: 10px;
        position: relative;
        z-index: 2;
    }
    .mtab-icon { font-size: 1.15rem; line-height: 1; }
    .mtab.active { color: #B0ACC8; }
    .limelight{
        position: absolute;
        top: 0;
        width: 38px; height: 3px;
        border-radius: 999px;
        background: var(--red, #A0A0F0);
        box-shadow: 0 0 10px 2px var(--red-glow, rgba(107,102,144,.7));
        opacity: 0;
        transition: left .4s cubic-bezier(.22,1,.36,1), opacity .3s ease;
        z-index: 1;
        pointer-events: none;
    }
    .limelight-cone{
        position: absolute;
        top: 3px; left: 50%;
        width: 90px; height: 56px;
        margin-left: -45px;
        background: linear-gradient(to bottom, rgba(107,102,144,.22), transparent 80%);
        clip-path: polygon(35% 0, 65% 0, 100% 100%, 0% 100%);
    }
}

/* ============ موشن گرافیک ============ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px var(--red-glow); opacity: 1; }
    50% { box-shadow: 0 0 18px var(--red-glow); opacity: .75; }
}
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.brand-dot, .sidebar-brand .dot, .auth-brand .dot {
    animation: pulseGlow 2.4s ease-in-out infinite;
}

.main-area > * { animation: fadeSlideUp .5s var(--ease) backwards; }
.main-area > *:nth-child(1) { animation-delay: 0s; }
.main-area > *:nth-child(2) { animation-delay: .06s; }
.main-area > *:nth-child(3) { animation-delay: .12s; }
.main-area > *:nth-child(4) { animation-delay: .18s; }
.main-area > *:nth-child(5) { animation-delay: .24s; }

.metric-row .metric-card,
.rank-item,
.card {
    animation: fadeSlideUp .45s var(--ease) backwards;
}
.metric-row .metric-card:nth-child(1) { animation-delay: .05s; }
.metric-row .metric-card:nth-child(2) { animation-delay: .1s; }
.metric-row .metric-card:nth-child(3) { animation-delay: .15s; }
.metric-row .metric-card:nth-child(4) { animation-delay: .2s; }
.metric-row .metric-card:nth-child(5) { animation-delay: .25s; }

.rank-item { animation-delay: calc(var(--i, 0) * 60ms); }

.card, .metric-card, .rank-item {
    transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.card:hover, .metric-card:hover { border-color: rgba(255,255,255,0.14); }
.rank-item:hover { background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); }

.nav-item { transition: background .18s var(--ease), color .18s var(--ease), padding-right .18s var(--ease); }
.nav-item:hover { padding-right: 18px; }

.btn-pill, .btn-pill.primary, .auth-btn, .btn-danger, .btn-outline {
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn-pill:active, .auth-btn:active { transform: scale(.96); }

.auth-card { animation: fadeSlideUp .6s var(--ease); position: relative; }

/* شبکه‌ی واقعیِ تکه‌های پازل — روی خودِ فرم می‌شینه و تکه‌به‌تکه (با تأخیر
   پلکانی و کمی تصادفی) کنار می‌ره تا فرمِ زیرش آشکار بشه؛ دقیقاً همون جلوه‌ای
   که توی نمونه دیدیم، نه صرفاً «عناصر پرت‌شده». */
.puzzle-overlay{
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
    border-radius: 18px;
    overflow: hidden;
    pointer-events: none;
}
.puzzle-tile{
    background: var(--card, #131316);
    border: 1px solid rgba(255,255,255,0.05);
    /* یه بریدگیِ ساده شبیه دندانه‌ی تکه‌ی پازل (بدون پیچیدگیِ کامل SVG) */
    clip-path: polygon(
        0 0, 40% 0, 40% 12%, 60% 12%, 60% 0, 100% 0,
        100% 40%, 88% 40%, 88% 60%, 100% 60%, 100% 100%,
        60% 100%, 60% 88%, 40% 88%, 40% 100%, 0 100%,
        0 60%, 12% 60%, 12% 40%, 0 40%
    );
    animation: puzzleAway .5s cubic-bezier(.5,0,.75,0) forwards;
    animation-delay: var(--pd, 0s);
}
@keyframes puzzleAway{
    0%{ opacity: 1; transform: scale(1) rotate(0deg); }
    100%{ opacity: 0; transform: scale(.4) rotate(var(--pr, 25deg)); }
}

.metric-value { transition: color .3s; }

/* اسکلتون بارگذاری (برای درخواست‌های Ajax آینده) */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.07) 37%, rgba(255,255,255,.03) 63%);
    background-size: 400px 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 8px;
}

/* ============ عناصر مشترک صفحات مدیریتی جدید ============ */
.btn-danger {
    background: rgba(107,102,144,0.12);
    color: #B0ACC8;
    border: 1px solid rgba(107,102,144,0.3);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
}
.btn-danger:hover { background: rgba(107,102,144,0.2); }

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
}
.btn-outline:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.search-row { display: flex; gap: 10px; margin-bottom: 20px; }
.search-row .auth-field { margin-bottom: 0; text-align: right; letter-spacing: normal; }

.user-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}
.user-id-big { font-size: 1.3rem; font-weight: 800; direction: ltr; text-align: right; }
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px; border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.status-pill.free { background: rgba(47,174,102,0.15); color: var(--success); }
.status-pill.banned { background: rgba(107,102,144,0.15); color: #B0ACC8; }

.service-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 4px; border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: none; }
.service-row .s-name { font-weight: 700; font-size: .88rem; }
.service-row .s-sub { color: var(--text-mute); font-size: .74rem; margin-top: 2px; }
.service-row .s-actions { display: flex; gap: 6px; }
.icon-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 32px; height: 32px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .85rem;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.icon-btn.danger { color: #B0ACC8; border-color: rgba(107,102,144,0.25); }

/* شبیه‌سازی همون الگوی «رتبه‌بندی» توی بخش ترافیک: ردیف‌های افقی، هرکدوم کاملاً جدا از هم */
.service-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.service-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.service-card:hover { border-color: rgba(107,102,144,0.4); transform: translateX(-4px); background: rgba(107,102,144,0.04); }

.service-card .s-id-badge {
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-weight: 800;
    font-size: .78rem;
    padding: 6px 12px;
    border-radius: 999px;
    direction: ltr;
}
.service-card .s-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    min-width: 0;
}
.service-card .s-name-block { min-width: 110px; }
.service-card .s-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-card .s-name-sub { color: var(--text-mute); font-size: .72rem; margin-top: 1px; }
.service-card .s-tag {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-dim); font-size: .8rem;
    background: rgba(255,255,255,0.03);
    padding: 5px 11px; border-radius: 8px;
}
.service-card .s-cta {
    flex-shrink: 0;
    color: var(--red);
    font-weight: 700;
    font-size: .82rem;
    display: flex; align-items: center; gap: 4px;
}

@media (max-width: 700px) {
    .service-card { flex-wrap: wrap; }
    .service-card .s-main { gap: 10px; }
}

/* ============ دکمه‌های عملیاتی (صفحه‌ی جزئیات سرویس) — طراحی جدید، آیکون‌محور و رنگی ============ */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-grid form { display: contents; }
.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.025);
    color: var(--text);
    font-family: inherit;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    text-align: right;
    width: 100%;
    transition: transform .15s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.action-btn:hover { transform: translateY(-2px); }
.action-btn:active { transform: translateY(0) scale(.98); }
.action-icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}
.action-btn .action-sub { display:block; color: var(--text-mute); font-size: .72rem; font-weight: 500; margin-top: 2px; }

.action-btn.neutral .action-icon { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.action-btn.neutral:hover { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }

.action-btn.brand .action-icon { background: var(--red-soft); color: var(--red); }
.action-btn.brand:hover { border-color: rgba(107,102,144,0.4); box-shadow: 0 10px 24px -14px var(--red-glow); }

.action-btn.warn .action-icon { background: rgba(217,154,43,0.15); color: var(--warning); }
.action-btn.warn:hover { border-color: rgba(217,154,43,0.4); }

.action-btn.danger .action-icon { background: rgba(107,102,144,0.15); color: #B0ACC8; }
.action-btn.danger:hover { border-color: rgba(107,102,144,0.45); box-shadow: 0 10px 24px -14px var(--red-glow); }

.action-btn.full { grid-column: 1 / -1; }

@media (max-width: 700px) {
    .action-grid { grid-template-columns: 1fr; }
}

/* ============ جدول‌های آمار دوره‌ای (بخش مالی) — مرتب، تفکیک‌شده، خوانا ============ */
.finance-card { margin-bottom: 16px; }
.finance-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.finance-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.finance-icon.sales { background: rgba(224,168,78,0.15); color: var(--gold); }
.finance-icon.income { background: var(--red-soft); color: var(--red); }
.finance-icon.accepted { background: rgba(47,174,102,0.15); color: var(--success); }
.finance-icon.users { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.finance-title { font-weight: 800; font-size: .95rem; }
.finance-sub { color: var(--text-mute); font-size: .74rem; margin-top: 1px; }

.stat-table { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stat-cell {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}
.stat-cell .st-label { color: var(--text-mute); font-size: .68rem; margin-bottom: 8px; display:block; }
.stat-cell .st-value { font-weight: 800; font-size: .95rem; direction: ltr; display:block; font-variant-numeric: tabular-nums; }
.stat-cell.highlight { border-color: rgba(107,102,144,0.3); background: var(--red-soft); }
.stat-cell.highlight .st-value { color: var(--red); }

@media (max-width: 900px) {
    .stat-table { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .stat-table { grid-template-columns: repeat(2, 1fr); }
}

.overview-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
@media (max-width: 900px) { .overview-strip { grid-template-columns: repeat(2, 1fr); } }

.reset-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ نشانگر روند (صعودی/نزولی) — برای مقایسه‌ی درآمد با بازه‌های قبلی ============ */
.trend-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}
.trend-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}
.trend-card .tr-label { color: var(--text-mute); font-size: .76rem; margin-bottom: 8px; }
.trend-card .tr-value { font-size: 1.1rem; font-weight: 800; direction: ltr; text-align: right; margin-bottom: 6px; }
.trend-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .76rem; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
}
.trend-badge.up { background: var(--success-soft); color: var(--success); }
.trend-badge.down { background: var(--red-soft); color: var(--red-2); }
.trend-badge.flat { background: rgba(255,255,255,0.05); color: var(--text-mute); }

@media (max-width: 700px) {
    .trend-row { grid-template-columns: 1fr; }
}

/* درخشش عبوری روی دکمه‌های اصلی (brand) موقع هاور — یه لمس ظریف مدرن */
.action-btn.brand, .btn-pill.primary, .auth-btn {
    position: relative;
    overflow: hidden;
}
.action-btn.brand::after, .btn-pill.primary::after, .auth-btn::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: -60%;
    width: 40%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.12), transparent);
    transform: skewX(-20deg);
    transition: left .6s var(--ease);
}
.action-btn.brand:hover::after, .btn-pill.primary:hover::after, .auth-btn:hover::after { left: 130%; }

/* ============ دکمه‌های انتخاب بازه‌ی زمانی نمودار (۱ روز تا ۶ ماه) ============ */
.period-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.period-pill {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.period-pill:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.period-pill.active {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(34,195,124,0.35);
    font-weight: 700;
}

@media (max-width: 700px) {
    .period-pills { width: 100%; }
    .period-pill { flex: 1; text-align: center; padding: 6px 4px; }
}
