/* =====================================================================
   Admin panel design system (Bootstrap 5.3 RTL + custom shell)
   Light and dark themes via [data-bs-theme].
   ===================================================================== */
:root {
    --a-primary: #3b5bdb;
    --a-primary-rgb: 59, 91, 219;
    --a-primary-soft: #eef2ff;
    --a-accent: #f59f00;
    --a-success: #12b886;
    --a-danger: #e03131;
    --a-info: #1c7ed6;

    --a-bg: #f4f6fb;
    --a-surface: #ffffff;
    --a-surface-2: #f8f9fc;
    --a-border: #e6e9f2;
    --a-text: #1e2537;
    --a-muted: #6b7489;
    --a-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04);
    --a-shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
    --a-radius: .9rem;
    --a-radius-sm: .6rem;

    --sb-width: 272px;
    --sb-compact: 78px;
    --sb-bg: linear-gradient(180deg, #111a33 0%, #0c1328 100%);
    --sb-text: #aeb7cf;
    --sb-muted: #6c779a;
    --sb-hover: rgba(255, 255, 255, .06);
    --sb-active: linear-gradient(90deg, rgba(var(--a-primary-rgb), .95), rgba(99, 125, 255, .85));
    --topbar-h: 64px;

    --bs-primary: var(--a-primary);
    --bs-primary-rgb: var(--a-primary-rgb);
    --bs-link-color: var(--a-primary);
    --bs-link-color-rgb: var(--a-primary-rgb);
    --bs-body-font-family: IRANSans, Tahoma, sans-serif;
}

[data-bs-theme=dark] {
    --a-primary-soft: rgba(var(--a-primary-rgb), .18);
    --a-bg: #0e1424;
    --a-surface: #151d31;
    --a-surface-2: #1a233a;
    --a-border: #26304a;
    --a-text: #e3e8f4;
    --a-muted: #8f9bb8;
    --a-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --sb-bg: linear-gradient(180deg, #0a1020 0%, #080d1a 100%);
    --bs-body-bg: var(--a-bg);
    --bs-body-color: var(--a-text);
    --bs-border-color: var(--a-border);
    --bs-tertiary-bg: var(--a-surface-2);
}

html, body {
    font-family: IRANSans, Tahoma, sans-serif;
    background: var(--a-bg);
    color: var(--a-text);
    font-size: .9rem;
}

a { color: var(--a-primary); }
.text-muted { color: var(--a-muted) !important; }
.btn { border-radius: var(--a-radius-sm); font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--a-primary); --bs-btn-border-color: var(--a-primary); --bs-btn-hover-bg: #3050c9; --bs-btn-hover-border-color: #3050c9; --bs-btn-active-bg: #2944b4; }
.btn-outline-primary { --bs-btn-color: var(--a-primary); --bs-btn-border-color: var(--a-primary); --bs-btn-hover-bg: var(--a-primary); --bs-btn-hover-border-color: var(--a-primary); }
.btn-light { --bs-btn-bg: var(--a-surface-2); --bs-btn-border-color: var(--a-border); --bs-btn-color: var(--a-text); --bs-btn-hover-bg: var(--a-border); }
.form-control, .form-select { border-radius: var(--a-radius-sm); border-color: var(--a-border); background-color: var(--a-surface); color: var(--a-text); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--a-primary-rgb), .55); box-shadow: 0 0 0 .2rem rgba(var(--a-primary-rgb), .15); }
.form-check-input:checked { background-color: var(--a-primary); border-color: var(--a-primary); }
.input-group-text { background: var(--a-surface-2); border-color: var(--a-border); color: var(--a-muted); }
.dropdown-menu { border-color: var(--a-border); border-radius: var(--a-radius-sm); padding: .35rem; background: var(--a-surface); }
.dropdown-item { border-radius: .45rem; padding: .45rem .75rem; display: flex; align-items: center; gap: .5rem; color: var(--a-text); }
.dropdown-item i { font-size: 1.1rem; color: var(--a-muted); }
.dropdown-item:hover { background: var(--a-primary-soft); }

.app-loading { min-height: 100vh; display: flex; gap: 1rem; align-items: center; justify-content: center; }

#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; left: .75rem; top: .5rem; }

/* =====================================================================
   Shell: sidebar + main
   ===================================================================== */
.admin-shell { min-height: 100vh; }
.admin-main { margin-inline-start: var(--sb-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin .25s ease; }
.admin-content { padding: 1.5rem; flex: 1; }
.admin-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; color: var(--a-muted); font-size: .78rem; border-top: 1px solid var(--a-border); }

.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sb-width);
    background: var(--sb-bg);
    color: var(--sb-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .25s ease, transform .25s ease;
    box-shadow: -1px 0 0 rgba(255, 255, 255, .04) inset;
}

.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.25rem; text-decoration: none; min-height: var(--topbar-h); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-brand .brand-mark { width: 42px; height: 42px; border-radius: .75rem; background: rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-brand .brand-mark img { width: 34px; }
.sidebar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.4; white-space: nowrap; }
.sidebar-brand strong { color: #fff; font-size: .95rem; }
.sidebar-brand small { color: var(--sb-muted); font-size: .72rem; }

.sidebar-user { display: flex; align-items: center; gap: .7rem; margin: 1rem 1rem .5rem; padding: .7rem; border-radius: var(--a-radius-sm); background: rgba(255, 255, 255, .05); }
.sidebar-user .user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.sidebar-user strong { color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: var(--sb-muted); font-size: .72rem; }

.avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #5c7cfa, #845ef7); text-transform: uppercase; }
.avatar.sm { width: 32px; height: 32px; font-size: .8rem; }

.sidebar-search { position: relative; margin: .5rem 1rem .75rem; }
.sidebar-search i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .75rem; color: var(--sb-muted); }
.sidebar-search input { width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid transparent; color: #fff; border-radius: .6rem; padding: .5rem 2.2rem .5rem .75rem; font-size: .82rem; outline: none; }
.sidebar-search input::placeholder { color: var(--sb-muted); }
.sidebar-search input:focus { border-color: rgba(var(--a-primary-rgb), .7); background: rgba(255, 255, 255, .09); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 .75rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.nav-section-title { color: var(--sb-muted); font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: 1rem .75rem .4rem; white-space: nowrap; }
.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }

.nav-entry {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    padding: .6rem .75rem; margin-bottom: .15rem; border: 0; border-radius: .6rem;
    background: none; color: var(--sb-text); text-decoration: none; font-size: .87rem; text-align: start; white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-entry > i:first-child { font-size: 1.25rem; width: 1.5rem; text-align: center; flex-shrink: 0; }
.nav-entry .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-entry:hover { background: var(--sb-hover); color: #fff; }
.nav-entry.active { background: var(--sb-active); color: #fff; box-shadow: 0 6px 18px rgba(var(--a-primary-rgb), .35); }
.nav-entry .chevron { font-size: 1.1rem; transition: transform .2s; }
.nav-group.open > .nav-entry .chevron { transform: rotate(-90deg); }
.nav-group.has-active > .nav-entry { color: #fff; }
.nav-group.has-active > .nav-entry > i:first-child { color: #91a7ff; }

.nav-group > .nav-sub { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.nav-group.open > .nav-sub { max-height: 480px; }
.nav-sub a { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem .45rem .5rem; margin: .1rem 0; margin-inline-start: 1.6rem; border-radius: .5rem; color: var(--sb-text); text-decoration: none; font-size: .83rem; position: relative; }
.nav-sub a::before { content: ""; position: absolute; inset-inline-start: -.85rem; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .08); }
.nav-sub a i { font-size: 1rem; opacity: .8; }
.nav-sub a:hover { color: #fff; background: var(--sb-hover); }
.nav-sub a.active { color: #fff; background: rgba(var(--a-primary-rgb), .25); }
.nav-sub a.active::before { background: #748ffc; width: 2px; }

.nav-badge { margin-inline-start: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 1rem; background: var(--a-accent); color: #1e1e1e; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-footer a { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: .6rem; color: var(--sb-text); text-decoration: none; white-space: nowrap; }
.sidebar-footer a:hover { background: var(--sb-hover); color: #fff; }
.sidebar-footer i { font-size: 1.2rem; width: 1.5rem; text-align: center; }

/* ----- Compact (icons only); hovering expands it temporarily ----- */
@media (min-width: 992px) {
    .admin-shell.compact .admin-main { margin-inline-start: var(--sb-compact); }
    .admin-shell.compact .sidebar:not(:hover) { width: var(--sb-compact); }
    .admin-shell.compact .sidebar:not(:hover) :is(.brand-text, .user-text, .sidebar-search, .nav-section-title, .label, .chevron, .nav-sub, .sidebar-footer .label) { display: none !important; }
    .admin-shell.compact .sidebar:not(:hover) .nav-entry { justify-content: center; position: relative; }
    .admin-shell.compact .sidebar:not(:hover) .nav-badge { position: absolute; top: .1rem; left: .6rem; min-width: 1.1rem; height: 1.1rem; font-size: .6rem; }
    .admin-shell.compact .sidebar:not(:hover) .sidebar-user { justify-content: center; margin-inline: .6rem; }
    .admin-shell.compact .sidebar:not(:hover) .sidebar-brand { justify-content: center; padding-inline: .5rem; }
    .admin-shell.compact .sidebar:hover { box-shadow: var(--a-shadow-lg); }
}

/* ----- Mobile: off-canvas ----- */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .admin-main { margin-inline-start: 0; }
    .sidebar { transform: translateX(100%); }
    .admin-shell.mobile-open .sidebar { transform: none; box-shadow: var(--a-shadow-lg); }
    .admin-shell.mobile-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 13, 26, .5); z-index: 1035; }
    .admin-content { padding: 1rem; }
}

/* ----- Top bar ----- */
.topbar {
    position: sticky; top: 0; z-index: 1020; height: var(--topbar-h);
    display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
    background: color-mix(in srgb, var(--a-surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--a-border);
}
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: .7rem; border: 1px solid var(--a-border); background: var(--a-surface); color: var(--a-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; transition: background .15s; }
.icon-btn:hover { background: var(--a-surface-2); }
.dot-badge { position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--a-danger); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--a-surface); }
.topbar-crumbs { display: flex; align-items: center; gap: .4rem; color: var(--a-muted); font-size: .85rem; min-width: 0; }
.topbar-crumbs a { color: var(--a-muted); font-size: 1.15rem; display: inline-flex; }
.topbar-crumbs .sep { font-size: .9rem; opacity: .6; }
.topbar-crumbs .current { color: var(--a-text); font-weight: 600; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.quick-create { display: inline-flex; align-items: center; gap: .25rem; padding: .45rem .9rem; }
.user-btn { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--a-border); background: var(--a-surface); color: var(--a-text); border-radius: 2rem; padding: .2rem .35rem .2rem .75rem; }
.notif-menu { width: 300px; padding: 0; overflow: hidden; }
.notif-head { padding: .75rem 1rem; font-weight: 700; border-bottom: 1px solid var(--a-border); }
.notif-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; color: var(--a-text); text-decoration: none; border-bottom: 1px solid var(--a-border); }
.notif-item:hover { background: var(--a-surface-2); }
.notif-icon { width: 36px; height: 36px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.notif-empty { padding: 1.25rem; color: var(--a-muted); text-align: center; }

/* =====================================================================
   Page elements
   ===================================================================== */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.3rem; margin: 0; font-weight: 800; }

.card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius); box-shadow: var(--a-shadow); color: var(--a-text); }
.card-header { background: transparent; font-weight: 700; border-bottom: 1px solid var(--a-border); padding: .9rem 1.1rem; display: flex; align-items: center; gap: .5rem; }
.card-header:first-child { border-radius: var(--a-radius) var(--a-radius) 0 0; }
.card-body { padding: 1.1rem; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--a-text); --bs-table-hover-bg: var(--a-surface-2); margin: 0; }
.table > :not(caption) > * > * { padding: .75rem .85rem; vertical-align: middle; border-color: var(--a-border); }
.table thead th { font-weight: 700; color: var(--a-muted); background: var(--a-surface-2); white-space: nowrap; font-size: .78rem; }
.table .thumb { width: 56px; height: 42px; object-fit: cover; border-radius: .45rem; background: var(--a-surface-2); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; padding: .75rem; background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius); }
.filters .form-control, .filters .form-select { max-width: 240px; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--a-muted); }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: .5rem; opacity: .7; }

.form-label { font-weight: 600; font-size: .83rem; }
.form-text { font-size: .76rem; color: var(--a-muted); }
.required::after { content: " *"; color: var(--a-danger); }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--a-bg) 92%, transparent); backdrop-filter: blur(6px); padding: .85rem 0; z-index: 5; border-top: 1px solid var(--a-border); margin-top: 1rem; }
.ltr { direction: ltr; text-align: left; }
.validation-message { color: var(--a-danger); font-size: .78rem; }
.invalid { border-color: var(--a-danger) !important; }
.badge { font-weight: 600; border-radius: .45rem; }
.pagination { --bs-pagination-border-radius: .5rem; --bs-pagination-active-bg: var(--a-primary); --bs-pagination-active-border-color: var(--a-primary); --bs-pagination-bg: var(--a-surface); --bs-pagination-border-color: var(--a-border); }

/* ---------- Toasts & dialogs ---------- */
.toast-stack { position: fixed; bottom: 1rem; left: 1rem; z-index: 2100; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast-item { background: var(--a-surface); color: var(--a-text); border-radius: .7rem; box-shadow: var(--a-shadow-lg); padding: .8rem 1rem; display: flex; gap: .6rem; align-items: start; border-inline-start: 4px solid var(--a-primary); animation: toast-in .2s ease; }
.toast-item.success { border-color: var(--a-success); }
.toast-item.error { border-color: var(--a-danger); }
.toast-item button { margin-inline-start: auto; background: none; border: 0; color: var(--a-muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop-custom { position: fixed; inset: 0; background: rgba(8, 13, 26, .55); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(2px); }
.modal-panel { background: var(--a-surface); color: var(--a-text); border-radius: 1rem; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--a-shadow-lg); }
.modal-panel.wide { max-width: 1100px; }
.modal-panel header, .modal-panel footer { padding: .9rem 1.25rem; display: flex; align-items: center; gap: .5rem; }
.modal-panel header { border-bottom: 1px solid var(--a-border); }
.modal-panel header h2 { font-size: 1rem; margin: 0; font-weight: 700; }
.modal-panel footer { border-top: 1px solid var(--a-border); justify-content: flex-end; }
.modal-panel .modal-body-scroll { padding: 1rem 1.25rem; overflow-y: auto; }

/* ---------- Media ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.media-tile { position: relative; border: 2px solid transparent; border-radius: .7rem; background: var(--a-surface); overflow: hidden; cursor: pointer; text-align: start; padding: 0; box-shadow: var(--a-shadow); color: var(--a-text); }
.media-tile:hover { border-color: rgba(var(--a-primary-rgb), .35); }
.media-tile.selected { border-color: var(--a-primary); box-shadow: 0 0 0 3px var(--a-primary-soft); }
.media-tile .preview { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: var(--a-surface-2); }
.media-tile .preview img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .preview i { font-size: 2.2rem; color: var(--a-muted); }
.media-tile .name { font-size: .72rem; padding: .4rem .55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile .check { position: absolute; top: .4rem; left: .4rem; background: var(--a-primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.dropzone { border: 2px dashed rgba(var(--a-primary-rgb), .35); border-radius: var(--a-radius); padding: 1.1rem; text-align: center; background: var(--a-primary-soft); position: relative; transition: border-color .15s; }
.dropzone:hover { border-color: var(--a-primary); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.media-field { display: flex; gap: .75rem; align-items: center; }
.media-field .preview { width: 120px; height: 90px; border-radius: .6rem; background: var(--a-surface-2); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--a-border); }
.media-field .preview img { width: 100%; height: 100%; object-fit: cover; }
.gallery-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.gallery-item { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: .7rem; overflow: hidden; }
.gallery-item img, .gallery-item video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--a-surface-2); }
.gallery-item .tools { display: flex; gap: .25rem; padding: .35rem; }

/* ---------- Editor, tags, SEO ---------- */
.ck-editor__editable { min-height: 320px; }
.ck.ck-editor { direction: rtl; }
[data-bs-theme=dark] .ck.ck-editor__main > .ck-editor__editable { background: var(--a-surface-2); color: var(--a-text); }
.tag-input { display: flex; flex-wrap: wrap; gap: .35rem; border: 1px solid var(--a-border); border-radius: var(--a-radius-sm); padding: .35rem; background: var(--a-surface); }
.tag-input input { border: 0; outline: 0; flex: 1; min-width: 120px; background: transparent; color: var(--a-text); }
.tag-input .tag { background: var(--a-primary-soft); color: var(--a-primary); border-radius: 1rem; padding: .1rem .6rem; display: inline-flex; gap: .3rem; align-items: center; }
.tag-input .tag button { border: 0; background: none; color: inherit; padding: 0; line-height: 1; }
.seo-preview { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: .6rem; padding: .8rem 1rem; }
.seo-preview .title { color: #1a0dab; font-size: 1.05rem; }
[data-bs-theme=dark] .seo-preview .title { color: #8ab4f8; }
.seo-preview .url { color: #188038; font-size: .8rem; direction: ltr; text-align: right; }
.seo-preview .desc { color: var(--a-muted); font-size: .82rem; }
.permission-group { border: 1px solid var(--a-border); border-radius: .7rem; padding: .8rem 1rem; background: var(--a-surface); }

/* =====================================================================
   Dashboard
   ===================================================================== */
.welcome {
    position: relative; overflow: hidden; border-radius: 1.1rem; padding: 1.6rem 1.75rem; margin-bottom: 1.5rem; color: #fff;
    background: radial-gradient(1200px 300px at 0% 0%, rgba(132, 94, 247, .55), transparent 60%), linear-gradient(120deg, #3b5bdb 0%, #4c6ef5 45%, #5f3dc4 100%);
    box-shadow: 0 16px 40px rgba(59, 91, 219, .28);
}
.welcome::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; border: 48px solid rgba(255, 255, 255, .07); left: -80px; top: -120px; }
.welcome h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 .35rem; }
.welcome p { margin: 0; opacity: .85; }
.welcome .welcome-date { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255, 255, 255, .14); padding: .3rem .75rem; border-radius: 2rem; font-size: .8rem; margin-bottom: .75rem; }
.welcome .quick-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; position: relative; z-index: 1; }
.welcome .quick-actions a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: .65rem; background: rgba(255, 255, 255, .15); color: #fff; text-decoration: none; font-size: .83rem; backdrop-filter: blur(4px); transition: background .15s; }
.welcome .quick-actions a:hover { background: rgba(255, 255, 255, .26); }

.kpi { display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem; height: 100%; text-decoration: none; color: var(--a-text); transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--a-shadow-lg); color: var(--a-text); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-icon { width: 46px; height: 46px; border-radius: .8rem; display: flex; align-items: center; justify-content: center; font-size: 1.45rem; }
.kpi .kpi-title { color: var(--a-muted); font-size: .8rem; }
.kpi .kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.kpi .kpi-sub { font-size: .75rem; color: var(--a-muted); display: flex; flex-wrap: wrap; gap: .75rem; }
.kpi .kpi-bar { height: 6px; border-radius: 3px; background: var(--a-surface-2); overflow: hidden; }
.kpi .kpi-bar span { display: block; height: 100%; border-radius: 3px; }
.tone-blue { background: #e7edff; color: #3b5bdb; }
.tone-green { background: #e6fcf5; color: #0ca678; }
.tone-orange { background: #fff4e6; color: #f08c00; }
.tone-violet { background: #f3f0ff; color: #7048e8; }
.tone-cyan { background: #e3fafc; color: #1098ad; }
.tone-pink { background: #fff0f6; color: #d6336c; }
.tone-red { background: #fff5f5; color: #e03131; }
.tone-gray { background: #f1f3f5; color: #495057; }
[data-bs-theme=dark] :is(.tone-blue, .tone-green, .tone-orange, .tone-violet, .tone-cyan, .tone-pink, .tone-red, .tone-gray) { background: rgba(255, 255, 255, .06); }
.fill-blue { background: #4c6ef5; } .fill-green { background: #12b886; } .fill-orange { background: #fd7e14; } .fill-violet { background: #7950f2; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .78rem; color: var(--a-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.activity-chart text { fill: var(--a-muted); font-size: 11px; font-family: IRANSans, Tahoma, sans-serif; }
.activity-chart .grid { stroke: var(--a-border); }

.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--a-border); color: var(--a-text); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--a-surface-2); color: var(--a-text); }
.list-row .row-thumb { width: 52px; height: 40px; border-radius: .5rem; object-fit: cover; background: var(--a-surface-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--a-muted); }
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .row-sub { font-size: .75rem; color: var(--a-muted); }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--a-surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; flex-shrink: 0; }
.progress-thin { height: 6px; border-radius: 3px; background: var(--a-surface-2); overflow: hidden; }
.progress-thin span { display: block; height: 100%; border-radius: 3px; background: var(--a-primary); }
.health-row { padding: .75rem 1.1rem; border-bottom: 1px solid var(--a-border); display: block; text-decoration: none; color: var(--a-text); }
.health-row:last-child { border-bottom: 0; }
.health-row:hover { background: var(--a-surface-2); color: var(--a-text); }
.shortcut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1rem .5rem; border-radius: .8rem; border: 1px solid var(--a-border); background: var(--a-surface); color: var(--a-text); text-decoration: none; text-align: center; font-size: .8rem; transition: all .15s; height: 100%; }
.shortcut i { font-size: 1.6rem; color: var(--a-primary); }
.shortcut:hover { border-color: rgba(var(--a-primary-rgb), .4); background: var(--a-primary-soft); color: var(--a-text); transform: translateY(-2px); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(900px 500px at 100% 0%, rgba(132, 94, 247, .45), transparent 60%), linear-gradient(135deg, #0c1328, #3b5bdb); padding: 1rem; }
.login-card { width: 100%; max-width: 420px; background: var(--a-surface); color: var(--a-text); border-radius: 1.2rem; padding: 2rem; box-shadow: var(--a-shadow-lg); }
.login-card .logo { display: block; margin: 0 auto 1rem; height: 56px; }
