/* ============================================================
   Chainix Panel - Main Stylesheet
   طراحی: تیره، شبکه‌محور، با لهجه سیگنال فیروزه‌ای
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    /* پالت رنگ */
    --bg-base: #090d12;
    --bg-elevated: #10161d;
    --bg-card: #131a22;
    --bg-card-hover: #182029;
    --border-subtle: #1e2830;
    --border-strong: #2b3944;

    --accent: #38e0c4;
    --accent-dim: #2ba892;
    --accent-bright: #6bf0da;
    --accent-glow: rgba(56, 224, 196, 0.16);

    --violet: #8b7bf7;
    --violet-glow: rgba(139, 123, 247, 0.15);

    --danger: #f4515f;
    --danger-glow: rgba(244, 81, 95, 0.14);
    --warning: #f5b955;
    --warning-glow: rgba(245, 185, 85, 0.14);

    --text-primary: #eef2f6;
    --text-secondary: #93a2b1;
    --text-muted: #5c6b79;

    --radius-sm: 8px;
    --radius-md: 13px;
    --radius-lg: 18px;
    --radius-xl: 22px;

    --shadow-elevated: 0 12px 36px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.2);
    --transition-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 272px;
    --sidebar-width-mobile: min(300px, 84vw);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.7;
    font-size: 15px;
    overflow-x: hidden;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* پس‌زمینه شبکه‌ای ظریف - سیگنیچر بصری پنل */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 12% 15%, rgba(56, 224, 196, 0.06) 0%, transparent 42%),
        radial-gradient(circle at 88% 85%, rgba(139, 123, 247, 0.05) 0%, transparent 42%),
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: auto, auto, 48px 48px, 48px 48px;
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection {
    background: var(--accent-glow);
    color: var(--text-primary);
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ============================================================
   Layout: Sidebar + Main
   ============================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    z-index: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(4, 6, 9, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 99;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    width: var(--sidebar-width);
    max-width: 86vw;
    background: linear-gradient(180deg, var(--bg-elevated) 0%, #0d1319 100%);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transform: translateX(0);
    transition: transform var(--transition-base);
    will-change: transform;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #06120f;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.sidebar-brand__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-brand__title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-brand__subtitle {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

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

.sidebar-nav__spacer {
    flex: 1;
    min-height: 8px;
}

.sidebar-nav__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 10px 6px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition-base), color var(--transition-base);
    position: relative;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    stroke: currentColor;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}

.nav-item__notify-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-inline-start: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    color: var(--text-muted);
    transition: color var(--transition-base);
    display: flex;
    flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--danger); }

/* ============================================================
   Main content area
   ============================================================ */

.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: 100%;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(9, 13, 18, 0.65);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.topbar-mobile-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: border-color var(--transition-base), background var(--transition-base);
}
.topbar-mobile-toggle:hover { border-color: var(--accent-dim); }

.page-body {
    padding: 28px 32px;
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* ============================================================
   Components: Cards, Buttons, Badges
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 55%, var(--accent-dim) 100%);
    color: #06120f;
}
.btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent-dim); }

.btn-danger-ghost {
    background: transparent;
    color: var(--danger);
    border-color: transparent;
}
.btn-danger-ghost:hover { background: var(--danger-glow); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-online {
    background: rgba(56, 224, 196, 0.12);
    color: var(--accent);
}
.badge-online .badge-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    animation: pulse-dot 2s infinite;
}

.badge-offline {
    background: var(--danger-glow);
    color: var(--danger);
}
.badge-offline .badge-dot { background: var(--danger); }

.badge-unknown {
    background: rgba(147, 162, 177, 0.12);
    color: var(--text-secondary);
}
.badge-unknown .badge-dot { background: var(--text-muted); }

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px var(--accent-glow); }
    50% { box-shadow: 0 0 0 6px transparent; }
}

/* ============================================================
   Forms
   ============================================================ */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
    padding: 14px 18px;
    font-size: 12px;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition-base); }
tbody tr:hover { background: var(--bg-card-hover); }

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 52px;
    height: 52px;
    stroke: var(--border-strong);
    margin-bottom: 16px;
}

.empty-state__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ============================================================
   Panel Picker (used in API Tokens page)
   ============================================================ */

.panel-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.panel-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
    min-width: 0;
}

.panel-picker-item:hover {
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.panel-picker-item.active {
    border-color: var(--accent-dim);
    background: var(--accent-glow);
}

.panel-picker-item__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.panel-picker-item__icon svg { width: 18px; height: 18px; }

.panel-picker-item__body {
    min-width: 0;
    flex: 1;
}

.panel-picker-item__name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-picker-item__meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.token-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    transition: border-color var(--transition-base);
    max-width: 100%;
    overflow: hidden;
}
.token-card:hover { border-color: var(--border-strong); }

.token-card > div:first-child {
    min-width: 0;
    flex: 1;
}

.token-card__name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.token-card__desc-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
}

.token-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: anywhere;
    min-width: 0;
    flex: 1;
    font-family: 'Vazirmatn', 'Tahoma', monospace;
}

.token-copy-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}
.token-copy-btn svg { width: 15px; height: 15px; }
.token-copy-btn:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--accent-glow);
}
.token-copy-btn.copied {
    color: var(--accent);
    border-color: var(--accent-dim);
}

.token-card__meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 8px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.user-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: border-color var(--transition-base), transform var(--transition-base);
    max-width: 100%;
    overflow: hidden;
}
.user-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.user-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.user-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-glow);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.user-card__identity {
    min-width: 0;
    flex: 1;
}

.user-card__name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card__username {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.user-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
}

.user-card__row-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.user-card__row-value {
    color: var(--text-secondary);
    font-family: 'Vazirmatn', 'Tahoma', monospace;
    word-break: break-all;
    overflow-wrap: anywhere;
    text-align: left;
    min-width: 0;
}

.user-card__wallet {
    font-weight: 700;
    color: var(--accent);
}

.user-card__notes {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.user-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.user-card__date {
    font-size: 11px;
    color: var(--text-muted);
}

.stack-gap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 11, 0.72);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-elevated);
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.modal-close:hover { color: var(--danger); }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   Alerts / Toasts
   ============================================================ */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--danger-glow);
    color: #ff8a93;
    border-color: rgba(244, 81, 95, 0.3);
}

.alert-success {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(56, 224, 196, 0.3);
}

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 48px);
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13.5px;
    box-shadow: var(--shadow-elevated);
    min-width: 260px;
    max-width: 100%;
    animation: toast-in 220ms ease-out;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-success { border-right: 3px solid var(--accent); }
.toast-error { border-right: 3px solid var(--danger); }

/* ============================================================
   Login Page
   ============================================================ */

.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-elevated);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}

.login-brand__mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #06120f;
    font-size: 24px;
    box-shadow: 0 0 0 6px var(--accent-glow);
}

.login-brand__title {
    font-size: 20px;
    font-weight: 700;
}

.login-brand__subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

/* ============================================================
   Utility classes
   ============================================================ */

.d-flex { display: flex; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.page-header__desc {
    font-size: 13.5px;
    color: var(--text-muted);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
    .sidebar {
        width: var(--sidebar-width-mobile);
        transform: translateX(100%);
        box-shadow: var(--shadow-elevated);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    .topbar-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 600px) {
    .page-body { padding: 18px 16px; }
    .topbar { padding: 14px 16px; }
    .login-card { padding: 30px 22px; }
    thead th, tbody td { padding: 12px 14px; }
    .toast-container { left: 12px; bottom: 12px; }
    .panel-picker { grid-template-columns: 1fr; }
    .token-card { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   Panel Usage Page (مشاهده مصرف پنل‌ها)
   ============================================================ */

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.usage-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: border-color var(--transition-base), transform var(--transition-base);
}
.usage-card:hover {
    border-color: var(--border-strong);
}

.usage-card:has(.usage-card__lock-banner) {
    border-color: #dc2626;
}

.usage-card__lock-banner {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: var(--radius-sm, 6px);
    padding: 6px 10px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    cursor: help;
}

.usage-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.usage-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--violet-glow);
    color: var(--violet);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.usage-card__identity {
    min-width: 0;
    flex: 1;
}

.usage-card__name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usage-card__owner {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usage-card__wallet {
    text-align: left;
    flex-shrink: 0;
}

.usage-card__wallet-label {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.usage-card__wallet-value {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.usage-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.usage-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    text-align: center;
}

.usage-stat__label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
}

.usage-stat__value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.usage-stat--accent .usage-stat__value { color: var(--accent); }
.usage-stat--violet .usage-stat__value { color: var(--violet); }

.usage-card__chart {
    height: 64px;
    margin-bottom: 12px;
}

.usage-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-muted);
}

.usage-card__footer .btn {
    padding: 5px 12px;
    font-size: 11.5px;
}

.usage-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.usage-summary__box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.usage-summary__label {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.usage-summary__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.usage-summary__box--accent .usage-summary__value { color: var(--accent); }
.usage-summary__box--violet .usage-summary__value { color: var(--violet); }
.usage-summary__box--danger .usage-summary__value { color: var(--danger); }
.usage-summary__box--warning .usage-summary__value { color: var(--warning); }

/* ---------------------------------------------------
   داشبورد
--------------------------------------------------- */
.dash-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--danger-glow);
    border: 1px solid rgba(244, 81, 95, 0.35);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-primary);
}
.dash-alert svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--danger); }
.dash-alert__link { color: var(--danger); font-weight: 700; text-decoration: none; margin-inline-start: auto; white-space: nowrap; }
.dash-alert__link:hover { text-decoration: underline; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.dash-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.dash-card__title svg { width: 19px; height: 19px; color: var(--accent); }

.dash-stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}
.dash-stat-row:last-child { border-bottom: none; }
.dash-stat-row__label { color: var(--text-secondary); }
.dash-stat-row__value { font-weight: 700; color: var(--text-primary); }
.dash-stat-row__value--danger { color: var(--danger); }
.dash-stat-row__value--accent { color: var(--accent); }
.dash-stat-row__value--warning { color: var(--warning); }

.dash-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.dash-log-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
}
.dash-log-item:last-child { border-bottom: none; }
.dash-log-item__top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.dash-log-item__message { color: var(--text-primary); line-height: 1.6; }
.dash-log-item__meta { color: var(--text-muted); font-size: 11px; margin-top: 3px; }

@media (max-width: 700px) {
    .usage-summary { grid-template-columns: repeat(2, 1fr); }
    .usage-stats { grid-template-columns: repeat(2, 1fr); }
}

