/* ===== لایه‌ی طراحی حرفه‌ای: سایدبار تیره، بنر داشبورد، کارت‌ها (دکمه‌ها در btn-pro.css) ===== */
/* --- سایدبار: پنل تیره با کاشی آیکون --- */
.sidebar {
    --c-side-text: #b9c0dd; --c-ink: #f1f3ff; --c-hover: rgba(255, 255, 255, .07); --c-faint: #7f88ad; --c-line-2: rgba(255, 255, 255, .08); --c-muted: #98a1c6;
    background: radial-gradient(120% 60% at 100% 0%, #2a2470 0%, rgba(42, 36, 112, 0) 55%), linear-gradient(180deg, #141842 0%, #0b0e26 100%);
    color: var(--c-side-text); border-inline-end: 0; box-shadow: 8px 0 30px -18px rgba(8, 10, 40, .8);
}
.sidebar .brand-mark { background: var(--g-brand); box-shadow: 0 8px 20px -6px rgba(124, 58, 237, .7), inset 0 1px 0 rgba(255, 255, 255, .35); color: #fff; }
.sidebar__brand { border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: var(--sp-3); }
.sidebar__brand strong { color: #fff; font-size: 1.05rem; }
.sidebar__brand small { color: #98a1c6; }
.sidebar__section { display: flex; align-items: center; gap: 6px; color: #7f88ad; font-size: .72rem; }
.sidebar__section .icon { opacity: .8; }
.sidebar__group + .sidebar__group { border-top-color: rgba(255, 255, 255, .06); }
.sidebar__link { gap: 12px; min-height: 42px; padding: 5px 8px; border-radius: 12px; color: var(--c-side-text); font-weight: 500; }
.sidebar__ico { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #b9c0dd; transition: background .2s, color .2s, transform .2s; }
.sidebar__ico .icon { opacity: 1; }
.sidebar__link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar__link:hover .sidebar__ico { background: rgba(255, 255, 255, .12); color: #fff; transform: scale(1.06); }
.sidebar__link.is-active { background: linear-gradient(90deg, rgba(124, 92, 255, .32), rgba(124, 92, 255, .08)); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(160, 140, 255, .28); }
.sidebar__link.is-active .sidebar__ico { background: var(--g-brand); color: #fff; box-shadow: 0 6px 14px -5px rgba(124, 58, 237, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.sidebar__link.is-active .icon { color: #fff; }
.sidebar__link.is-active::before { background: #a78bfa; inset-inline-start: -10px; box-shadow: 0 0 12px #a78bfa; }
.sidebar__me { display: flex; align-items: center; gap: 10px; margin: var(--sp-2) 0; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.sidebar__me-t { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.sidebar__me-t strong { color: #fff; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.sidebar__me-t small { color: #98a1c6; font-size: .72rem; }
.sidebar__foot { border-top: 0; padding-top: 0; }
.sidebar__collapse { color: #98a1c6; border-radius: 12px; }
.sidebar__collapse:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .sidebar__close { background: rgba(255, 255, 255, .08); color: #fff; border-color: transparent; }
.sidebar__nav { scrollbar-color: rgba(255, 255, 255, .18) transparent; }
@media (min-width: 901px) {
    .sb-collapsed .sidebar__me { justify-content: center; padding: 6px; }
    .sb-collapsed .sidebar__me-t { display: none; }
    .sb-collapsed .sidebar__section { background: rgba(255, 255, 255, .1); }
    .sb-collapsed .sidebar__link { padding: 5px 0; }
}

/* --- نوار بالا: ظریف‌تر --- */
.topbar { box-shadow: 0 1px 0 var(--c-line), 0 10px 24px -22px rgba(15, 20, 36, .5); }
.topbar__search { border-radius: 999px; }
.topbar__bell, .topbar__theme { border-radius: 50%; background: var(--c-card); border-color: var(--c-line); box-shadow: var(--shadow-xs); }

/* --- کارت‌ها --- */
.card { border: 1px solid color-mix(in srgb, var(--c-line) 70%, transparent); box-shadow: 0 1px 2px rgba(15, 20, 36, .04), 0 18px 34px -26px rgba(15, 20, 36, .28); border-radius: 20px; }
.card__head { border-bottom: 0; padding-bottom: 0; }
.card__head > h2 { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.card__head > h2::before { content: ""; width: 5px; height: 20px; border-radius: 4px; background: var(--g-brand); }

/* --- بنر داشبورد --- */
.hero {
    position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-5);
    padding: var(--sp-6); border-radius: 24px; color: #fff;
    background: radial-gradient(80% 140% at 0% 0%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%), linear-gradient(120deg, #3a2fc4 0%, #6d3be0 55%, #a24df0 100%);
    box-shadow: 0 24px 44px -26px rgba(76, 52, 210, .85);
}
.hero::after { content: ""; position: absolute; inset-inline-end: -60px; inset-block-end: -90px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.hero::before { content: ""; position: absolute; inset-inline-end: 140px; inset-block-start: -70px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.hero__txt { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero__txt h2 { color: #fff; font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.hero__txt p { color: rgba(255, 255, 255, .86); font-size: .92rem; }
.hero__date { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .8rem; font-weight: 700; }
.hero__quick { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__q { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 78px; padding: 10px 8px; border-radius: 16px; color: #fff; font-size: .76rem; font-weight: 700; text-align: center; text-decoration: none; background: rgba(255, 255, 255, .11); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); transition: transform .2s, background .2s; }
.hero__q:hover { background: rgba(255, 255, 255, .22); transform: translateY(-3px); text-decoration: none; color: #fff; }
.hero__q .rbtn { width: 38px; height: 38px; }

/* --- کارت‌های آمار: لوح تمیز با کاشی آیکون گرادیانی --- */
.stat-card, .stat-card--c1, .stat-card--c2, .stat-card--c3, .stat-card--c4, .stat-card--c5, .stat-card--c6, .stat-card--c7, .stat-card--c8, .stat-card--ok, .stat-card--warn, .stat-card--bad {
    background: var(--c-card); border: 1px solid var(--c-line); border-radius: 20px; padding: 18px 20px; gap: 4px;
    box-shadow: 0 1px 2px rgba(15, 20, 36, .04), 0 16px 30px -24px rgba(15, 20, 36, .3);
}
.stat-card::before { display: none; }
.stat-card--x::before { inset-inline: auto; inset-inline-start: 0; inset-block: 22px; width: 4px; height: auto; border-radius: 0 4px 4px 0; background: var(--tone); opacity: 1; }
[dir="rtl"] .stat-card--x::before { border-radius: 4px 0 0 4px; }
.stat-card::after { width: 130px; height: 130px; inset-inline-end: -46px; inset-block-start: -46px; background: radial-gradient(circle, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%); opacity: 1; }
.stat-card__icon { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(150deg, color-mix(in srgb, var(--tone) 85%, #fff), var(--tone)); color: #fff; box-shadow: 0 10px 18px -8px var(--tone), inset 0 1px 0 rgba(255, 255, 255, .4); margin-bottom: 6px; }
.stat-card__icon .icon { color: #fff; }
.stat-card__label { font-size: .8rem; }
.stat-card__value { font-size: 1.7rem; }
a.stat-card--link:hover { border-color: color-mix(in srgb, var(--tone) 45%, var(--c-line)); }

/* --- جدول‌ها --- */
.table thead th { background: color-mix(in srgb, var(--c-primary) 5%, var(--c-card-2)); }
.table-wrap { border-radius: 16px; border: 1px solid var(--c-line); }
@media (max-width: 700px) { .hero { padding: var(--sp-4); } .hero__txt h2 { font-size: 1.25rem; } .hero__q { min-width: 70px; } }

/* ===== سایدبار: گروه‌های بازشونده (آکاردئون) و پاپ‌آپ در حالت جمع‌شده ===== */
.sidebar__group { gap: 0; padding-bottom: 2px; position: relative; }
.sidebar__group + .sidebar__group { border-top: 0; padding-top: 0; }
.sidebar__toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 5px 8px; border-radius: 12px; color: var(--c-side-text); font-size: .9rem; font-weight: 600; cursor: pointer; }
.sidebar__toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar__toggle:focus-visible { outline: 2px solid #a78bfa; outline-offset: 1px; }
.sidebar__toggle .sidebar__label { flex: 1; text-align: start; }
.sidebar__count { flex: 0 0 auto !important; font-size: .68rem; color: #98a1c6; background: rgba(255, 255, 255, .07); border-radius: 999px; padding: 1px 7px; }
.sidebar__chev { flex: 0 0 auto; color: #98a1c6; transition: transform .2s; }
.sidebar__group.is-open > .sidebar__toggle { color: #fff; }
.sidebar__group.is-open > .sidebar__toggle .sidebar__ico { background: rgba(124, 92, 255, .35); color: #fff; }
.sidebar__group.is-open > .sidebar__toggle .sidebar__chev { transform: rotate(180deg); }
.sidebar__sub { display: none; flex-direction: column; gap: 1px; margin: 2px 0 8px; padding-inline-start: 22px; border-inline-start: 1px solid rgba(255, 255, 255, .1); margin-inline-start: 22px; }
.sidebar__group.is-open > .sidebar__sub { display: flex; }
.sidebar__sub .sidebar__link { min-height: 36px; padding: 4px 10px; gap: 10px; font-size: .86rem; border-radius: 10px; }
.sidebar__dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .28); flex: 0 0 auto; }
.sidebar__sub .sidebar__link.is-active .sidebar__dot { background: #c4b5fd; box-shadow: 0 0 8px #a78bfa; }
.sidebar__sub .sidebar__link.is-active::before { display: none; }
.sidebar__pophead { display: none; }
@media (min-width: 901px) {
    .sb-collapsed .sidebar__toggle { justify-content: center; padding-inline: 0; }
    .sb-collapsed .sidebar__group.is-open > .sidebar__sub { display: none; }
    .sb-collapsed .sidebar__group.is-pop > .sidebar__sub { display: flex; position: fixed; z-index: 80; inset-inline-start: calc(var(--side-w-collapsed) + 10px); min-width: 230px; max-height: 70vh; overflow-y: auto; margin: 0; padding: 8px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: #1b1f3a; box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .55); }
    .sb-collapsed .sidebar__group.is-pop > .sidebar__sub .sidebar__label { display: block; }
    .sb-collapsed .sidebar__pophead { display: block; padding: 6px 10px 8px; color: #98a1c6; font-size: .74rem; font-weight: 700; }
    .sb-collapsed .sidebar__sub .sidebar__link { justify-content: flex-start; padding-inline: 10px; }
    .sb-collapsed .sidebar__group.is-pop > .sidebar__toggle { background: rgba(255, 255, 255, .1); color: #fff; }
}

.sidebar__chev { margin-inline-start: auto; }
@media (min-width: 901px) { .sidebar { position: sticky; z-index: 70; } }
.sidebar__toggle .sidebar__chev { flex: 0 0 auto; overflow: visible; }
