/* ═══════════════════════════════════════════════════════════════
   NaYaNa Panel — Professional Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
    --sidebar-w: 218px;
    --topbar-h: 50px;
    --font: 'Vazirmatn', system-ui, sans-serif;

    /* Palette — higher contrast, less flat white */
    --bg: #dfe4ef;
    --bg-subtle: #e8edf5;
    --surface: #f8fafc;
    --surface-raised: #ffffff;
    --surface-muted: #eef2f9;
    --border: #c5cfe0;
    --border-strong: #a8b4c8;

    --text: #111827;
    --text-secondary: #4b5563;
    --muted: #6b7280;
    --muted-light: #9ca3af;

    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: rgba(79, 70, 229, 0.08);
    --accent-glow: rgba(79, 70, 229, 0.25);

    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --info: #0284c7;
    --info-soft: #f0f9ff;

    --sidebar-bg: #0b0f19;
    --sidebar-surface: #121826;
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f1f5f9;
    --sidebar-accent: #6366f1;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.07);
    --shadow: 0 2px 6px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.08), 0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 10px 36px rgba(15, 23, 42, 0.14);

    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.45;
}

/* ─── Layout Shell ─── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-area {
    flex: 1;
    margin-right: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 80% 50% at 100% -20%, rgba(99, 102, 241, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(6, 182, 212, 0.07), transparent),
        var(--bg);
}

.main-content {
    flex: 1;
    padding: 0.75rem 0.9rem 1.15rem;
    max-width: none;
    width: 100%;
}

.app-footer,
.guest-footer,
.portal-footer,
.error-page-foot {
    padding: 0.875rem 1.5rem 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.panel-footer-text {
    display: block;
}

.panel-footer-version {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    opacity: 0.85;
}

.guest-footer {
    margin-top: auto;
}

.portal-footer {
    background: var(--surface);
}

.branding-preview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.branding-preview-brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.branding-preview-brand span {
    font-size: 0.8125rem;
    color: var(--muted);
}

.branding-preview-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    transition: transform var(--transition);
    border-left: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    padding: 1.35rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #3730a3 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.sidebar-brand-icon svg { width: 22px; height: 22px; color: #fff; }

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.0625rem;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.nav-group { margin-bottom: 1.5rem; }

.nav-group-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
    padding: 0 0.875rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-surface);
    color: var(--sidebar-text-active);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--sidebar-accent);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(99, 102, 241, 0.2);
    pointer-events: none;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
}

.nav-link.active svg { opacity: 1; color: #a5b4fc; }

.nav-link.sub {
    padding-right: 2.25rem;
    font-size: 0.78125rem;
    font-weight: 400;
}

.nav-link.danger { color: #f87171; }
.nav-link.danger:hover { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.nav-link.danger.active {
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
    box-shadow: inset 3px 0 0 #ef4444;
}

.sidebar-footer {
    padding: 1rem 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--sidebar-surface);
    border: 1px solid var(--sidebar-border);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

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

.sidebar-user-info strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    font-size: 0.6875rem;
    color: #64748b;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 45;
}

/* ─── Topbar ─── */
.topbar {
    height: var(--topbar-h);
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.85rem;
    position: sticky;
    top: 0;
    z-index: 40;
    gap: 0.75rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.topbar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.topbar-breadcrumb {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topbar-ovpn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.topbar-conn-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.topbar-conn-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.topbar-conn-btn:hover {
    background: var(--surface-2, #f1f5f9);
    border-color: var(--accent);
    color: var(--accent);
}

.topbar-conn-ovpn svg { color: var(--success, #16a34a); }
.topbar-conn-l2tp svg { color: var(--accent, #2563eb); }
.topbar-conn-telegram svg { color: #229ED9; }

.telegram-bot-modal-card {
    max-width: 460px;
    width: calc(100% - 2rem);
}

.telegram-bot-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.telegram-bot-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    background: rgba(34, 158, 217, 0.12);
    color: #229ED9;
    border: 1px solid rgba(34, 158, 217, 0.25);
}

.telegram-bot-address {
    font-size: 0.95rem;
    font-weight: 700;
    color: #229ED9;
    text-decoration: none;
}

.telegram-bot-address:hover {
    text-decoration: underline;
}

.telegram-bot-address-muted {
    color: var(--muted);
    font-weight: 600;
}

.telegram-connect-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    text-align: center;
    background: #229ED9;
    border-color: #229ED9;
}

.telegram-connect-btn:hover {
    background: #1a8bc4;
    border-color: #1a8bc4;
    color: #fff;
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.55rem 1rem;
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
    font-size: 0.8125rem;
}

.impersonation-leave-form {
    margin: 0;
}

.reseller-row-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.reseller-row-icons-divider {
    display: inline-block;
    width: 1px;
    height: 1.25rem;
    background: var(--border-strong);
    margin: 0 0.1rem;
    flex-shrink: 0;
}

.reseller-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--muted);
}

.reseller-status-icon-telegram.is-linked {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.4);
    background: rgba(22, 163, 74, 0.12);
}

.reseller-status-icon-telegram.is-unlinked {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.1);
}

.reseller-enter-form {
    display: inline-flex;
    margin: 0;
}

.reseller-status-icon-enter {
    cursor: pointer;
    padding: 0;
    font: inherit;
    color: var(--accent);
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.08);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.reseller-status-icon-enter:hover {
    background: rgba(37, 99, 235, 0.16);
    border-color: var(--accent);
    color: #1d4ed8;
}

.l2tp-info-modal-card {
    max-width: 460px;
    width: calc(100% - 2rem);
}

.l2tp-info-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.l2tp-info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.75rem;
    align-items: start;
}

.l2tp-info-row dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    padding-top: 0.35rem;
}

.l2tp-info-row dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.l2tp-info-value {
    display: inline-block;
    padding: 0.35rem 0.55rem;
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    word-break: break-all;
}

.l2tp-info-note {
    font-size: 0.8125rem;
    color: var(--text);
}

.l2tp-info-extra {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.l2tp-info-extra-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.l2tp-info-extra-text {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
}

.portal-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .topbar-conn-label { display: none; }
    .l2tp-info-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text);
    transition: var(--transition);
}

.mobile-menu-btn:hover { background: var(--bg-subtle); }

/* ─── Cards ─── */
.card,
.panel-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover,
.panel-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #94a3b8;
}

.card-header,
.panel-card-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(180deg, #e8edf5 0%, #f1f5f9 100%);
}

.card-header h2,
.card-header h3,
.panel-card-header h2,
.panel-card-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card-body,
.panel-card-body { padding: 1.25rem 1.5rem; }

.card-compact .card-body,
.card-compact .panel-card-body { padding: 0.875rem 1.125rem; }

.panel-card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.users-quick-search {
    width: 180px;
    max-width: 100%;
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
}

#vpn-users-tbody.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

/* ─── Stat Cards ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-grid-dashboard {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (min-width: 1200px) {
    .stat-grid-dashboard:has(.stat-card:nth-child(5):last-child) {
        grid-template-columns: repeat(5, 1fr);
    }
    .stat-grid-dashboard:has(.stat-card:nth-child(4):last-child) {
        grid-template-columns: repeat(4, 1fr);
    }
}

.dashboard-chart-card {
    margin-bottom: 1.5rem;
}

.dashboard-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-chart-wrap {
    position: relative;
    height: 320px;
    width: 100%;
}

.stat-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.375rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after { opacity: 1; }

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg { width: 22px; height: 22px; }

.stat-card-content { flex: 1; min-width: 0; }

.stat-card-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 800;
    margin-top: 0.125rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.stat-card.accent-blue .stat-card-icon { background: #eef2ff; color: #4f46e5; }
.stat-card.accent-blue .stat-card-value { color: #4f46e5; }
.stat-card.accent-blue::after { background: linear-gradient(90deg, #6366f1, #4f46e5); }

.stat-card.accent-green .stat-card-icon { background: var(--success-soft); color: var(--success); }
.stat-card.accent-green .stat-card-value { color: var(--success); }
.stat-card.accent-green::after { background: linear-gradient(90deg, #10b981, #059669); }

.stat-card.accent-red .stat-card-icon { background: var(--danger-soft); color: var(--danger); }
.stat-card.accent-red .stat-card-value { color: var(--danger); }
.stat-card.accent-red::after { background: linear-gradient(90deg, #ef4444, #dc2626); }

.stat-card.accent-orange .stat-card-icon { background: var(--warning-soft); color: var(--warning); }
.stat-card.accent-orange .stat-card-value { color: var(--warning); }
.stat-card.accent-orange::after { background: linear-gradient(90deg, #f59e0b, #d97706); }

.stat-card.accent-purple .stat-card-icon { background: #f5f3ff; color: #7c3aed; }
.stat-card.accent-purple .stat-card-value { color: #7c3aed; }
.stat-card.accent-purple::after { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

.stat-card.accent-slate .stat-card-icon { background: #f1f5f9; color: #475569; }
.stat-card.accent-slate .stat-card-value { color: #334155; }
.stat-card.accent-slate::after { background: linear-gradient(90deg, #64748b, #475569); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5625rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25);
}
.btn-success:hover { background: linear-gradient(180deg, #059669 0%, #047857 100%); transform: translateY(-1px); }

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--muted-light); }

.btn-danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}
.btn-danger:hover { background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%); transform: translateY(-1px); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.875rem; }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.01em;
}

.badge-green { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-red { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-orange { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.badge-blue { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.badge-slate { background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1; }
.badge-purple { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }

/* ─── Alerts ─── */
.alert {
    padding: 0.9375rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid;
    text-align: center;
    line-height: 1.75;
    white-space: pre-line;
}

.alert-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.alert-success {
    background: var(--success-soft);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ─── Tables ─── */
.panel-table-wrap { overflow-x: auto; }

.panel-table-scroll {
    max-height: min(420px, 55vh);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

.panel-table-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.panel-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 4px;
}

.panel-table-scroll .panel-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border-strong);
}

.panel-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: separate;
    border-spacing: 0;
}

.panel-table thead {
    background: linear-gradient(180deg, #dde4f0 0%, #e8edf5 100%);
    border-bottom: 2px solid var(--border-strong);
}

.panel-table th {
    padding: 0.9375rem 1.125rem;
    text-align: right;
    font-weight: 700;
    color: #334155;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-strong);
}

.panel-table td {
    padding: 0.9375rem 1.125rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    background: var(--surface-raised);
}

.panel-table tbody tr {
    transition: background var(--transition);
}

.panel-table tbody tr:nth-child(even) td {
    background: var(--surface-muted);
}

.panel-table tbody tr:hover td {
    background: #e0e7f2;
}

.cell-duration {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
    letter-spacing: 0.02em;
}

.panel-table tbody tr.row-online td {
    background: #dcfce7;
}

.panel-table tbody tr.row-online:hover td {
    background: #bbf7d0;
}

.panel-table tbody tr.row-multi-online td {
    background: #e0f2fe;
}

.panel-table tbody tr.row-multi-online:hover td {
    background: #bae6fd;
}

.panel-table tbody tr.row-suspended td {
    background: #fee2e2;
}

.panel-table tbody tr.row-suspended:hover td {
    background: #fecaca;
}

.panel-table tbody tr.row-expired td {
    background: #ffedd5;
}

.panel-table tbody tr.row-expired:hover td {
    background: #fed7aa;
}

.table-color-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
    padding: 0.45rem 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.table-color-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.table-color-legend-swatch {
    width: 1.1rem;
    height: 0.75rem;
    border-radius: 3px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    flex-shrink: 0;
}

.table-color-legend-swatch.row-default { background: var(--surface-muted); }
.table-color-legend-swatch.row-online { background: #dcfce7; }
.table-color-legend-swatch.row-multi-online { background: #e0f2fe; }
.table-color-legend-swatch.row-suspended { background: #fee2e2; }
.table-color-legend-swatch.row-expired { background: #ffedd5; }

/* ردیف‌های رنگی — لیست Pro (اولویت بالاتر از hover پیش‌فرض) */
.panel-list-pro .panel-table tbody tr.row-online td,
.panel-card--table-only .panel-table tbody tr.row-online td {
    background: #dcfce7;
}

.panel-list-pro .panel-table tbody tr.row-online:hover td,
.panel-card--table-only .panel-table tbody tr.row-online:hover td {
    background: #bbf7d0;
}

.panel-list-pro .panel-table tbody tr.row-multi-online td,
.panel-card--table-only .panel-table tbody tr.row-multi-online td {
    background: #e0f2fe;
}

.panel-list-pro .panel-table tbody tr.row-multi-online:hover td,
.panel-card--table-only .panel-table tbody tr.row-multi-online:hover td {
    background: #bae6fd;
}

.panel-list-pro .panel-table tbody tr.row-suspended td,
.panel-card--table-only .panel-table tbody tr.row-suspended td {
    background: #fee2e2;
}

.panel-list-pro .panel-table tbody tr.row-suspended:hover td,
.panel-card--table-only .panel-table tbody tr.row-suspended:hover td {
    background: #fecaca;
}

.panel-list-pro .panel-table tbody tr.row-expired td,
.panel-card--table-only .panel-table tbody tr.row-expired td {
    background: #ffedd5;
}

.panel-list-pro .panel-table tbody tr.row-expired:hover td,
.panel-card--table-only .panel-table tbody tr.row-expired:hover td {
    background: #fed7aa;
}

.openvpn-import-box {
    padding: 0.75rem 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.openvpn-import-label {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.openvpn-import-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.openvpn-import-row .field-input {
    flex: 1;
    min-width: 12rem;
    font-size: 0.8125rem;
}

.openvpn-nginx-snippet {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    background: #0b0f19;
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* ─── Compact list tables ─── */
.panel-table-wrap--compact {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sessions-online-page .live-stats--compact {
    justify-content: center;
    text-align: center;
}

.sessions-online-table th,
.sessions-online-table td {
    text-align: center;
}

.sessions-online-table .cell-ltr,
.sessions-online-table .cell-duration,
.sessions-online-table td.cell-ltr,
.sessions-online-table th.cell-ltr {
    text-align: center;
}

.sessions-online-table .link-action {
    display: inline-block;
    text-align: center;
}

.sessions-online-table .col-truncate,
.sessions-online-table .col-truncate-md {
    text-align: center;
}

.sessions-online-table .col-protocol {
    max-width: 7.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sessions-online-table .empty-state {
    text-align: center;
}

.sessions-online-table .online-expand-btn {
    margin-inline: auto;
}

.sessions-online-table .btn-sm {
    margin-inline: auto;
}

.panel-table-compact {
    font-size: 0.6875rem;
    border-collapse: collapse;
    border: 1px solid var(--border-strong);
}

.panel-table-compact th {
    padding: 0.35rem 0.45rem;
    font-size: 0.625rem;
    letter-spacing: 0.03em;
    line-height: 1.25;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.panel-table-compact td {
    padding: 0.28rem 0.45rem;
    font-size: 0.6875rem;
    line-height: 1.3;
    border: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

.panel-table-compact thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border-strong);
}

.panel-table-compact .badge {
    padding: 0.05rem 0.35rem;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.35;
}

.panel-table-compact .btn-sm {
    padding: 0.1rem 0.38rem;
    font-size: 0.625rem;
    min-height: 0;
    line-height: 1.25;
}

.panel-table-compact .row-action-menu-btn {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.panel-table-compact .row-action-menu-btn svg {
    width: 13px;
    height: 13px;
}

.panel-table-compact input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}

.panel-table-compact .cell-sm {
    font-size: 0.6875rem;
}

.panel-table-compact .cell-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.panel-table-compact .cell-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

.panel-table-compact .user-name-text {
    max-width: 7.5rem;
}

.panel-table-compact .col-truncate {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-table-compact .col-truncate-md {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-log-table .col-audit-num {
    width: 2rem;
    max-width: 2rem;
}

.audit-log-table .col-audit-time {
    width: 5.5rem;
    max-width: 5.5rem;
    font-size: 0.625rem;
    white-space: nowrap;
}

.audit-log-table .col-audit-action {
    width: 5.5rem;
    max-width: 5.5rem;
}

.audit-log-table .col-audit-action .badge {
    font-size: 0.5625rem;
    padding: 0.15rem 0.35rem;
    white-space: normal;
    line-height: 1.3;
    text-align: center;
}

.audit-log-table .col-audit-actor,
.audit-log-table .col-audit-subject {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.6875rem;
}

.audit-log-table .col-audit-details {
    min-width: 10rem;
    max-width: none;
    white-space: normal;
    line-height: 1.45;
    font-size: 0.6875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.message-audience-mode-tabs {
    margin-bottom: 1rem;
}

.message-audience-commercial-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.message-audience-commercial-search {
    flex: 1 1 12rem;
    max-width: 20rem;
}

.message-audience-commercial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.35rem 1rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.message-audience-commercial-item {
    margin: 0;
    font-size: 0.8125rem;
}

.panel-table-compact th.cell-center,
.panel-table-compact td.cell-center {
    text-align: center;
}

.panel-table-compact td.cell-center.cell-ltr {
    text-align: center;
}

.panel-table-compact .cell-meta {
    font-size: 0.625rem;
    color: var(--muted);
    font-weight: 400;
}

.panel-table-compact tr.row-reseller-sub td {
    background: #f1f5f9;
}

.panel-table-compact tr.row-reseller-sub:hover td {
    background: #e8eef5;
}

.panel-table-compact tr.row-reseller-sub.row-suspended td {
    background: #fee2e2;
}

.reseller-name-indent {
    padding-inline-start: 0.35rem;
}

.reseller-tree-marker {
    color: var(--muted);
    font-size: 0.75rem;
    margin-inline-end: 0.2rem;
    flex-shrink: 0;
}

.reseller-sub-name {
    font-weight: 500;
    font-size: 0.6875rem;
}

.reseller-sub-badge {
    font-size: 0.5625rem;
    padding: 0.05rem 0.3rem;
    margin-inline-start: 0.25rem;
    vertical-align: middle;
}

.online-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #93c5fd;
    border-radius: 3px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.online-expand-btn:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.live-stats--compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.sessions-online-page .live-stats--compact {
    justify-content: center;
    text-align: center;
}

.panel-card--table-only .panel-card-header {
    padding: 0.5rem 0.75rem;
}

.panel-card--table-only .panel-card-header h2 {
    font-size: 0.875rem;
}

.panel-card-footer {
    padding: 0.65rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.panel-card .table-color-legend {
    margin-top: 0;
    border-top: 1px solid var(--border);
}

.col-row-actions .row-action-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.col-row-actions .row-action-menu-btn:hover {
    color: var(--accent);
    background: var(--bg-subtle);
}

.col-row-actions a.row-action-menu-btn {
    text-decoration: none;
}

/* ─── Forms ─── */
.field-input {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface-raised);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.field-input:hover { border-color: var(--muted-light); }

.field-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.field-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.field-input-error {
    border-color: var(--danger) !important;
}

.portal-port-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1.125rem 1.5rem;
    align-items: end;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.form-actions-bar {
    position: sticky;
    bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 1.75rem;
}

/* ─── Links & Lists ─── */
.link-action {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: color var(--transition);
}

.link-action:hover { color: var(--accent-hover); text-decoration: underline; }
.link-action.danger { color: var(--danger); }
.link-action.success { color: var(--success); }
.link-action.warning { color: var(--warning); }

.list-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    gap: 1rem;
}

.list-item-row:last-child { border-bottom: none; }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--muted);
    font-size: 0.875rem;
}

/* ─── Page Header ─── */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
}

.page-header-desc {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.375rem;
}

.page-welcome {
    margin-bottom: 1.75rem;
}

.page-welcome h1 {
    font-size: 1.625rem;
    font-weight: 800;
    margin: 0 0 0.375rem;
    letter-spacing: -0.03em;
    color: var(--text);
}

.page-welcome p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

/* ─── Kill Switch ─── */
.kill-switch-banner {
    background: linear-gradient(90deg, #dc2626, #991b1b);
    color: #fff;
    padding: 0.625rem 1.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    animation: pulse-bg 2s infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.88; }
}

.read-only-banner {
    background: linear-gradient(90deg, #475569, #334155);
    color: #f8fafc;
    padding: 0.625rem 1.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 55;
}

/* مشاهده‌گر: دکمه‌ها و فرم‌ها عادی دیده می‌شوند؛ ذخیره سمت سرور/JS مسدود است */

/* ─── Tabs ─── */
.plan-tab.active {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
    font-weight: 700;
}

.creator-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    max-width: 100%;
}

.creator-cell-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 8rem;
}

.creator-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #d97706;
    cursor: pointer;
    outline: none;
    font: inherit;
    line-height: 1;
}

.creator-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 1;
}

.creator-hint-btn:hover .creator-hint-icon,
.creator-hint-btn:focus-visible .creator-hint-icon,
.creator-hint-btn[aria-expanded="true"] .creator-hint-icon {
    background: #fde68a;
    border-color: #d97706;
}

.creator-hint-popover {
    position: fixed;
    z-index: 1200;
    min-width: 180px;
    max-width: 280px;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.6875rem;
    line-height: 1.65;
    text-align: right;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    pointer-events: none;
}

.creator-hint-popover span {
    display: block;
}

.creator-hint-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.creator-hint-popover.is-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1e293b;
}

/* ─── Login / Guest ─── */
.guest-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--sidebar-bg);
}

.login-split {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.login-brand-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 100% 80% at 20% 20%, rgba(99, 102, 241, 0.25), transparent 50%),
        radial-gradient(ellipse 80% 60% at 80% 80%, rgba(6, 182, 212, 0.15), transparent 50%),
        linear-gradient(160deg, #0b0f19 0%, #121826 40%, #0f172a 100%);
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.login-brand-logo svg { width: 28px; height: 28px; color: #fff; }

.login-brand-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 1rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.login-brand-content p {
    font-size: 1rem;
    color: #94a3b8;
    line-height: 1.7;
    margin: 0 0 2.5rem;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    color: #cbd5e1;
    font-size: 0.875rem;
}

.login-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-feature-icon svg { width: 18px; height: 18px; color: #a5b4fc; }

.login-form-panel {
    width: 480px;
    max-width: 100%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
}

.login-form-header {
    margin-bottom: 2rem;
}

.login-form-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.login-form-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.login-form-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--muted);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-row input { accent-color: var(--accent); }

/* ─── Plan Cards ─── */
.plan-card {
    transition: transform var(--transition), box-shadow var(--transition);
}

.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.plan-card-title {
    font-weight: 700;
    font-size: 1.0625rem;
    margin: 0;
    letter-spacing: -0.01em;
}

.plan-card-meta {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.85;
    margin-top: 0.75rem;
}

.plan-card-actions {
    display: flex;
    gap: 0.875rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ─── Grid Utilities ─── */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-3xl { max-width: 48rem; margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }
.inline { display: inline; }
.opacity-60 { opacity: 0.6; }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:col-span-2 { grid-column: span 2; }
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:col-span-1 { grid-column: span 1; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .xl\:col-span-2 { grid-column: span 2; }
}

/* ─── Page Layout Helpers ─── */
.page-split {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .page-split { grid-template-columns: minmax(280px, 360px) 1fr; }
}

.form-inline-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-inline-row .field-input { flex: 1; min-width: 160px; }

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.125rem;
    border-radius: var(--radius-sm);
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    overflow-x: auto;
    margin: 0;
    direction: ltr;
    text-align: left;
}

.code-inline {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    direction: ltr;
}

.live-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.live-stats strong { color: var(--text); font-weight: 700; }

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-subtle);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    border-radius: inherit;
    transition: width 0.4s ease;
}

.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }

/* ─── Portal ─── */
.portal-shell { min-height: 100vh; background: var(--bg); }

.portal-nav {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.portal-nav-brand {
    font-weight: 700;
    font-size: 0.9375rem;
}

.portal-nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.portal-nav-user form { margin: 0; }

.portal-main {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}

.portal-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.portal-nav-username {
    font-weight: 600;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.portal-logout-btn {
    color: #fca5a5 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.portal-tabs {
    margin-bottom: 1.25rem;
}

.portal-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.portal-dl {
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.portal-dl div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.portal-dl div:last-child { border-bottom: none; padding-bottom: 0; }

.portal-dl dt {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.portal-dl dd {
    margin: 0;
    font-weight: 600;
    color: var(--text);
    text-align: left;
}

.portal-narrow-card {
    max-width: 420px;
}

.progress-fill.progress-danger {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.portal-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
}

.portal-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    padding: 2rem 1.75rem;
}

.portal-login-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.portal-login-icon {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.portal-login-head h1 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

.portal-login-head p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.portal-login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
}

.portal-brand-logo {
    max-height: 64px;
    max-width: 200px;
    object-fit: contain;
    margin: 0 auto 0.75rem;
    display: block;
}

.portal-brand-logo-sm {
    max-height: 32px;
    max-width: 120px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.connection-guide-panel {
    display: none;
}

.connection-guide-panel.active {
    display: block;
}

.guide-steps {
    margin: 0;
    padding-right: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.guide-steps li + li {
    margin-top: 0.35rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.35rem 1rem;
}

.wg-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.wg-qr-box {
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.wg-qr-box svg {
    display: block;
    width: 260px;
    height: 260px;
}

.wg-config-block {
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 0.6875rem;
    line-height: 1.5;
    cursor: pointer;
}

.wg-qr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--accent);
    cursor: pointer;
    transition: var(--transition);
}

.wg-qr-icon-btn:hover {
    background: var(--accent-soft);
    border-color: rgba(79, 70, 229, 0.35);
}

.proxy-qr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    cursor: pointer;
    transition: var(--transition);
}

.proxy-qr-icon-btn:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.55);
}

.proxy-qr-modal-card {
    max-width: min(400px, calc(100vw - 2rem));
    width: 100%;
    margin: auto;
    overflow: hidden;
}

.proxy-qr-modal-card .modal-header {
    padding: 0.85rem 1rem;
    text-align: center;
    justify-content: center;
    position: relative;
}

.proxy-qr-modal-card .modal-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
}

.proxy-qr-modal-card .modal-close {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
}

.proxy-qr-modal-card .modal-body {
    max-height: min(72vh, 640px);
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
}

.proxy-modal-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.proxy-modal-server {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    font-size: 0.8125rem;
}

.proxy-modal-server-name {
    font-weight: 700;
    color: var(--text);
}

.proxy-modal-panel {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted, #f8fafc);
    padding: 0.85rem 0.75rem;
    text-align: center;
}

.proxy-modal-panel-title {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.proxy-modal-qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 0.65rem;
}

.proxy-modal-qr-wrap .wg-qr-box,
.proxy-modal-qr-wrap svg {
    display: block;
    width: 148px !important;
    height: 148px !important;
    margin: 0 auto;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.proxy-modal-url {
    width: 100%;
}

.proxy-modal-url .field-input {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.45rem 0.55rem;
    text-align: center;
}

.proxy-modal-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.proxy-modal-config-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.proxy-modal-config-tab {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    transition: var(--transition);
}

.proxy-modal-config-tab.is-active,
.proxy-modal-config-tab:hover {
    border-color: rgba(79, 70, 229, 0.35);
    background: var(--accent-soft);
    color: var(--accent);
}

.proxy-modal-config-pane {
    display: none;
}

.proxy-modal-config-pane.is-active {
    display: block;
}

.proxy-modal-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
    background: var(--surface-muted, #f8fafc);
}

.proxy-modal-block:last-child {
    margin-bottom: 0;
}

.proxy-modal-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.proxy-modal-section {
    margin-top: 0.65rem;
}

.proxy-modal-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
}

.plan-driven-field:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background: var(--surface-muted);
}

.user-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    vertical-align: middle;
}

.user-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-action-menu {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    vertical-align: middle;
}

.row-action-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.row-action-menu-btn:hover,
.row-action-menu.open .row-action-menu-btn {
    background: var(--surface-muted);
    color: var(--text);
}

.row-action-menu-dropdown {
    min-width: 13.5rem;
    max-width: 16rem;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}

.row-action-menu-dropdown.hidden {
    display: none !important;
}

.uam-head {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
    position: sticky;
    top: 0;
    z-index: 1;
}

.uam-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.45rem;
}

.uam-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.uam-chips .badge {
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
}

.uam-chip {
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.uam-chip-online {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    font-weight: 600;
}

.uam-section {
    padding: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.uam-section:last-child {
    border-bottom: none;
}

.uam-section-danger {
    background: #fef2f2;
}

.uam-form {
    margin: 0;
    padding: 0;
}

.uam-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.5rem;
    border: none;
    border-radius: 6px;
    background: none;
    text-align: start;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s ease;
}

button.uam-item {
    font-family: inherit;
}

.uam-item:hover {
    background: var(--surface-muted);
}

.uam-item-danger,
.uam-item-danger .uam-label {
    color: var(--danger);
}

.uam-item-danger:hover {
    background: #fee2e2;
}

.uam-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.uam-icon-blue { background: #dbeafe; color: #2563eb; }
.uam-icon-green { background: #dcfce7; color: #16a34a; }
.uam-icon-amber { background: #fef3c7; color: #d97706; }
.uam-icon-purple { background: #ede9fe; color: #7c3aed; }
.uam-icon-teal { background: #ccfbf1; color: #0d9488; }
.uam-icon-orange { background: #ffedd5; color: #ea580c; }
.uam-icon-red { background: #fee2e2; color: #dc2626; }

.uam-label {
    flex: 1;
    line-height: 1.3;
}

.uam-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
}

.wg-qr-hint {
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
    margin: 0 0 0.75rem;
}

.wg-qr-copy-target {
    cursor: pointer;
}

button.wg-qr-box {
    border: none;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.wg-qr-modal-card {
    max-width: 420px;
    width: calc(100% - 2rem);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg, 0 20px 50px rgba(0, 0, 0, 0.15));
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

.modal-body {
    padding: 1.25rem;
}

.confirm-modal-card {
    width: min(420px, calc(100% - 2rem));
}

.confirm-modal-body {
    padding: 1.75rem 1.5rem 1.35rem;
    text-align: center;
}

.confirm-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 0.875rem;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
}

.confirm-modal-body h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.confirm-modal-message {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.confirm-modal-extra {
    margin: 0.75rem 0 0;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.8125rem;
    line-height: 1.6;
    text-align: start;
}

.confirm-modal-extra.hidden {
    display: none !important;
}

.confirm-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
    margin-top: 1.35rem;
}

.confirm-modal-actions .btn {
    min-width: 7rem;
}

.usage-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

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

.usage-mini-card .label {
    font-size: 0.6875rem;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.usage-mini-card .value {
    font-size: 0.9375rem;
    font-weight: 700;
}

.usage-mini-card.upload .value { color: #0369a1; }
.usage-mini-card.download .value { color: var(--success); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem 1.25rem;
    font-size: 0.875rem;
}

.detail-grid p { margin: 0; }
.detail-grid strong { color: var(--text); }


/* ─── Pagination ─── */
.pagination-wrap { margin-top: 1.25rem; }
.pagination-wrap nav { display: flex; justify-content: center; }

.list-table-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.75rem;
    padding: 0.85rem 0.75rem 0.35rem;
    border-top: 1px solid var(--border);
}

.list-table-per-page {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
}

.list-table-per-page label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.list-table-pagination {
    display: flex;
    justify-content: center;
    width: 100%;
}

.panel-pagination-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    max-width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-pagination-summary {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.panel-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.panel-pagination-pages {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.panel-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.55rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    transition: var(--transition);
}

.panel-pagination-btn-nav {
    min-width: 3.25rem;
    padding: 0 0.75rem;
}

.panel-pagination-btn:hover:not(.disabled):not(.active) {
    color: var(--accent);
    border-color: rgba(79, 70, 229, 0.35);
    background: var(--accent-soft);
}

.panel-pagination-btn.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    cursor: default;
}

.panel-pagination-btn.disabled {
    opacity: 0.45;
    cursor: default;
}

.panel-pagination-btn-gap {
    min-width: auto;
    padding: 0 0.35rem;
    background: transparent;
    border-color: transparent;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-area { margin-right: 0; }
    .mobile-menu-btn { display: flex; }
    .main-content { padding: 1.25rem 1rem 2rem; }
    .topbar { padding: 0 1rem; }
    .login-brand-panel { display: none; }
    .login-form-panel { width: 100%; box-shadow: none; }
}

@media (max-width: 480px) {
    .login-form-panel { padding: 2rem 1.5rem; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ─── Form Pages ─── */
.form-page { max-width: 560px; }
.form-page-md { max-width: 720px; }
.form-page-lg { max-width: 880px; }

.plan-tab-panel.hidden { display: none !important; }

.plan-form .form-section:last-child { margin-bottom: 0; }

/* ─── Invoices ─── */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.filter-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-pill.active {
    background: var(--accent-soft);
    border-color: rgba(79, 70, 229, 0.35);
    color: var(--accent);
}

.invoice-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}

.invoice-doc-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.invoice-doc-number {
    font-family: monospace;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text);
}

.invoice-doc-body {
    padding: 1.5rem 1.75rem;
}

.invoice-doc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.invoice-doc-row span { color: var(--muted); }
.invoice-doc-row:last-child { border-bottom: none; }

.invoice-doc-total {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    border-top: 2px solid var(--border);
    background: var(--bg-subtle);
}

.invoice-doc-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.invoice-doc-amount span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
}


.form-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.375rem 1.5rem;
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1.125rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.form-grid { display: grid; gap: 1rem; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.col-span-2 { grid-column: span 2; }

.field-required { color: var(--danger); }
.field-input.readonly { background: var(--bg-subtle); color: var(--muted); cursor: not-allowed; }

.form-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.form-tab {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    margin-bottom: -1px;
}

.form-tab:hover { color: var(--text-secondary); }
.form-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.form-tab-badge {
    flex-shrink: 0;
    align-self: center;
    margin-right: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    transition: var(--transition);
}

.radio-card:hover { border-color: var(--border-strong); }
.radio-card:has(:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.radio-card-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    transition: var(--transition);
}

.radio-card-inline:has(:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.radio-grid { display: flex; flex-wrap: wrap; gap: 0.625rem; }

.plan-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.plan-preview-label { font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; }

.nas-check-grid { display: flex; flex-direction: column; gap: 0.5rem; max-height: 240px; overflow-y: auto; }

.nas-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.nas-check-item:hover { background: var(--bg-subtle); }
.nas-check-item:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }

.nas-test-btn {
    min-width: 3.25rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nas-test-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nas-test-btn.nas-test-loading { opacity: 0.7; cursor: wait; }
.nas-test-btn.nas-test-ok { border-color: #16a34a; background: #dcfce7; color: #15803d; }
.nas-test-btn.nas-test-failed { border-color: #dc2626; background: #fee2e2; color: #b91c1c; }

.info-box {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    font-size: 0.8125rem;
    color: #1e40af;
    line-height: 1.6;
}

.progress-bar {
    height: 8px;
    background: var(--bg-subtle);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.live-stats {
    font-size: 0.8125rem;
    color: var(--muted);
    margin: -0.25rem 0 1.25rem;
    padding: 0.625rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: inline-flex;
    gap: 1.25rem;
}

/* ─── Table cell utilities ─── */
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sm { font-size: 0.75rem; color: var(--text-secondary); }
.cell-center { text-align: center; }
.cell-actions { white-space: nowrap; }
.text-online { font-weight: 700; color: var(--success); }
.text-info { color: #2563eb; font-weight: 500; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }

.cell-ltr {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: left;
}

.field-input-auto {
    width: auto;
    min-width: 140px;
}

.users-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
}

.users-action-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
}

.users-action-bar-sep {
    display: inline-block;
    width: 1px;
    height: 1.65rem;
    margin: 0 0.15rem;
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.55), transparent);
    flex-shrink: 0;
}

.users-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.35;
}

.users-action-btn svg {
    flex-shrink: 0;
    opacity: 0.95;
}

.users-action-btn--green { background: linear-gradient(180deg, #388e3c, #2e7d32); }
.users-action-btn--green:hover { background: linear-gradient(180deg, #2e7d32, #1b5e20); }
.users-action-btn--gray { background: linear-gradient(180deg, #90a4ae, #78909c); }
.users-action-btn--gray:hover { background: linear-gradient(180deg, #78909c, #607d8b); }
.users-action-btn--purple { background: linear-gradient(180deg, #7b1fa2, #6a1b9a); }
.users-action-btn--purple:hover { background: linear-gradient(180deg, #6a1b9a, #4a148c); }
.users-action-btn--blue { background: linear-gradient(180deg, #1e88e5, #1565c0); }
.users-action-btn--blue:hover { background: linear-gradient(180deg, #1565c0, #0d47a1); }
.users-action-btn--salmon { background: linear-gradient(180deg, #ef5350, #e53935); }
.users-action-btn--salmon:hover { background: linear-gradient(180deg, #e53935, #c62828); }
.users-action-btn--danger { background: linear-gradient(180deg, #c62828, #b71c1c); }
.users-action-btn--danger:hover { background: linear-gradient(180deg, #b71c1c, #8e0000); }
.users-action-btn--teal { background: linear-gradient(180deg, #546e7a, #455a64); }
.users-action-btn--teal:hover { background: linear-gradient(180deg, #455a64, #37474f); }

.users-action-selected {
    margin-right: auto;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bulk-bar {
    padding: 0.875rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
}

.bulk-bar-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bulk-bar-count {
    font-size: 0.75rem;
    color: var(--muted);
    margin-right: auto;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sidebar-balance {
    display: block;
    margin-top: 4px;
    font-size: 0.6875rem;
    color: #a5b4fc;
    font-weight: 600;
}

/* ─── Backup page ─── */
.backup-tabs-wrap {
    margin-bottom: 1.25rem;
}

.backup-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.backup-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.backup-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.backup-tab.active {
    background: var(--accent-soft);
    border-color: rgba(79, 70, 229, 0.35);
    color: var(--accent);
}

.backup-tab-panel {
    display: none;
}

.backup-tab-panel.active {
    display: block;
}

.backup-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.backup-inner-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    padding: 1.125rem 1.25rem;
}

.backup-inner-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}

.backup-inner-card p {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.backup-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.backup-code-block {
    margin-top: 0.875rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
    font-family: monospace;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    direction: ltr;
    text-align: left;
    word-break: break-all;
}

.backup-section-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.live-stats strong { color: var(--text); font-weight: 700; }

/* ─── Password reveal field ─── */
.password-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.password-current-block,
.password-new-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.password-field-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.password-field-wrap .field-input,
.password-field-wrap .password-masked-static {
    padding-left: 2.75rem;
}

.password-field-wrap .password-reveal-input[readonly] {
    background: #f8fafc;
    color: var(--text);
    cursor: default;
}

.password-masked-static {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
}

.password-toggle-btn {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle-btn:hover {
    color: var(--accent);
    background: rgba(37, 99, 235, 0.08);
}

.password-toggle-btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

.top-users-table th.cell-num,
.top-users-table td.cell-num {
    width: 5.5rem;
    white-space: nowrap;
}

.top-users-table td.cell-num:last-child {
    width: 4rem;
}

/* System Status (dashboard) */
.system-status-card .panel-card-body {
    padding-top: 1.25rem;
}

.system-status-card svg {
    display: block;
    flex-shrink: 0;
}

.system-status-header {
    border-bottom: 1px solid var(--border);
}

.system-status-live {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.system-status-live-label {
    font-weight: 600;
    color: var(--accent);
}

.system-status-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.45);
}

.system-status-live-dot.system-live-pulse {
    animation: system-live-pulse 0.45s ease;
}

@keyframes system-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.55); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.system-mini-stat-value.system-stat-flash {
    animation: system-stat-flash 0.6s ease;
}

@keyframes system-stat-flash {
    0%, 100% { color: inherit; }
    40% { color: var(--accent); transform: scale(1.04); }
}

.system-memory-panel {
    margin-top: 1.35rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.system-memory-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    margin-bottom: 1rem;
}

.system-memory-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.system-memory-sub {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.system-memory-sep {
    margin: 0 0.2rem;
    opacity: 0.55;
}

.system-memory-pct {
    margin-right: 0.45rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    font-weight: 700;
}

.system-memory-bar-wrap {
    flex: 1 1 12rem;
    max-width: 18rem;
}

.system-memory-bar-track,
.system-process-bar-track {
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.system-memory-bar-fill,
.system-process-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    transition: width 0.35s ease;
}

.system-process-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.system-process-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5rem, 7rem);
    gap: 0.65rem;
    align-items: center;
}

.system-process-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.system-process-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-process-stats {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.system-process-empty {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .system-process-row {
        grid-template-columns: 1fr;
    }
}

.system-status-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.system-status-title h2 {
    margin: 0;
    font-size: 1.05rem;
}

.system-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

.system-gauge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .system-gauge-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.system-gauge-item {
    text-align: center;
}

.system-gauge-ring {
    position: relative;
    width: 6rem;
    height: 6rem;
    margin: 0 auto 0.5rem;
    flex-shrink: 0;
}

.system-gauge-ring svg {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 6rem;
    max-height: 6rem;
    transform: rotate(-90deg);
}

.system-gauge-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.system-gauge-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}

.system-gauge-ring.gauge-ok .system-gauge-fill { stroke: var(--accent); }
.system-gauge-ring.gauge-mid .system-gauge-fill { stroke: var(--warning); }
.system-gauge-ring.gauge-warn .system-gauge-fill { stroke: var(--danger); }

.system-gauge-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.system-gauge-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.system-gauge-detail {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.system-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 900px) {
    .system-mini-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .system-mini-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.system-mini-stat {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    min-width: 0;
}

.system-mini-stat-body {
    flex: 1;
    min-width: 0;
}

.system-mini-stat-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.system-mini-stat-icon svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}

.system-mini-stat.accent-green .system-mini-stat-icon { background: var(--success-soft); color: var(--success); }
.system-mini-stat.accent-blue .system-mini-stat-icon { background: #eef2ff; color: #4f46e5; }
.system-mini-stat.accent-red .system-mini-stat-icon { background: var(--danger-soft); color: var(--danger); }
.system-mini-stat.accent-orange .system-mini-stat-icon { background: var(--warning-soft); color: var(--warning); }
.system-mini-stat.accent-purple .system-mini-stat-icon { background: #f5f3ff; color: #7c3aed; }
.system-mini-stat.accent-slate .system-mini-stat-icon { background: #f1f5f9; color: #475569; }

.system-mini-stat-label {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.2;
}

.system-mini-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-top: 0.1rem;
}

.system-ssl-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.system-ssl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.system-ssl-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.system-ssl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.system-ssl-domains {
    display: grid;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .system-ssl-domains {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.system-ssl-domain {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    min-width: 0;
}

.system-ssl-domain-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.system-ssl-domain-name {
    font-weight: 600;
    font-size: 0.875rem;
    word-break: break-all;
}

.system-ssl-domain-expiry {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.system-ssl-days {
    color: var(--muted);
}

.system-ssl-state-ok { border-color: rgba(5, 150, 105, 0.25); }
.system-ssl-state-warn { border-color: rgba(217, 119, 6, 0.35); background: var(--warning-soft); }
.system-ssl-state-expired { border-color: rgba(220, 38, 38, 0.35); background: var(--danger-soft); }
.system-ssl-state-missing { border-color: rgba(217, 119, 6, 0.25); }

.system-ssl-state-badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.45rem;
}

.system-ssl-state-ok .system-ssl-state-badge { background: var(--success-soft); color: var(--success); }
.system-ssl-state-warn .system-ssl-state-badge { background: var(--warning-soft); color: var(--warning); }
.system-ssl-state-expired .system-ssl-state-badge { background: var(--danger-soft); color: var(--danger); }
.system-ssl-state-missing .system-ssl-state-badge { background: var(--warning-soft); color: var(--warning); }

.system-ssl-footnote {
    margin: 0.65rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.system-ssl-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.system-ssl-add-form {
    display: flex;
    flex: 1;
    min-width: 200px;
    gap: 0.45rem;
}

.system-ssl-add-form .field-input {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
}

.topup-form-panel.hidden {
    display: none !important;
}

/* ─── Error pages (404, 419, …) ─── */
.error-page-body {
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.error-page-wrap {
    width: 100%;
    max-width: 32rem;
}

.error-page-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.error-page-code {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--accent);
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.error-page-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.error-page-lead {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--text-secondary);
    text-align: right;
}

.error-page-hints {
    text-align: right;
    background: var(--surface-muted, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    margin-bottom: 1.5rem;
}

.error-page-hints-title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.error-page-hints ul {
    margin: 0;
    padding-right: 1.15rem;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.error-page-hints li + li {
    margin-top: 0.35rem;
}

.error-page-hints code,
.error-page-lead code {
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.error-page-hints kbd {
    font-family: inherit;
    font-size: 0.85em;
    padding: 0.1em 0.4em;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
}

.error-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
}

.error-page-foot {
    margin: 1rem 0 0;
}

/* System messages & changelog */
.topbar-conn-system-msg { position: relative; }
.topbar-system-msg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--warning, #d97706);
    color: var(--warning, #d97706);
    font-weight: 800;
    font-size: 0.75rem;
    line-height: 1;
}
.topbar-system-msg-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}
.system-message-overlay {
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.system-message-bubble {
    width: min(92vw, 28rem);
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    padding: 1.25rem 1.35rem 1rem;
    animation: system-msg-pop 0.25s ease-out;
}
@keyframes system-msg-pop {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.system-message-bubble-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}
.system-message-bubble-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.system-message-badge {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(217, 119, 6, 0.12);
    border: 2px solid var(--warning, #d97706);
    color: var(--warning, #d97706);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}
.system-message-bubble-body {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text);
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 1rem;
}
.system-message-dismiss-form {
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.system-message-dismiss-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
}
.system-message-preview-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.sidebar-blog-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0 0.75rem 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.sidebar-blog-card:hover {
    border-color: var(--accent);
    background: var(--surface);
}
.sidebar-blog-icon { font-size: 1.25rem; line-height: 1; }
.sidebar-blog-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 0;
}
.sidebar-blog-text strong {
    font-size: 0.8125rem;
    color: var(--text);
}
.changelog-list { display: flex; flex-direction: column; gap: 1rem; }
.changelog-card {
    display: flex;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.changelog-card-icon { font-size: 1.75rem; line-height: 1; }
.changelog-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.changelog-card-body h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.changelog-excerpt { margin: 0; color: var(--text-muted); font-size: 0.875rem; line-height: 1.55; }
.changelog-read-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.changelog-article-title { margin: 0.5rem 0 1rem; font-size: 1.35rem; }
.changelog-article-body { line-height: 1.75; margin-bottom: 0; }

.form-field { display: flex; flex-direction: column; }
.form-field.span-2,
.span-2 { grid-column: 1 / -1; }

.field-input-textarea {
    min-height: 10rem;
    line-height: 1.65;
    resize: vertical;
}

.support-form-intro {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.support-ticket-page { max-width: 880px; }

.support-ticket-shell { box-shadow: var(--shadow-md); }

.support-ticket-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--border-strong);
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 55%, #fff 100%);
}

.support-ticket-id {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.support-ticket-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.support-ticket-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin-top: 0.65rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.support-ticket-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.support-ticket-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.support-ticket-chip strong {
    color: var(--text);
    font-weight: 700;
}

.support-ticket-thread {
    padding: 1.25rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.support-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 92%;
}

.support-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.support-msg-staff { align-self: flex-start; }

.support-msg-avatar {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
    border: 2px solid transparent;
}

.support-msg-user .support-msg-avatar {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.support-msg-staff .support-msg-avatar {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.support-msg-bubble {
    flex: 1;
    min-width: 0;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.support-msg-user .support-msg-bubble {
    background: #fff;
    border-color: #e2e8f0;
    border-top-left-radius: 0.35rem;
}

.support-msg-staff .support-msg-bubble {
    background: #eff6ff;
    border-color: #bfdbfe;
    border-top-right-radius: 0.35rem;
}

.support-msg-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.45rem;
}

.support-msg-head strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.support-msg-head time {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.support-msg-role {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
}

.support-msg-text {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--text);
    word-break: break-word;
}

.support-ticket-composer {
    border-top: 1px solid var(--border-strong);
    padding: 1.25rem 1.5rem 1.35rem;
    background: #fff;
}

.support-ticket-composer-title {
    margin: 0 0 0.85rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
}

.support-ticket-composer .field-input-textarea {
    min-height: 7.5rem;
}

.support-ticket-composer-actions {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.support-ticket-composer-hint {
    font-size: 0.75rem;
    color: var(--muted);
}

.support-ticket-closed {
    border-top: 1px solid var(--border-strong);
    padding: 1rem 1.5rem;
    background: var(--surface-muted);
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
}

.support-ticket-meta { font-size: 0.875rem; line-height: 1.7; margin-bottom: 0.75rem; }
.support-reply-admin { border-right: 3px solid var(--accent); }
.form-inline-checks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.35rem 0.75rem;
}
.form-fieldset {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.form-fieldset legend {
    padding: 0 0.35rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.editor-mode-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.editor-mode-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
.editor-mode-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-subtle);
}
.editor-mode-btn {
    border: 0;
    background: transparent;
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
}
.editor-mode-btn.is-active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--border);
}
.panel-quill-editor {
    min-height: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    direction: rtl;
}
.panel-quill-editor .ql-editor {
    min-height: 10rem;
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.65;
    text-align: right;
}
.panel-quill-editor .ql-toolbar.ql-snow {
    border: 0;
    border-bottom: 1px solid var(--border);
    direction: ltr;
}
.panel-quill-editor .ql-container.ql-snow {
    border: 0;
}
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.message-rich-body p { margin: 0 0 0.65rem; }
.message-rich-body ul,
.message-rich-body ol { margin: 0 0 0.65rem; padding-right: 1.25rem; }
.message-rich-body a { color: var(--accent); }
.message-rich-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}
.message-rich-body th,
.message-rich-body td {
    border: 1px solid var(--border);
    padding: 0.35rem 0.5rem;
}

.multi-select-dropdown {
    position: relative;
    max-width: 28rem;
}
.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    text-align: right;
    cursor: pointer;
    background: var(--surface);
}
.multi-select-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.multi-select-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
}
.multi-select-panel {
    position: absolute;
    z-index: 100;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 16rem;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.multi-select-search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
.multi-select-search {
    width: 100%;
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
}
.multi-select-toolbar {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
.multi-select-panel:has(.multi-select-search-wrap) .multi-select-toolbar {
    top: 2.75rem;
}
.multi-select-options {
    padding: 0.35rem 0;
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
}
.multi-select-option:hover {
    background: var(--bg-subtle);
}
.multi-select-option input {
    flex-shrink: 0;
}
.multi-select-option-text {
    flex: 1;
    min-width: 0;
}

.message-audience-fieldset .message-audience-intro {
    margin: 0 0 0.85rem;
}

.message-audience-shell {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

.message-audience-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.message-audience-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: min(100%, 20rem);
}

.message-audience-search-wrap {
    flex: 1;
    min-width: 12rem;
    max-width: 22rem;
}

.message-audience-search {
    width: 100%;
    font-size: 0.8125rem;
}

.message-audience-filter {
    width: auto;
    min-width: 10rem;
    font-size: 0.8125rem;
}

.message-audience-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.message-audience-stats {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 0.35rem;
    white-space: nowrap;
}

.message-audience-table-wrap {
    max-height: min(62vh, 32rem);
    overflow: auto;
    background: #fff;
}

.message-audience-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.message-audience-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef2f7;
    border-bottom: 1px solid var(--border-strong);
    padding: 0.65rem 0.75rem;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.message-audience-table tbody td {
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

.message-audience-row:hover td {
    background: rgba(248, 250, 252, 0.85);
}

.message-audience-row.is-configured td {
    background: rgba(219, 234, 254, 0.22);
}

.message-audience-row.is-configured:hover td {
    background: rgba(219, 234, 254, 0.35);
}

.message-audience-table .col-reseller { min-width: 14rem; width: 38%; }
.message-audience-table .col-panel { width: 6.5rem; text-align: center; }
.message-audience-table .col-vpn { min-width: 13rem; width: 34%; }
.message-audience-table .col-actions { width: 7.5rem; text-align: center; }

.message-audience-name-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-right: calc(var(--audience-depth, 0) * 1.1rem);
    min-width: 0;
}

.message-audience-branch-toggle,
.message-audience-branch-spacer {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.message-audience-branch-toggle {
    border: 0;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.message-audience-branch-toggle.is-collapsed svg {
    transform: rotate(-90deg);
}

.message-audience-name-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.message-audience-name-text strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.message-audience-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.message-audience-vpn-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.message-audience-vpn-select {
    min-width: 6.5rem;
    max-width: 8.5rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.8125rem;
}

.message-audience-vpn-picker {
    position: relative;
    flex: 1;
    min-width: 8rem;
}

.message-audience-vpn-picker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-secondary);
}

.message-audience-vpn-picker-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-audience-vpn-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    min-width: 14rem;
    max-height: 14rem;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
}

.message-audience-vpn-search {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.message-audience-vpn-panel-actions {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.message-audience-vpn-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
}

.message-audience-vpn-option:hover {
    background: var(--bg-subtle);
}

.message-audience-no-vpn,
.message-audience-no-action {
    color: var(--muted);
    font-size: 0.8125rem;
}

.message-audience-bulk-wrap {
    position: relative;
    display: inline-block;
}

.message-audience-bulk-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 11rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.message-audience-bulk-panel button {
    border: 0;
    background: transparent;
    text-align: right;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text);
}

.message-audience-bulk-panel button:hover {
    background: var(--bg-subtle);
}

.message-audience-summary {
    margin: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(37, 99, 235, 0.06);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.message-audience-summary.is-empty {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .message-audience-table-wrap {
        overflow-x: auto;
    }
    .message-audience-table {
        min-width: 42rem;
    }
}

.changelog-feed-card .card-body {
    padding: 0;
}

.changelog-page {
    max-width: 52rem;
    margin: 0 auto;
}

.changelog-feed-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.changelog-feed-header h3 {
    margin: 0;
}

.changelog-feed-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.changelog-entry-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem 1.25rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, box-shadow 0.15s;
    border-right: 3px solid transparent;
}

.changelog-entry-card:last-child {
    border-bottom: 0;
}

.changelog-entry-card:hover {
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.95) 0%, #fff 100%);
}

.changelog-entry-card--feature {
    border-right-color: #93c5fd;
}

.changelog-entry-card--fix {
    border-right-color: #fdba74;
}

.changelog-entry-card--feature:hover {
    background: linear-gradient(90deg, rgba(239, 246, 255, 0.7) 0%, #fff 100%);
}

.changelog-entry-card--fix:hover {
    background: linear-gradient(90deg, rgba(255, 247, 237, 0.7) 0%, #fff 100%);
}

.changelog-entry-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 3.25rem;
    padding: 0.45rem 0.35rem;
    border-radius: var(--radius);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}

.changelog-entry-card--feature .changelog-entry-type {
    background: rgba(219, 234, 254, 0.45);
    border-color: #bfdbfe;
}

.changelog-entry-card--fix .changelog-entry-type {
    background: rgba(255, 237, 213, 0.45);
    border-color: #fed7aa;
}

.changelog-type-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.changelog-type-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.changelog-entry-main {
    min-width: 0;
}

.changelog-entry-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
}

.changelog-entry-excerpt {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.changelog-entry-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.changelog-entry-date {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.changelog-entry-arrow {
    display: inline-flex;
    color: var(--accent);
    opacity: 0.55;
    transition: opacity 0.15s, transform 0.15s;
}

.changelog-entry-card:hover .changelog-entry-arrow {
    opacity: 1;
    transform: translateX(-2px);
}

.changelog-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: var(--muted);
}

.changelog-empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.65;
}

.changelog-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Article page */
.changelog-article-page {
    max-width: 44rem;
}

.changelog-article-card {
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.changelog-article-hero {
    padding: 1.5rem 1.75rem 1.35rem;
    border-bottom: 1px solid var(--border-strong);
}

.changelog-article-hero--feature {
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 55%, #fff 100%);
}

.changelog-article-hero--fix {
    background: linear-gradient(180deg, #fff7ed 0%, #f8fafc 55%, #fff 100%);
}

.changelog-article-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.changelog-article-type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
}

.changelog-article-hero .changelog-article-title {
    margin: 0 0 0.65rem;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: var(--text);
}

.changelog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.changelog-article-body-wrap {
    padding: 1.35rem 1.75rem !important;
}

.changelog-article-body {
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--text);
    padding: 1.15rem 1.25rem;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.changelog-article-footer {
    padding: 0.85rem 1.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

@media (max-width: 640px) {
    .changelog-entry-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }
    .changelog-entry-aside {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding-top: 0.35rem;
        border-top: 1px dashed var(--border);
    }
    .changelog-article-hero,
    .changelog-article-body-wrap,
    .changelog-article-footer {
        padding-left: 1.15rem !important;
        padding-right: 1.15rem !important;
    }
}

/* Communications settings tabs */
.comm-settings-card .form-tabs {
    margin: 0;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
}

.comm-settings-panel {
    padding-top: 0.25rem;
}

.comm-settings-panel .form-section-title {
    margin-top: 0;
}

.comm-settings-intro {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.comm-settings-block {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
}

.comm-settings-block-title {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.comm-settings-preview {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.comm-settings-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.menu-ticket-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.menu-ticket-badge-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.menu-ticket-badge-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.menu-ticket-badge-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.proxy-subscription-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 520px;
    margin: 0 auto;
}

.proxy-subscriptions-card .panel-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.proxy-subscription-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted, #f8fafc);
}

.proxy-subscription-row:last-child {
    padding-bottom: 1rem;
}

.proxy-subscription-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.65rem;
    text-align: center;
}

.proxy-subscription-url {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.proxy-subscription-url .field-input {
    flex: 1;
    min-width: 220px;
}

.proxy-connection-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    text-align: center;
}

.proxy-connection-block-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
}

.proxy-connection-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.proxy-connection-grid-compact {
    flex-direction: column;
}

.proxy-connection-qr .wg-qr-box,
.proxy-connection-qr svg {
    max-width: 148px;
    width: 148px;
    height: 148px;
    margin: 0 auto;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.proxy-config-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.proxy-config-link-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    background: var(--surface-muted, #f8fafc);
    text-align: center;
}

.proxy-config-link-head {
    margin-bottom: 0.5rem;
}

.proxy-connection-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
}

.proxy-connection-actions .field-input {
    width: 100%;
    font-size: 0.75rem;
    text-align: center;
}

.proxy-connection-actions .backup-btn-row {
    justify-content: center;
}

.comm-settings-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comm-settings-actions {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.changelog-feed-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.changelog-entry-audience {
    margin-top: 0.35rem;
}

.commercial-license-bar {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
    border-bottom: 1px solid rgba(59, 130, 246, 0.25);
    padding: 0.55rem 1.25rem;
    font-size: 0.8125rem;
}

.commercial-license-bar--warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.06));
    border-bottom-color: rgba(245, 158, 11, 0.35);
}

.commercial-license-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.commercial-license-bar-title {
    font-weight: 700;
}

.commercial-license-bar-alert {
    color: #b45309;
    font-weight: 600;
}

.commercial-license-bar-link {
    margin-right: auto;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.commercial-license-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.commercial-license-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.panel-card-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.license-plan-shop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.license-plan-shop--wide {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.license-plan-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    padding: 1.1rem 1.15rem;
    background: var(--surface-elevated, #fff);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.license-plan-card--expandable.is-open {
    grid-column: 1 / -1;
    padding: 1.35rem 1.5rem;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.08);
}

.license-plan-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.license-plan-card-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.license-plan-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    background: var(--surface-muted, #f3f4f6);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.license-plan-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary);
}

.license-plan-note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.license-plan-buy {
    margin-top: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}

.license-plan-pay-summary {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface-muted, #f8fafc);
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--border);
}

.license-plan-pay-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.license-plan-pay-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.license-plan-pay-amount {
    font-size: 1.25rem;
    color: var(--primary);
}

.license-plan-confirm-box {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    background: #fffbeb;
}

.license-plan-pay-form .field-input {
    font-size: 0.9375rem;
    padding: 0.65rem 0.75rem;
}

.license-plan-wallet-input {
    font-size: 0.875rem !important;
    padding: 0.75rem 0.85rem !important;
    word-break: break-all;
}

.license-plan-wallet-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.license-plan-wallet-row .field-input {
    flex: 1;
    font-size: 0.75rem;
    direction: ltr;
    text-align: left;
}

.license-plan-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.license-plan-admin-tile {
    min-height: 0;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.license-plan-admin-tile.is-editing {
    grid-column: 1 / -1;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.08);
    padding: 1.25rem 1.35rem;
}

.license-plan-admin-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.license-plan-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.license-plan-admin-actions .inline-form {
    display: inline;
}

.license-plan-wallet-preview {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.85;
}

.license-plan-admin-edit {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.license-plan-admin-form .field-label {
    font-size: 0.8125rem;
}

.license-plan-admin-form .field-input {
    font-size: 0.875rem;
    padding: 0.5rem 0.65rem;
}

.license-plan-admin-form .field-hint {
    font-size: 0.75rem;
}

.btn-danger-text {
    color: var(--danger, #dc2626);
}

.btn-danger-text:hover {
    color: #b91c1c;
    background: #fef2f2;
}

.license-plan-admin-card {
    padding: 1rem;
}

.license-plan-admin-delete {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.payment-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.payment-review-actions .inline-form {
    display: inline;
}

.text-muted-sm {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--danger, #ef4444);
    color: #fff;
    border-radius: 999px;
}

.nav-badge-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: auto;
}

.nav-link > .nav-badge:not(.nav-badge-group .nav-badge) {
    margin-right: auto;
}

.nav-badge-red {
    background: var(--danger, #ef4444);
}

.nav-badge-new {
    animation: nav-badge-blink 1.1s ease-in-out infinite;
    font-size: 0.625rem;
    letter-spacing: 0.02em;
    padding: 0 0.4rem;
}

@keyframes nav-badge-blink {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { opacity: 0.75; transform: scale(1.05); box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.45); }
}

.nav-badge-green {
    background: #16a34a;
}

.nav-badge-slate {
    background: #334155;
}

.nav-count-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    margin-right: auto;
    border-radius: 9999px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.nav-count-bubble--users {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 1px solid rgba(147, 197, 253, 0.35);
}

.nav-count-bubble--online {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(110, 231, 183, 0.35);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.nav-count-bubble--zero {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    box-shadow: none;
}

.nav-link.active .nav-count-bubble--users {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.nav-link.active .nav-count-bubble--online {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.nav-count-bubble[data-wide="1"] {
    min-width: 2rem;
    font-size: 0.58rem;
}

.system-settings-tabs a.backup-tab { text-decoration: none; display: inline-flex; align-items: center; }




/* Settings hub + nav */
.settings-links-list { display: flex; flex-direction: column; gap: 0; }
.settings-link-row {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.85rem 0; border-bottom: 1px solid var(--border, #e2e8f0);
    text-decoration: none; color: inherit; transition: color 0.15s;
}
.settings-links-list .settings-link-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-links-list .settings-link-row:first-child { padding-top: 0; }
.settings-link-row:hover .settings-link-title { color: var(--accent, #4f46e5); }
.settings-link-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary, #0f172a); }
.settings-link-desc { font-size: 0.78rem; line-height: 1.45; color: var(--text-muted, #64748b); }
.panel-settings-nav-card .panel-card-body { padding: 0.85rem 1rem; }
.panel-settings-nav-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.panel-settings-nav-group { display: block; }
.panel-settings-nav-label {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
    color: var(--text-muted, #64748b); margin-bottom: 0.4rem;
}
.panel-settings-nav-group .backup-tabs-nav {
    padding: 0; border: none; box-shadow: none; background: transparent; margin: 0;
}
.commercial-admin-tabs a.backup-tab,
.system-settings-tabs a.backup-tab { text-decoration: none; display: inline-flex; align-items: center; }
.settings-hub-back-link { display: inline-flex; align-items: center; font-size: 0.85rem; font-weight: 500; color: #4f46e5; text-decoration: none; }
.settings-hub-back-link:hover { text-decoration: underline; }

@media (min-width: 1024px) {
    .settings-sidebar-backdrop { display: none !important; }
}

/* ─── Dashboard Pro ─── */
.dash-pro { display: flex; flex-direction: column; gap: 1.35rem; }

.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius-lg) + 4px);
    padding: 1.5rem 1.65rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 42%, #312e81 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    color: #e2e8f0;
}

.dash-hero-glow {
    position: absolute;
    top: -50%;
    left: -15%;
    width: 50%;
    height: 160%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 65%);
    pointer-events: none;
}

.dash-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
}

.dash-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: #c7d2fe;
}

.dash-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
}

.dash-live-dot.system-live-pulse { animation: dash-pulse 0.45s ease; }

@keyframes dash-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.75; }
}

.dash-hero-title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.dash-hero-desc {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.65;
    color: #94a3b8;
    max-width: 520px;
}

.dash-hero-alert {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
    font-size: 0.78rem;
    font-weight: 600;
}

.dash-hero-side { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }

.dash-hero-stat-ring {
    position: relative;
    width: 120px;
    height: 120px;
    --ring-circ: 326.7;
}

.dash-hero-stat-ring svg { transform: rotate(-90deg); }

.dash-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 10;
}

.dash-ring-fill {
    fill: none;
    stroke: #818cf8;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: var(--ring-circ);
    stroke-dashoffset: calc(var(--ring-circ) - (var(--ring-circ) * var(--health-pct, 0) / 100));
    transition: stroke-dashoffset 0.6s ease;
}

.dash-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    text-align: center;
}

.dash-ring-center strong { font-size: 1.35rem; color: #f8fafc; }
.dash-ring-center span { font-size: 0.62rem; color: #94a3b8; }

.dash-hero-mini {
    display: flex;
    gap: 1rem;
    text-align: center;
}

.dash-hero-mini div { display: flex; flex-direction: column; gap: 0.1rem; }
.dash-hero-mini strong { font-size: 0.9rem; color: #f1f5f9; }
.dash-hero-mini span { font-size: 0.62rem; color: #64748b; }

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 0.85rem;
}

.dash-kpi-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    border-radius: calc(var(--radius) + 2px);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s, box-shadow 0.18s;
}

.dash-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dash-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--dash-accent, var(--accent));
}

.dash-kpi-card.accent-blue { --dash-accent: #3b82f6; }
.dash-kpi-card.accent-green { --dash-accent: #10b981; }
.dash-kpi-card.accent-red { --dash-accent: #ef4444; }
.dash-kpi-card.accent-orange { --dash-accent: #f59e0b; }
.dash-kpi-card.accent-purple { --dash-accent: #8b5cf6; }
.dash-kpi-card.accent-slate { --dash-accent: #64748b; }

.dash-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--dash-accent) 12%, transparent);
    color: var(--dash-accent);
    flex-shrink: 0;
}

.dash-kpi-icon svg { width: 1.25rem; height: 1.25rem; }

.dash-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.dash-kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
}

.dash-kpi-value.dash-kpi-flash { animation: dash-kpi-flash 0.6s ease; }

@keyframes dash-kpi-flash {
    0%, 100% { color: var(--text); }
    50% { color: var(--dash-accent); }
}

.dash-kpi-spark {
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--dash-accent) 8%, transparent);
    pointer-events: none;
}

.dash-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.25rem;
    align-items: start;
}

.dash-main-primary .system-status-card { margin-bottom: 0 !important; }

.dash-side-card { margin-bottom: 0; }

.dash-side-card + .dash-side-card { margin-top: 1rem; }

.dash-user-mix { display: flex; flex-direction: column; gap: 0.55rem; }

.dash-user-mix-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
}

.dash-mix-label { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-secondary); }

.dash-mix-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dash-mix-active { background: #10b981; }
.dash-mix-online { background: #6366f1; }
.dash-mix-expired { background: #f59e0b; }
.dash-mix-disabled { background: #ef4444; }

.dash-mix-bar {
    display: flex;
    height: 8px;
    border-radius: 9999px;
    overflow: hidden;
    background: var(--surface-muted);
    margin-top: 0.85rem;
}

.dash-mix-seg { height: 100%; min-width: 2px; transition: width 0.4s ease; }
.dash-mix-seg-active { background: #10b981; }
.dash-mix-seg-expired { background: #f59e0b; }
.dash-mix-seg-disabled { background: #ef4444; }

.dash-quick-links { display: flex; flex-direction: column; gap: 0.35rem; }

.dash-quick-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.dash-quick-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.dash-quick-link span:first-child { font-size: 1rem; line-height: 1; }

.dash-chart-card { margin-bottom: 0; margin-top: 1.25rem; }

.dash-chart-sub { margin: 0.25rem 0 0 !important; }

.dash-chart-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

.dash-chart-wrap { height: 340px; }

@media (max-width: 1100px) {
    .dash-main-grid { grid-template-columns: 1fr; }
    .dash-hero-grid { grid-template-columns: 1fr; }
    .dash-hero-side { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 640px) {
    .dash-hero { padding: 1.15rem; }
    .dash-kpi-value { font-size: 1.15rem; }
    .dash-chart-wrap { height: 260px; }
}

/* ═══════════════════════════════════════════════════════════════
   Panel UI Pro v2 — Nav, Settings Hub, Tables, Tabs
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 28%),
        linear-gradient(165deg, #0a0e18 0%, #0f172a 55%, #111827 100%);
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
}

.sidebar-brand {
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-search-wrap {
    padding: 0.65rem 0.85rem 0.25rem;
}

.sidebar-search-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color var(--transition), background var(--transition);
}

.sidebar-search-label:focus-within {
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-search-label svg {
    width: 16px;
    height: 16px;
    color: #64748b;
    flex-shrink: 0;
}

.sidebar-search {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.78rem;
    outline: none;
}

.sidebar-search::placeholder { color: #64748b; }

.nav-group-label {
    color: #64748b;
    letter-spacing: 0.08em;
    padding-right: 0.65rem;
}

.nav-link {
    border: 1px solid transparent;
    margin-bottom: 3px;
}

.nav-link svg {
    width: 17px;
    height: 17px;
    padding: 6px;
    box-sizing: content-box;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0.85;
}

.nav-link:hover svg {
    background: rgba(99, 102, 241, 0.16);
    color: #c7d2fe;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.05));
    border-color: rgba(129, 140, 248, 0.22);
    box-shadow: inset 3px 0 0 #818cf8;
}

.nav-link.active svg {
    background: rgba(99, 102, 241, 0.28);
    color: #e0e7ff;
}

.nav-link-hidden { display: none !important; }
.nav-group-hidden { display: none !important; }

.nav-badge {
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.28));
    backdrop-filter: blur(8px);
}

.sidebar-user-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-blog-card {
    margin: 0 0 0.65rem;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}

.sidebar-blog-card:hover {
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(99, 102, 241, 0.12);
}

.sidebar-blog-text,
.sidebar-blog-text strong { color: inherit; }
.sidebar-blog-text strong { color: #f1f5f9; }

.sidebar-logout-btn {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

.topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

.topbar-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    background: rgba(79, 70, 229, 0.08);
    color: #6366f1;
    font-weight: 600;
    font-size: 0.7rem;
}

.topbar-conn-btn {
    border-radius: 9999px;
    box-shadow: var(--shadow-xs);
}

.page-welcome-pro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.4rem;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #eef2ff 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.page-welcome:not(.page-welcome-pro) {
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.settings-hub-back,
.settings-hub-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    white-space: nowrap;
}

.settings-hub-back-sm { font-size: 0.78rem; }
.settings-hub-back:hover,
.settings-hub-back-link:hover { text-decoration: underline; }

.settings-hub-section { margin-bottom: 1.35rem; }

.settings-hub-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-transform: uppercase;
}

.settings-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 0.85rem;
}

.settings-hub-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    border-radius: calc(var(--radius) + 2px);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.settings-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.35);
}

.settings-hub-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.settings-hub-icon-indigo { background: rgba(99, 102, 241, 0.12); }
.settings-hub-icon-emerald { background: rgba(16, 185, 129, 0.12); }
.settings-hub-icon-sky { background: rgba(14, 165, 233, 0.12); }
.settings-hub-icon-violet { background: rgba(139, 92, 246, 0.12); }
.settings-hub-icon-amber { background: rgba(245, 158, 11, 0.12); }
.settings-hub-icon-teal { background: rgba(20, 184, 166, 0.12); }
.settings-hub-icon-blue { background: rgba(59, 130, 246, 0.12); }
.settings-hub-icon-orange { background: rgba(249, 115, 22, 0.12); }
.settings-hub-icon-rose { background: rgba(244, 63, 94, 0.12); }

.settings-hub-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }

.settings-hub-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.settings-hub-desc {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--muted);
}

.settings-subnav-pro .panel-card-header {
    align-items: flex-start;
}

.settings-subnav-desc { margin: 0.25rem 0 0; }

.settings-subnav-pro .panel-settings-nav-wrap {
    gap: 1rem;
}

.settings-subnav-pro .panel-settings-nav-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-pills-pro.backup-tabs-nav {
    padding: 0.65rem;
    gap: 0.4rem;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-color: var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-pills-pro .backup-tab {
    border-radius: 10px;
    padding: 0.48rem 0.9rem;
    font-size: 0.78rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nav-pills-pro .backup-tab.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}

.nav-pills-pro .backup-tab.active .badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.panel-card {
    border-radius: calc(var(--radius-lg) + 2px);
}

.panel-card-header {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
}

.panel-table thead {
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.panel-table th {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 1px solid #cbd5e1;
}

.panel-table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

.stat-card {
    border-radius: calc(var(--radius-lg) + 2px);
    border-color: var(--border);
}

.stat-card::after {
    opacity: 0.35;
}

.row-action-menu-dropdown {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.alert {
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
}

.btn-primary {
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.22);
}

@media (max-width: 1024px) {
    .sidebar.open { box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35); }
    .page-welcome-pro { flex-direction: column; }
}

/* Portal Pro — فاز بعدی UI */
.portal-shell {
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(99, 102, 241, 0.1), transparent),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(6, 182, 212, 0.08), transparent),
        var(--bg);
}

.portal-login-card,
.portal-dashboard-card {
    border-radius: calc(var(--radius-lg) + 4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.guest-body {
    background:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(99, 102, 241, 0.12), transparent),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(6, 182, 212, 0.08), transparent),
        #0f172a;
}

/* ═══════════════════════════════════════════════════════════════
   Settings Workspace Pro — sidebar داخلی + hub + page header
   ═══════════════════════════════════════════════════════════════ */

.settings-workspace {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 1.35rem;
    align-items: start;
    margin: -0.35rem -0.25rem 0;
}

.settings-sidebar {
    position: sticky;
    top: 1rem;
    z-index: 30;
    max-height: calc(100vh - 7rem);
    border-radius: calc(var(--radius-lg) + 4px);
    background: linear-gradient(165deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
    border: 1px solid rgba(129, 140, 248, 0.22);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.settings-sidebar-inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
}

.settings-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #e2e8f0;
    min-width: 0;
    flex: 1;
    padding: 0.35rem;
    margin: -0.35rem;
    border-radius: 12px;
    transition: background 0.15s;
}

.settings-sidebar-brand:hover { background: rgba(255, 255, 255, 0.05); }
.settings-sidebar-brand.is-active { background: rgba(99, 102, 241, 0.18); }

.settings-sidebar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 11px;
    background: rgba(99, 102, 241, 0.28);
    color: #c7d2fe;
    flex-shrink: 0;
}

.settings-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.settings-sidebar-brand-text strong {
    font-size: 0.88rem;
    font-weight: 800;
    color: #f8fafc;
}

.settings-sidebar-brand-text small {
    font-size: 0.68rem;
    color: #94a3b8;
}

.settings-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    cursor: pointer;
}

.settings-sidebar-search-wrap {
    position: relative;
    padding: 0.75rem 1rem 0.5rem;
}

.settings-sidebar-search-icon {
    position: absolute;
    top: 50%;
    right: 1.55rem;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.settings-sidebar-search-icon .settings-nav-icon { width: 15px; height: 15px; }

.settings-sidebar-search {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.15rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.settings-sidebar-search:focus {
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(255, 255, 255, 0.08);
}

.settings-sidebar-search::placeholder { color: #64748b; }

.settings-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 0.65rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.settings-sidebar-group { margin-bottom: 0.85rem; }

.settings-sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.35rem 0.55rem 0.45rem;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: right;
}

.settings-sidebar-group-label {
    padding: 0;
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.settings-sidebar-group-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.settings-sidebar-group.is-expanded .settings-sidebar-group-chevron {
    transform: rotate(180deg);
}

@media (min-width: 1025px) {
    .settings-sidebar-group:not(.is-expanded) .settings-sidebar-list {
        display: none;
    }
}

.settings-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.settings-sidebar-link {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.65rem;
    border-radius: 11px;
    text-decoration: none;
    color: #cbd5e1;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.settings-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.settings-sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.08));
    border-color: rgba(129, 140, 248, 0.28);
    color: #f8fafc;
    box-shadow: inset 3px 0 0 #818cf8;
}

.settings-sidebar-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    flex-shrink: 0;
}

.settings-sidebar-link-icon .settings-nav-icon { width: 16px; height: 16px; }

.settings-sidebar-link-body {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    flex: 1;
}

.settings-sidebar-link-title {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
}

.settings-sidebar-link-desc {
    font-size: 0.67rem;
    line-height: 1.45;
    color: #94a3b8;
}

.settings-sidebar-link.is-active .settings-sidebar-link-desc { color: #c7d2fe; }

.settings-sidebar-link-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #818cf8;
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.8);
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.settings-sidebar-foot {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-sidebar-tip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.68rem;
    line-height: 1.55;
    color: #94a3b8;
}

.settings-sidebar-tip strong { color: #e2e8f0; font-size: 0.72rem; }

.settings-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 105;
    display: none;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.22s;
}

.settings-sidebar-backdrop.is-active {
    display: block;
}

.settings-sidebar-backdrop.is-visible { opacity: 1; }

.settings-main { min-width: 0; }

.settings-main-toolbar {
    display: none;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.settings-mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-raised);
    color: var(--text);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.settings-main-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
}

.settings-main-back:hover { text-decoration: underline; }

.settings-hub-pro { display: flex; flex-direction: column; gap: 1.25rem; }

.settings-hub-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.45rem;
    border-radius: calc(var(--radius-lg) + 4px);
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 42%, #4338ca 100%);
    border: 1px solid rgba(129, 140, 248, 0.25);
    box-shadow: 0 18px 45px rgba(67, 56, 202, 0.18);
    color: #e2e8f0;
}

.settings-hub-hero-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    font-weight: 800;
    color: #f8fafc;
}

.settings-hub-hero-desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.65;
    color: #94a3b8;
    max-width: 520px;
}

.settings-hub-search-wrap {
    position: relative;
    min-width: min(100%, 280px);
    flex: 1;
    max-width: 340px;
}

.settings-hub-search-icon {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #64748b;
}

.settings-hub-search-icon .settings-nav-icon { width: 16px; height: 16px; }

.settings-hub-search {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.35rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
}

.settings-hub-search:focus { border-color: rgba(199, 210, 254, 0.45); }
.settings-hub-search::placeholder { color: #64748b; }

.settings-hub-card-pro {
    position: relative;
    overflow: hidden;
}

.settings-hub-card-pro::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--settings-accent, #6366f1);
    opacity: 0;
    transition: opacity 0.18s;
}

.settings-hub-card-pro:hover::before { opacity: 1; }

.settings-hub-arrow {
    margin-right: auto;
    font-size: 0.9rem;
    color: var(--muted);
    opacity: 0.5;
    transition: transform 0.18s, opacity 0.18s;
}

.settings-hub-card-pro:hover .settings-hub-arrow {
    transform: translateX(-4px);
    opacity: 1;
    color: #6366f1;
}

.settings-hub-empty {
    margin: 0;
    padding: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.settings-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding: 1.1rem 1.25rem;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #eef2ff 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.settings-page-header-main {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
}

.settings-page-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 13px;
    flex-shrink: 0;
}

.settings-page-header-icon .settings-nav-icon { width: 20px; height: 20px; }

.settings-page-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.settings-page-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--muted);
}

.settings-nav-icon { display: block; }

.settings-accent-indigo { background: rgba(99, 102, 241, 0.16); color: #6366f1; --settings-accent: #6366f1; }
.settings-accent-violet { background: rgba(139, 92, 246, 0.16); color: #8b5cf6; --settings-accent: #8b5cf6; }
.settings-accent-sky { background: rgba(14, 165, 233, 0.16); color: #0ea5e9; --settings-accent: #0ea5e9; }
.settings-accent-cyan { background: rgba(6, 182, 212, 0.16); color: #06b6d4; --settings-accent: #06b6d4; }
.settings-accent-amber { background: rgba(245, 158, 11, 0.16); color: #f59e0b; --settings-accent: #f59e0b; }
.settings-accent-emerald { background: rgba(16, 185, 129, 0.16); color: #10b981; --settings-accent: #10b981; }
.settings-accent-blue { background: rgba(59, 130, 246, 0.16); color: #3b82f6; --settings-accent: #3b82f6; }
.settings-accent-rose { background: rgba(244, 63, 94, 0.16); color: #f3445e; --settings-accent: #f3445e; }
.settings-accent-purple { background: rgba(168, 85, 247, 0.16); color: #a855f7; --settings-accent: #a855f7; }

body.settings-nav-open { overflow: hidden; }

/* Sidebar Pro v3 — تغییرات محسوس‌تر */
.sidebar.sidebar-pro {
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.14) 0%, transparent 32%),
        linear-gradient(165deg, #070b14 0%, #0f172a 50%, #1e1b4b 100%);
    box-shadow: -12px 0 48px rgba(15, 23, 42, 0.35);
    border-left-color: rgba(129, 140, 248, 0.18);
}

.sidebar.sidebar-pro .sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar.sidebar-pro .sidebar-brand-icon {
    background: linear-gradient(135deg, #6366f1, #4338ca);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.sidebar.sidebar-pro .nav-link {
    border-radius: 11px;
    margin: 0 0.5rem 4px;
    padding-right: 0.75rem;
}

.sidebar.sidebar-pro .nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.32), rgba(99, 102, 241, 0.06));
    box-shadow: inset 4px 0 0 #a5b4fc, 0 4px 14px rgba(99, 102, 241, 0.12);
}

.sidebar.sidebar-pro .nav-group-label {
    padding-right: 1.1rem;
    margin-top: 0.35rem;
}

@media (max-width: 1024px) {
    .settings-workspace {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(100vw - 2rem, 320px);
        max-height: none;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform 0.24s ease, visibility 0.24s ease;
        z-index: 110;
        visibility: hidden;
        pointer-events: none;
    }

    .settings-sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .settings-sidebar-inner { max-height: 100vh; }

    .settings-sidebar-close { display: inline-flex; }

    .settings-main-toolbar { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════
   Panel Nav Pro v4 — همه سایدبارها و منوهای تب/لیست
   ═══════════════════════════════════════════════════════════════ */

:root {
    --nav-pro-rail: #a5b4fc;
    --nav-pro-glow: rgba(99, 102, 241, 0.22);
    --nav-pro-chip: rgba(255, 255, 255, 0.06);
}

.sidebar.sidebar-pro-v4 {
    width: var(--sidebar-w);
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(99, 102, 241, 0.2), transparent 55%),
        radial-gradient(ellipse 80% 50% at 0% 100%, rgba(6, 182, 212, 0.08), transparent 50%),
        linear-gradient(180deg, #060a12 0%, #0c1222 38%, #121a32 100%);
    border-left: 1px solid rgba(129, 140, 248, 0.22);
    box-shadow: -16px 0 56px rgba(2, 6, 23, 0.45);
}

.sidebar.sidebar-pro-v4::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
    z-index: 0;
}

.sidebar.sidebar-pro-v4 > * { position: relative; z-index: 1; }

.sidebar.sidebar-pro-v4 .sidebar-brand {
    padding: 0.75rem 0.8rem 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
}

.sidebar.sidebar-pro-v4 .sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, #818cf8 0%, #6366f1 45%, #4338ca 100%);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar.sidebar-pro-v4 .sidebar-brand-text {
    font-size: 0.9rem;
    font-weight: 800;
    background: linear-gradient(90deg, #f8fafc, #c7d2fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar.sidebar-pro-v4 .sidebar-search-wrap { padding: 0.35rem 0.65rem 0.2rem; }

.sidebar.sidebar-pro-v4 .sidebar-search-label {
    padding: 0.42rem 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar.sidebar-pro-v4 .sidebar-search-label:focus-within {
    border-color: rgba(165, 180, 252, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.sidebar.sidebar-pro-v4 .sidebar-nav {
    padding: 0.4rem 0.4rem 0.55rem;
    mask-image: none;
}

.sidebar.sidebar-pro-v4 .nav-group { margin-bottom: 0.6rem; }

.sidebar.sidebar-pro-v4 .nav-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem 0.55rem;
    margin-bottom: 0.35rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #64748b;
}

.sidebar.sidebar-pro-v4 .nav-group-label::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
}

.sidebar.sidebar-pro-v4 .nav-group-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.25), transparent);
}

.sidebar.sidebar-pro-v4 .nav-link {
    min-height: 2rem;
    padding: 0.32rem 0.5rem;
    margin: 0 0.25rem 2px;
    border-radius: 9px;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    transition: background 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
}

.sidebar.sidebar-pro-v4 .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    transform: translateX(-2px);
}

.sidebar.sidebar-pro-v4 .nav-link > svg {
    width: 14px;
    height: 14px;
    padding: 4px;
    border-radius: 7px;
    background: var(--nav-pro-chip);
    border: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 1;
    color: #94a3b8;
}

.sidebar.sidebar-pro-v4 .nav-link:hover > svg {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

.sidebar.sidebar-pro-v4 .nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.08));
    color: #f8fafc;
    border-color: rgba(129, 140, 248, 0.28);
    box-shadow: inset 4px 0 0 var(--nav-pro-rail), 0 6px 20px var(--nav-pro-glow);
}

.sidebar.sidebar-pro-v4 .nav-link.active > svg {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.45), rgba(67, 56, 202, 0.35));
    color: #e0e7ff;
}

.sidebar.sidebar-pro-v4 .nav-link.danger { color: #fca5a5; }
.sidebar.sidebar-pro-v4 .nav-link.danger.active {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.06));
    box-shadow: inset 4px 0 0 #f87171;
}

.sidebar.sidebar-pro-v4 .nav-badge,
.sidebar.sidebar-pro-v4 .nav-count-bubble { margin-right: auto; }

.sidebar.sidebar-pro-v4 .sidebar-footer {
    padding: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(16px);
}

.sidebar.sidebar-pro-v4 .sidebar-user-card {
    padding: 0.55rem;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar.sidebar-pro-v4 .sidebar-avatar {
    background: linear-gradient(145deg, #6366f1, #4338ca);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.sidebar.sidebar-pro-v4 .sidebar-blog-card {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.04));
    border-color: rgba(129, 140, 248, 0.2);
}

.settings-sidebar.settings-sidebar-pro {
    background:
        radial-gradient(ellipse 100% 70% at 100% 0%, rgba(99, 102, 241, 0.22), transparent 50%),
        linear-gradient(180deg, #0a0f1c 0%, #111827 50%, #1a1f3a 100%);
    border-color: rgba(129, 140, 248, 0.28);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}

.settings-sidebar-pro .settings-sidebar-brand-icon {
    background: linear-gradient(145deg, #818cf8, #4338ca);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.settings-sidebar-pro .settings-sidebar-group-label {
    display: block;
    flex: 1;
    text-align: right;
}

.settings-sidebar-pro .settings-sidebar-group-label::after {
    display: none;
}

.settings-sidebar-pro .settings-sidebar-link {
    border-radius: 12px;
    border: 1px solid transparent;
    transition: transform 0.16s, background 0.16s, box-shadow 0.16s;
}

.settings-sidebar-pro .settings-sidebar-link:hover { transform: translateX(-2px); }

.settings-sidebar-pro .settings-sidebar-link.is-active {
    box-shadow: inset 4px 0 0 var(--nav-pro-rail), 0 4px 16px var(--nav-pro-glow);
}

.backup-tabs-nav {
    gap: 0.35rem;
    padding: 0.45rem;
    background: linear-gradient(180deg, #f1f5f9 0%, #e8eef8 100%);
    border-radius: calc(var(--radius-lg) + 2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), var(--shadow-xs);
}

.backup-tab {
    padding: 0.52rem 1rem;
    border-radius: 11px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
}

.backup-tab:hover {
    background: rgba(255, 255, 255, 0.75);
    transform: translateY(-1px);
}

.backup-tab.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.32);
}

.nav-pills-pro.backup-tabs-nav,
.nav-menu-pro .backup-tabs-nav {
    background: linear-gradient(180deg, #eef2ff, #f8fafc);
    border-color: rgba(99, 102, 241, 0.15);
}

.nav-menu-pro.panel-settings-nav-card {
    border-radius: calc(var(--radius-lg) + 4px);
    box-shadow: var(--shadow-md);
}

.row-action-menu-dropdown {
    border-radius: 14px;
    padding: 0.35rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.uam-head {
    border-radius: 10px;
    background: linear-gradient(135deg, #f1f5f9, #eef2ff);
}

.uam-item { border-radius: 10px; font-weight: 600; }

@media (max-width: 1024px) {
    .sidebar.sidebar-pro-v4 { --sidebar-w: 248px; }
}

@media (min-width: 1025px) {
    .main-area { margin-right: var(--sidebar-w); }
}

/* ═══════════════════════════════════════════════════════════════
   Panel List Pro v1 — همه لیست‌ها و جداول پنل
   ═══════════════════════════════════════════════════════════════ */

.panel-list-pro,
.panel-card--table-only,
.panel-card:has(.panel-table) {
    --list-pro-accent: #6366f1;
    --list-pro-accent-dark: #4f46e5;
    --list-pro-header-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --list-pro-border: rgba(148, 163, 184, 0.35);
    border-radius: calc(var(--radius-lg) + 4px);
    border: 1px solid var(--list-pro-border);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    background: var(--surface-raised);
}

.panel-list-pro > .panel-card-header,
.panel-card--table-only > .panel-card-header,
.panel-card:has(.panel-table) > .panel-card-header {
    background: var(--list-pro-header-bg);
    border-bottom: 1px solid var(--list-pro-border);
    padding: 0.85rem 1.15rem;
    gap: 0.75rem;
}

.panel-list-pro > .panel-card-header h2,
.panel-card--table-only > .panel-card-header h2,
.panel-card:has(.panel-table) > .panel-card-header h2 {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.panel-list-pro > .panel-card-header .badge,
.panel-card--table-only > .panel-card-header .badge,
.panel-card:has(.panel-table) > .panel-card-header .badge {
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.panel-list-pro > .panel-card-header .badge-blue,
.panel-card--table-only > .panel-card-header .badge-blue,
.panel-card:has(.panel-table) > .panel-card-header .badge-blue {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
}

.panel-list-pro .panel-card-header-actions,
.panel-card--table-only .panel-card-header-actions,
.panel-card:has(.panel-table) .panel-card-header-actions {
    gap: 0.45rem;
}

.panel-list-pro .panel-table-wrap,
.panel-card--table-only .panel-table-wrap,
.panel-card:has(.panel-table) .panel-table-wrap {
    background: #fff;
}

.panel-list-pro .panel-table thead,
.panel-card--table-only .panel-table thead,
.panel-card:has(.panel-table) .panel-table thead {
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.panel-list-pro .panel-table th,
.panel-card--table-only .panel-table th,
.panel-card:has(.panel-table) .panel-table th {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 1px solid #cbd5e1;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.panel-list-pro .panel-table td,
.panel-card--table-only .panel-table td,
.panel-card:has(.panel-table) .panel-table td {
    border-bottom-color: rgba(226, 232, 240, 0.9);
}

.panel-list-pro .panel-table tbody tr,
.panel-card--table-only .panel-table tbody tr,
.panel-card:has(.panel-table) .panel-table tbody tr {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.panel-list-pro .panel-table tbody tr:hover td,
.panel-card--table-only .panel-table tbody tr:hover td,
.panel-card:has(.panel-table) .panel-table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

.panel-list-pro .panel-table tbody tr:last-child td,
.panel-card--table-only .panel-table tbody tr:last-child td,
.panel-card:has(.panel-table) .panel-table tbody tr:last-child td {
    border-bottom: none;
}

.panel-list-pro .panel-table-compact th,
.panel-card--table-only .panel-table-compact th,
.panel-card:has(.panel-table) .panel-table-compact th {
    padding: 0.3rem 0.4rem;
    font-size: 0.6rem;
}

.panel-list-pro .panel-table-compact td,
.panel-card--table-only .panel-table-compact td,
.panel-card:has(.panel-table) .panel-table-compact td {
    padding: 0.24rem 0.4rem;
    font-size: 0.625rem;
}

.panel-list-pro .empty-state,
.panel-card--table-only .empty-state,
.panel-card:has(.panel-table) .empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    background: linear-gradient(180deg, #fafafa, #f8fafc);
}

.panel-list-pro .panel-card-footer,
.panel-card--table-only .panel-card-footer {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-top: 1px solid var(--list-pro-border);
    padding: 0.75rem 1rem;
}

/* ─── Action bar Pro ─── */
.users-action-bar.panel-card {
    border-radius: calc(var(--radius-lg) + 2px);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    background: linear-gradient(180deg, #fff, #f8fafc);
    padding: 0.75rem 1rem;
}

.users-action-bar .users-action-btn {
    border-radius: 999px;
    padding: 0.48rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.users-action-bar .users-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    filter: brightness(1.05);
}

.users-action-bar .users-action-btn:active {
    transform: translateY(0);
}

/* ─── Filter bar Pro ─── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.15rem 0;
}

.filter-bar .field-input,
.filter-bar select.field-input {
    border-radius: 10px;
    border-color: rgba(148, 163, 184, 0.45);
    font-size: 0.8125rem;
    min-height: 2.25rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-bar .field-input:focus {
    border-color: var(--list-pro-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filter-bar .btn {
    border-radius: 10px;
    font-weight: 700;
}

/* ─── Color legend Pro ─── */
.table-color-legend-pro,
.panel-list-pro .table-color-legend,
.panel-card--table-only .table-color-legend,
.panel-list-pro + .table-color-legend,
.panel-card--table-only + .table-color-legend,
.panel-card:has(.panel-table) + .table-color-legend {
    background: linear-gradient(180deg, #f8fafc, #fff);
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.55rem 1rem;
    margin-top: 0;
    gap: 0.5rem 1rem;
}

.panel-list-pro .table-color-legend,
.panel-card--table-only .table-color-legend {
    border-radius: 0;
}

.panel-list-pro + .table-color-legend,
.panel-card--table-only + .table-color-legend,
.panel-card:has(.panel-table) + .table-color-legend {
    border-radius: 0 0 calc(var(--radius-lg) + 2px) calc(var(--radius-lg) + 2px);
}

.table-color-legend-pro .table-color-legend-item,
.panel-list-pro .table-color-legend .table-color-legend-item,
.panel-card--table-only .table-color-legend .table-color-legend-item,
.panel-list-pro + .table-color-legend .table-color-legend-item {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    padding: 0.2rem 0.65rem 0.2rem 0.45rem;
    font-weight: 600;
    font-size: 0.65rem;
    color: #475569;
}

.table-color-legend-pro .table-color-legend-swatch,
.panel-list-pro .table-color-legend .table-color-legend-swatch,
.panel-list-pro + .table-color-legend .table-color-legend-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.panel-list-pro .table-color-legend-swatch.row-online,
.panel-list-pro + .table-color-legend .table-color-legend-swatch.row-online {
    background: #dcfce7;
    box-shadow: inset 0 0 0 1px #22c55e;
}

.panel-list-pro .table-color-legend-swatch.row-multi-online,
.panel-list-pro + .table-color-legend .table-color-legend-swatch.row-multi-online {
    background: #e0f2fe;
    box-shadow: inset 0 0 0 1px #0ea5e9;
}

.panel-list-pro .table-color-legend-swatch.row-suspended,
.panel-list-pro + .table-color-legend .table-color-legend-swatch.row-suspended {
    background: #fee2e2;
    box-shadow: inset 0 0 0 1px #ef4444;
}

.panel-list-pro .table-color-legend-swatch.row-expired,
.panel-list-pro + .table-color-legend .table-color-legend-swatch.row-expired {
    background: #ffedd5;
    box-shadow: inset 0 0 0 1px #f97316;
}

/* ─── Pagination Pro ─── */
.panel-pagination-pro.panel-pagination-card,
.panel-list-pro .panel-pagination-card,
.panel-card--table-only .panel-pagination-card,
.panel-card-footer .panel-pagination-card {
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    gap: 0.65rem;
}

.panel-pagination-pro .panel-pagination-summary,
.panel-list-pro .panel-pagination-summary,
.panel-card-footer .panel-pagination-summary {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.panel-pagination-pro .panel-pagination-btn,
.panel-list-pro .panel-pagination-btn,
.panel-card-footer .panel-pagination-btn {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    min-width: 2.1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: all 0.12s ease;
}

.panel-pagination-pro .panel-pagination-btn:hover:not(.disabled):not(.active),
.panel-list-pro .panel-pagination-btn:hover:not(.disabled):not(.active) {
    border-color: var(--list-pro-accent);
    color: var(--list-pro-accent-dark);
    background: #eef2ff;
}

.panel-pagination-pro .panel-pagination-btn.active,
.panel-list-pro .panel-pagination-btn.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.panel-pagination-pro .panel-pagination-btn-nav,
.panel-list-pro .panel-pagination-btn-nav {
    padding-inline: 0.85rem;
}

/* ─── List footer (VPN users) ─── */
.list-table-footer {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0 0 calc(var(--radius-lg) + 2px) calc(var(--radius-lg) + 2px);
    padding: 0.85rem 1rem 1rem;
}

.list-table-per-page label {
    font-weight: 700;
    color: #475569;
}

.list-table-per-page .field-input {
    border-radius: 10px;
}

/* ─── Sessions online Pro ─── */
.sessions-online-page .live-stats--compact {
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: calc(var(--radius-lg) + 2px);
    padding: 0.65rem 1rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.sessions-online-page .live-stats--compact strong {
    color: var(--list-pro-accent-dark);
    font-size: 1rem;
}

.sessions-online-page.panel-list-pro,
.sessions-online-page > .panel-list-pro {
    margin-top: 0;
}

/* ─── Audit log Pro ─── */
.audit-log-table .badge {
    border-radius: 999px;
    font-weight: 700;
}

/* ─── Row actions Pro ─── */
.panel-list-pro .row-action-menu-btn,
.panel-card--table-only .row-action-menu-btn,
.panel-card:has(.panel-table) .row-action-menu-btn {
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.panel-list-pro .row-action-menu-btn:hover,
.panel-card--table-only .row-action-menu-btn:hover {
    border-color: var(--list-pro-accent);
    background: #eef2ff;
}

/* ─── Reports top users table ─── */
.top-users-table tbody tr:first-child td {
    font-weight: 700;
}

.top-users-table tbody tr:first-child td:first-child::before {
    content: '🏆 ';
}

/* ─── Changelog manage / card lists ─── */
.changelog-entry-card {
    border-radius: calc(var(--radius-lg) + 2px);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.changelog-entry-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* ─── Portal list ─── */
.portal-shell .panel-card:has(.panel-table) {
    border-radius: calc(var(--radius-lg) + 4px);
}

@media (max-width: 768px) {
    .panel-list-pro > .panel-card-header,
    .panel-card--table-only > .panel-card-header,
    .panel-card:has(.panel-table) > .panel-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .users-action-bar-inner {
        justify-content: center;
    }

    .users-action-bar-sep {
        display: none;
    }

    .users-action-bar .users-action-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
    }
}

/* ═══════════════════════════════════════════════════════════════
   Panel Responsive v2 — موبایل/تبلت (CSS-only، بدون تغییر backend)
   ═══════════════════════════════════════════════════════════════ */

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

body.sidebar-nav-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .topbar {
        height: auto;
        min-height: var(--topbar-h);
        flex-wrap: wrap;
        align-items: center;
        padding: 0.65rem 1rem;
        row-gap: 0.5rem;
    }

    .topbar-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-right {
        flex: 1 1 100%;
        flex-shrink: 1;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: 100%;
        gap: 0.45rem;
    }

    .topbar-title {
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-breadcrumb {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-actions {
        max-width: 100%;
        justify-content: flex-end;
    }

    .page-actions .btn {
        flex-shrink: 0;
    }

    .sidebar.sidebar-pro-v4 {
        width: min(100vw - 1.5rem, 300px);
    }

    .settings-workspace {
        margin: 0;
        gap: 0.85rem;
    }

    .settings-main {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    :root {
        --topbar-h: 64px;
    }

    .main-content {
        padding: 1rem 0.85rem 1.75rem;
    }

    .app-footer,
    .guest-footer,
    .portal-footer {
        padding: 0.75rem 1rem 1rem;
    }

    .stat-grid,
    .stat-grid-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .stat-card-value {
        font-size: 1.25rem;
    }

    .panel-card-header {
        flex-wrap: wrap;
        gap: 0.65rem;
        padding: 1rem 1.1rem;
    }

    .panel-card-body {
        padding: 1rem 1.1rem;
    }

    .panel-card-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
        scrollbar-width: thin;
    }

    .backup-tabs-nav,
    .nav-pills-pro.backup-tabs-nav,
    .form-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .backup-tab,
    .nav-pills-pro .backup-tab,
    .form-tab {
        flex-shrink: 0;
    }

    .backup-action-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: span 1;
    }

    .form-inline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline-row .field-input {
        min-width: 0;
        width: 100%;
    }

    .dash-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-hero-title {
        font-size: 1.35rem;
    }

    .dash-hero-side {
        width: 100%;
    }

    .panel-table-wrap,
    .panel-table-wrap--compact {
        -webkit-overflow-scrolling: touch;
        margin-inline: -0.85rem;
        border-radius: 0;
        border-right: none;
        border-left: none;
    }

    .panel-list-pro .panel-table-wrap,
    .panel-card--table-only .panel-table-wrap {
        margin-inline: -1.1rem;
    }

    .modal-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .modal-card,
    .confirm-modal-card,
    .telegram-bot-modal-card,
    .l2tp-info-modal-card,
    .proxy-qr-modal-card,
    .wg-qr-modal-card {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 1.5rem);
        max-height: calc(100dvh - 1.5rem);
    }

    .commercial-license-bar {
        padding: 0.55rem 0.85rem;
        font-size: 0.75rem;
    }

    .commercial-license-bar-link {
        margin-right: 0;
        width: 100%;
    }

    .kill-switch-banner,
    .read-only-banner {
        padding: 0.55rem 0.85rem;
        font-size: 0.75rem;
        line-height: 1.55;
    }

    .impersonation-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.65rem;
    }

    .impersonation-leave-form {
        display: flex;
        justify-content: center;
    }

    .users-quick-search {
        width: 100%;
    }

    .message-audience-table {
        min-width: 36rem;
    }

    .settings-hub-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar-right {
        justify-content: flex-start;
    }

    .topbar-conn-group {
        flex-wrap: wrap;
    }

    .stat-grid,
    .stat-grid-dashboard,
    .dash-kpi-grid {
        grid-template-columns: 1fr;
    }

    .error-page-body {
        padding: 1rem;
    }

    .error-page-card {
        padding: 1.5rem 1.15rem;
    }

    .error-page-code {
        font-size: 2.5rem;
    }

    .error-page-title {
        font-size: 1.1rem;
    }

    .portal-login-wrap {
        padding: 1rem;
    }

    .portal-login-card {
        padding: 1.35rem 1.15rem;
    }

    .login-form-panel {
        padding: 1.75rem 1.15rem;
    }

    .users-action-bar .users-action-btn {
        min-width: 100%;
    }

    .backup-btn-row .btn {
        flex: 1 1 100%;
    }

    .confirm-modal-actions {
        flex-direction: column;
    }

    .confirm-modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.85rem 0.65rem 1.5rem;
    }

    .topbar {
        padding: 0.55rem 0.65rem;
    }

    .mobile-menu-btn {
        padding: 0.45rem;
    }

    .panel-card-header,
    .panel-card-body {
        padding-inline: 0.85rem;
    }

    .panel-table-wrap,
    .panel-list-pro .panel-table-wrap {
        margin-inline: -0.65rem;
    }
}

@supports (padding: max(0px)) {
    .main-content {
        padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
    }

    .sidebar,
    .settings-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .topbar {
        padding-top: max(0.55rem, env(safe-area-inset-top));
    }

    .modal-overlay {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

/* ─── Panel density v1.11.9 — فشرده‌تر برای دسکتاپ (CSS-only) ─── */
.stat-grid {
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-grid-dashboard {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
    padding: 0.75rem 0.9rem;
    gap: 0.65rem;
    border-radius: var(--radius);
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.stat-card-icon svg {
    width: 18px;
    height: 18px;
}

.stat-card-label {
    font-size: 0.6875rem;
}

.stat-card-value {
    font-size: 1.35rem;
}

.mb-5 {
    margin-bottom: 0.85rem;
}

.mb-4 {
    margin-bottom: 0.65rem;
}

.mb-3 {
    margin-bottom: 0.5rem;
}

.panel-card-header {
    padding: 0.65rem 0.85rem;
}

.panel-card-header h2 {
    font-size: 0.9375rem;
}

.panel-card-body {
    padding: 0.85rem;
}

.page-actions .field-input {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    min-height: 0;
}

.page-actions .btn-sm {
    padding: 0.28rem 0.6rem;
}

.sessions-online-page .live-stats--compact {
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.sessions-online-page .live-stats--compact strong {
    font-size: 0.8125rem;
}

.sessions-online-table.panel-table-compact th,
.sessions-online-table.panel-table-compact td {
    padding: 0.16rem 0.3rem;
    font-size: 0.5875rem;
    line-height: 1.25;
}

.sessions-online-table .col-protocol {
    max-width: 4.75rem;
    font-size: 0.5625rem;
}

.sessions-online-table .col-truncate {
    max-width: 4rem;
}

.sessions-online-table .col-truncate-md {
    max-width: 4.25rem;
}

.sessions-online-table .btn-sm {
    padding: 0.08rem 0.3rem;
    font-size: 0.5625rem;
}

.sessions-online-table .online-expand-btn {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.65rem;
    line-height: 1;
}

.sessions-online-table input[type="checkbox"] {
    width: 12px;
    height: 12px;
}

.users-action-bar {
    padding: 0.45rem 0.65rem;
}

.users-action-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.sidebar.sidebar-pro-v4 .nav-group-label {
    padding: 0.15rem 0.6rem 0.28rem;
    margin-bottom: 0.15rem;
}

.sidebar.sidebar-pro-v4 .sidebar-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.sidebar.sidebar-pro-v4 .sidebar-user-info strong {
    font-size: 0.75rem;
}

.sidebar.sidebar-pro-v4 .sidebar-user-info span {
    font-size: 0.625rem;
}

.sidebar.sidebar-pro-v4 .sidebar-blog-card {
    padding: 0.45rem 0.55rem;
    font-size: 0.6875rem;
}

/* لپ‌تاپ: آپلود/دانلود جدا مخفی — مصرف کل باقی می‌ماند */
@media (max-width: 1480px) {
    .sessions-online-table th:nth-child(12),
    .sessions-online-table td:nth-child(12),
    .sessions-online-table th:nth-child(13),
    .sessions-online-table td:nth-child(13) {
        display: none;
    }
}

@media (min-width: 1025px) {
    .sessions-online-page .panel-table-wrap {
        overflow-x: auto;
    }
}

/* ─── Panel density v1.11.10 — یک درجه فشرده‌تر (CSS-only) ─── */
.btn {
    padding: 0.45rem 0.95rem;
    font-size: 0.75rem;
    gap: 0.35rem;
}

.field-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.field-label {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}

.stat-grid {
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.stat-grid-dashboard {
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.stat-card {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
}

.stat-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.stat-card-icon svg {
    width: 16px;
    height: 16px;
}

.stat-card-label {
    font-size: 0.625rem;
}

.stat-card-value {
    font-size: 1.15rem;
}

.panel-card-header {
    padding: 0.55rem 0.7rem;
}

.panel-card-header h2 {
    font-size: 0.875rem;
}

.panel-card-body {
    padding: 0.7rem;
}

.panel-table-compact th {
    padding: 0.28rem 0.38rem;
    font-size: 0.5875rem;
}

.panel-table-compact td {
    padding: 0.22rem 0.38rem;
    font-size: 0.625rem;
}

.panel-table-compact .badge {
    font-size: 0.5625rem;
    padding: 0.04rem 0.28rem;
}

.panel-table-compact .btn-sm {
    padding: 0.08rem 0.32rem;
    font-size: 0.5625rem;
}

.page-actions .field-input {
    font-size: 0.6875rem;
    padding: 0.25rem 0.45rem;
}

.page-actions .btn-sm {
    padding: 0.22rem 0.5rem;
    font-size: 0.6875rem;
}

.sessions-online-page .live-stats--compact {
    padding: 0.32rem 0.55rem;
    margin-bottom: 0.4rem;
    font-size: 0.6875rem;
}

.sessions-online-page .live-stats--compact strong {
    font-size: 0.75rem;
}

.sessions-online-table.panel-table-compact th,
.sessions-online-table.panel-table-compact td {
    padding: 0.12rem 0.25rem;
    font-size: 0.5625rem;
}

.sessions-online-table .col-protocol {
    max-width: 4.25rem;
    font-size: 0.53125rem;
}

.sessions-online-table .col-truncate {
    max-width: 3.5rem;
}

.sessions-online-table .col-truncate-md {
    max-width: 3.75rem;
}

.sessions-online-table .btn-sm {
    padding: 0.06rem 0.25rem;
    font-size: 0.53125rem;
}

.sessions-online-table .online-expand-btn {
    width: 1rem;
    height: 1rem;
    font-size: 0.6rem;
}

.sessions-online-table input[type="checkbox"] {
    width: 11px;
    height: 11px;
}

.users-action-bar {
    padding: 0.35rem 0.55rem;
}

.users-action-btn {
    padding: 0.28rem 0.55rem;
    font-size: 0.6875rem;
}

.sidebar.sidebar-pro-v4 .sidebar-brand {
    padding: 0.6rem 0.65rem 0.55rem;
}

.sidebar.sidebar-pro-v4 .sidebar-brand-text strong {
    font-size: 0.8125rem;
}

.sidebar.sidebar-pro-v4 .sidebar-brand-text span {
    font-size: 0.625rem;
}

.sidebar.sidebar-pro-v4 .nav-link {
    min-height: 1.75rem;
    padding: 0.26rem 0.42rem;
    font-size: 0.6875rem;
    gap: 0.38rem;
}

.sidebar.sidebar-pro-v4 .nav-link > svg {
    width: 13px;
    height: 13px;
}

.sidebar.sidebar-pro-v4 .nav-group-label {
    padding: 0.1rem 0.5rem 0.22rem;
    font-size: 0.5625rem;
}

.sidebar.sidebar-pro-v4 .sidebar-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.6875rem;
}

.sidebar.sidebar-pro-v4 .sidebar-user-info strong {
    font-size: 0.6875rem;
}

.sidebar.sidebar-pro-v4 .sidebar-user-info span {
    font-size: 0.5625rem;
}

.sidebar.sidebar-pro-v4 .sidebar-blog-card {
    padding: 0.38rem 0.48rem;
    font-size: 0.625rem;
}

@media (max-width: 1560px) {
    .sessions-online-table th:nth-child(12),
    .sessions-online-table td:nth-child(12),
    .sessions-online-table th:nth-child(13),
    .sessions-online-table td:nth-child(13) {
        display: none;
    }
}
