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

:root {
    --bg-primary: #000000;
    --bg-secondary: #050505;
    --bg-card: #070708;
    --bg-card-hover: #0c0c0e;
    --bg-sidebar: #000000;
    --bg-sidebar-hover: #08080a;
    --bg-active: #0a0a0c;
    --border: rgba(255, 255, 255, 0.04);
    --border-light: rgba(255, 255, 255, 0.07);
    --text-primary: #f0f2f5;
    --text-secondary: #6b7080;
    --text-muted: #3d4250;
    --accent-ton: #cccccc;
    --accent-ton-glow: rgba(200, 200, 200, 0.06);
    --accent-ton-neon: #eeeeee;
    --accent-tron: #ff0013;
    --accent-tron-glow: rgba(255, 0, 19, 0.15);
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.12);
    --yellow: #f59e0b;
    --red: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 8px 32px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.03);
    --transition: 250ms cubic-bezier(0.22, 1, 0.36, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

html,
body {
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Ambient subtle glow */
body::before {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.015) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    pointer-events: none;
    z-index: 0;
}

#app {
    height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* === SIDEBAR === */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 100;
}

.sidebar.collapsed {
    width: 64px;
    min-width: 64px;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .network-btn span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .context-btn {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .network-btn {
    justify-content: center;
    padding: 8px;
}

.sidebar.collapsed .network-toggle {
    /* При свёрнутом сайдбаре полностью прячем TON/TRON переключатель,
       чтобы нельзя было кликнуть по кнопке, которая всё равно не видна. */
    display: none;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

.sidebar.collapsed .avatar {
    margin: 0;
}

/* Network Toggle */
.network-toggle {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.network-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.network-btn:hover {
    color: var(--text-secondary);
}

.network-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--border-light);
}

.network-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: var(--transition);
}

.dot-ton {
    /* TON brand blue неоновый кружок */
    background: #2c8fff;
    box-shadow: 0 0 6px rgba(44, 143, 255, 0.7), 0 0 14px rgba(44, 143, 255, 0.5), 0 0 24px rgba(44, 143, 255, 0.3);
    animation: dotPulseNeonTON 2.4s ease-in-out infinite;
}

.dot-tron {
    /* TRON неоновый красный кружок */
    background: var(--accent-tron);
    box-shadow: 0 0 6px rgba(255, 0, 19, 0.8), 0 0 14px rgba(255, 0, 19, 0.5), 0 0 24px rgba(255, 0, 19, 0.3);
    animation: dotPulseNeonTRON 2.4s ease-in-out infinite;
}

@keyframes dotPulseNeonTON {
    0%, 100% { box-shadow: 0 0 6px rgba(44, 143, 255, 0.7), 0 0 14px rgba(44, 143, 255, 0.5), 0 0 24px rgba(44, 143, 255, 0.3); }
    50%      { box-shadow: 0 0 10px rgba(44, 143, 255, 0.95), 0 0 22px rgba(44, 143, 255, 0.75), 0 0 36px rgba(44, 143, 255, 0.5); }
}
@keyframes dotPulseNeonTRON {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 0, 19, 0.8), 0 0 14px rgba(255, 0, 19, 0.5), 0 0 24px rgba(255, 0, 19, 0.3); }
    50%      { box-shadow: 0 0 10px rgba(255, 0, 19, 0.95), 0 0 22px rgba(255, 0, 19, 0.75), 0 0 36px rgba(255, 0, 19, 0.5); }
}

/* Navigation */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 13px;
    font-weight: 500;
}

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

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 var(--accent-ton);
}

.nav-item.active .nav-icon {
    color: var(--accent-ton);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
}

.nav-item .status-dot {
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green-glow), 0 0 12px rgba(16, 185, 129, 0.1);
    flex-shrink: 0;
    animation: dotPulseGreen 2s ease-in-out infinite;
}

@keyframes dotPulseGreen {
    0%, 100% { box-shadow: 0 0 6px var(--green-glow), 0 0 12px rgba(16, 185, 129, 0.1); }
    50% { box-shadow: 0 0 8px var(--green-glow), 0 0 20px rgba(16, 185, 129, 0.2); }
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 12px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.user-profile:hover {
    background: var(--bg-sidebar-hover);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #888888, #444444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

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

.context-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: var(--transition);
}

.context-btn:hover {
    color: var(--text-primary);
}

/* === MAIN CONTENT === */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-primary);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
}

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

.page-title {
    font-size: 16px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    position: relative;
}

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

.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* === STATS CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: cardIn 500ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0ms; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 80ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 160ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 240ms; }

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-icon-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-active);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.stat-icon-btn:hover {
    color: var(--accent-ton);
    border-color: var(--accent-ton);
    background: var(--accent-ton-glow);
}

/* === CHART === */
.chart-card,
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: var(--transition);
}

.chart-card:hover,
.table-card:hover {
    border-color: rgba(200, 200, 200, 0.1);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
}

.chart-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.chart-tab {
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.chart-tab:hover {
    color: var(--text-secondary);
}

.chart-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--border-light);
}

.chart-container {
    position: relative;
    height: 240px;
}

.chart-card .chart-container {
    height: auto;
}

/* === TRON PLACEHOLDER === */
.tron-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
}

.tron-placeholder span {
    font-size: 48px;
    font-weight: 700;
    font-family: var(--mono);
    color: white;
    text-shadow: 0 0 7px rgba(255, 255, 255, 0.4),
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(255, 255, 255, 0.2),
        0 0 80px rgba(255, 255, 255, 0.1),
        0 0 120px rgba(255, 255, 255, 0.05);
    letter-spacing: 4px;
    animation: neonFlicker 3s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 7px rgba(255, 255, 255, 0.4),
            0 0 20px rgba(255, 255, 255, 0.3),
            0 0 40px rgba(255, 255, 255, 0.2),
            0 0 80px rgba(255, 255, 255, 0.1);
        opacity: 1;
    }
    20%, 24%, 55% {
        text-shadow: none;
        opacity: 0.6;
    }
}

.tron-placeholder p {
    color: var(--text-muted);
    font-size: 13px;
}

/* === ADMIN SPECIFIC === */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.admin-table-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.table-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card-title .badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-active);
    padding: 2px 10px;
    border-radius: 100px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    color: var(--text-primary);
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}

.status-active {
    background: var(--green-glow);
    color: var(--green);
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--yellow);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell .mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.mini-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* === LOGIN PAGE === */
.login-page {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-bg-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 200, 200, 0.04) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 380px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #888888, #444444);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 12px;
}

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

.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
}

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

.login-input:focus {
    border-color: var(--accent-ton);
    box-shadow: 0 0 0 3px rgba(200, 200, 200, 0.06);
}

.login-input::placeholder {
    color: var(--text-muted);
}

.pw-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-wrapper .pw-input {
    padding-right: 40px;
}

.pw-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 10px;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0.5;
}

.pw-toggle:hover {
    opacity: 1;
    color: var(--text-primary);
}

.login-btn {
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}

.login-btn.primary {
    background: var(--accent-ton);
    color: #000000;
}

.login-btn.primary:hover {
    background: #e0e0e0;
}

.login-btn.secondary {
    background: var(--bg-active);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.login-btn.secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* === PAGE SPECIFIC === */
.page-transition {
    animation: pageIn 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* === INVENTORY PLACEHOLDER === */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 12px;
    color: var(--text-muted);
}

.placeholder-page .placeholder-icon {
    font-size: 48px;
    opacity: 0.3;
}

.placeholder-page h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

.placeholder-page p {
    font-size: 13px;
}

/* === SETTINGS FORM === */
.settings-section {
    margin-bottom: 20px;
}

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

.settings-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.settings-label .label-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-label .label-left i {
    width: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.settings-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.settings-wallet {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    word-break: break-all;
    border: 1px solid var(--border);
    cursor: text;
    transition: var(--transition);
}

.settings-wallet:hover {
    border-color: var(--border-light);
}

.settings-wallet:focus {
    border-color: var(--accent-ton);
    box-shadow: 0 0 0 3px var(--accent-ton-glow);
    outline: none;
}

select.login-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23787e8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
    transition: var(--transition);
}

select.login-input:hover {
    border-color: var(--border-light);
}

select.login-input option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.admin-lvl-select {
    appearance: none;
    -webkit-appearance: none;
    background: #000000;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 36px 8px 12px;
    color: #cccccc;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cccccc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    outline: none;
    font-family: inherit;
}
.admin-lvl-select:hover {
    border-color: #555555;
}
.admin-lvl-select:focus {
    border-color: #888888;
}
.admin-lvl-select option {
    background: #111111;
    color: #cccccc;
}

/* === TOGGLE SWITCH === */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-active);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider:hover {
    border-color: var(--border-light);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-ton);
    border-color: var(--accent-ton);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

.toggle-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.toggle-label.active {
    color: var(--green);
    font-weight: 600;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 150ms ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
    transform: scale(1.1) translateY(-3%);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    transition: var(--transition);
}

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

.modal-body {
    padding: 20px;
}

.modal-form label {
    display: block;
    margin-bottom: 4px;
}

/* === NOTIFICATION DROPDOWN === */
.notif-wrapper {
    position: relative;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: none;
    z-index: 500;
}

.notif-dropdown.show {
    display: block;
}

.notif-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.notif-item {
    padding: 12px 16px 12px 36px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.notif-item .notif-dot {
    position: absolute;
    left: 14px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.notif-item.notif-success .notif-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.notif-item.notif-warning .notif-dot { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.notif-item.notif-error   .notif-dot { background: var(--red);   box-shadow: 0 0 8px var(--red);   }
.notif-item.notif-info    .notif-dot { background: var(--accent-ton); box-shadow: 0 0 6px var(--accent-ton); }

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

.notif-item:hover {
    background: var(--bg-sidebar-hover);
}

.notif-item.unread {
    border-left: 3px solid var(--accent-ton);
}
.notif-item.unread.notif-success { border-left-color: var(--green); }
.notif-item.unread.notif-warning { border-left-color: var(--yellow); }
.notif-item.unread.notif-error { border-left-color: var(--red); }

.notif-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
}

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

.help-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--bg-card);
}
.help-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
}
.help-summary::-webkit-details-marker { display: none; }
.help-summary:hover { background: rgba(255,255,255,0.03); }
.help-thumb {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.help-thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 18px;
}
.help-body {
    padding: 0 16px 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}
.help-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.help-admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.help-admin-item:last-child { border-bottom: none; }
    font-size: 11px;
    color: var(--text-muted);
}

/* === PROFILE DROPDOWN === */
.profile-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 12px;
    right: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: none;
    z-index: 200;
    overflow: hidden;
}

.profile-dropdown.show {
    display: block;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.profile-dropdown a:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

.profile-dropdown a i {
    width: 16px;
    font-size: 13px;
}

/* === UPDATES FEED === */
.updates-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.update-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(13, 14, 20, 0.8) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.update-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0 2px 2px 0;
}

.update-card:hover {
    border-color: rgba(200, 200, 200, 0.1);
    transform: translateX(2px);
    box-shadow: var(--shadow-glow);
}

.update-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.update-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.update-date {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.update-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.update-author {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === DASHBOARD LAYOUT === */

/* Filter bar */
.dash-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.filter-tab {
    padding: 6px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.filter-tab:hover {
    color: var(--text-secondary);
}

.filter-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--border-light);
}

/* Main row: chart left + 2x2 cards right */
.dash-main {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: stretch;
}

.dash-chart {
    width: 720px;
    min-width: 720px;
    display: flex;
    flex-direction: column;
}

.dash-chart .chart-header {
    margin-bottom: 0;
}

.dash-stats-right {
    flex: 1;
    min-width: 0;
}

.stats-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: 100%;
}

.dash-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 20px;
    animation: cardIn 400ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.dash-stat-card:hover {
    background: rgba(255,255,255,0.02);
}

.stats-grid-2x2 .dash-stat-card:nth-child(1) { animation-delay: 50ms; }
.stats-grid-2x2 .dash-stat-card:nth-child(2) { animation-delay: 100ms; }
.stats-grid-2x2 .dash-stat-card:nth-child(3) { animation-delay: 150ms; }
.stats-grid-2x2 .dash-stat-card:nth-child(4) { animation-delay: 200ms; }

.dash-stat-card .stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.dash-stat-card .stat-value {
    font-size: 32px;
    margin-bottom: 4px;
}

.stat-cr {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* Chart in dashboard */
.dash-chart .chart-current-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 10px;
    padding: 0 2px;
}

.dash-chart .chart-current-value .chart-metric-symbol {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}

.dash-chart .chart-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 8px;
}

.dash-chart .chart-container {
    position: relative;
    height: 240px;
    margin: 0 0 10px;
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.dash-chart .chart-axis-line {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 1;
    pointer-events: none;
}

.dash-chart .chart-tooltip {
    position: absolute;
    bottom: calc(40% + 14px);
    background: #0c0d12;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--mono);
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 120ms ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.dash-chart .chart-tooltip.show {
    opacity: 1;
}

.dash-chart .chart-tooltip .tooltip-time {
    color: var(--text-muted);
    font-size: 9px;
}

.dash-chart .chart-tooltip .tooltip-val {
    color: var(--text-primary);
    font-weight: 600;
}

.dash-chart .chart-marker {
    position: absolute;
    bottom: calc(40% - 5px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-ton);
    border: 2px solid var(--bg-card);
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    box-shadow: 0 0 12px rgba(200,200,200,0.2);
}

.dash-chart .chart-marker.show {
    opacity: 1;
}

.dash-chart .chart-capsule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto;
}

.dash-chart .chart-capsule .chart-metric-btn {
    width: 32px;
    height: 28px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.dash-chart .chart-capsule .chart-metric-btn:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
}

.dash-chart .chart-capsule .chart-metric-btn.active {
    color: white;
    background: var(--accent-ton);
    box-shadow: 0 0 12px rgba(200,200,200,0.15);
}

/* Bottom: video + levels */
.dash-bottom {
    display: flex;
    gap: 16px;
}

.video-card {
    width: 720px;
    min-width: 720px;
    height: 430px;
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 180px;
}

.lvl-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1) translateY(0);
    opacity: 1;
    transition: opacity 0.4s ease;
    position: absolute;
    top: 30px;
    left: 0;
    height: calc(100% - 30px);
    outline: none;
}

.lvl-video.fade-out {
    opacity: 0;
}

.video-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 14px;
}

.video-fallback i {
    font-size: 36px;
    opacity: 0.3;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-lvl-badge {
    background: var(--accent-ton);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 100px;
    font-family: var(--mono);
}

.video-lvl-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.lvl-card {
    flex: 1;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lvl-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.lvl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.lvl-item:hover {
    background: var(--bg-sidebar-hover);
}

.lvl-item.current {
    background: rgba(200, 200, 200, 0.06);
    border: 1px solid rgba(200, 200, 200, 0.1);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.lvl-neon {
    animation: neonPulse 1.5s ease-in-out infinite;
}

.badge-neon {
    animation: badgeNeonPulse 1.5s ease-in-out infinite;
}
.text-neon {
    animation: textNeonPulse 1.5s ease-in-out infinite;
}
@keyframes textNeonPulse {
    0%, 100% { text-shadow: 0 0 4px rgba(255,255,255,0.6), 0 0 10px rgba(255,255,255,0.3); }
    50% { text-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 20px rgba(255,255,255,0.5); }
}

@keyframes badgeNeonPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 8px rgba(255,255,255,0.6), 0 0 16px rgba(255,255,255,0.3); }
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 8px rgba(255,255,255,0.6), 0 0 16px rgba(255,255,255,0.3); }
}

.lvl-neon .lvl-num {
    animation: neonPulse 1.5s ease-in-out infinite;
}

.lvl-item.locked {
    opacity: 0.35;
}

.lvl-item.past .lvl-num {
    color: var(--green);
}

.lvl-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lvl-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.lvl-item.current .lvl-num {
    background: var(--accent-ton);
    border-color: var(--accent-ton);
    color: white;
}

.lvl-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.lvl-req {
    font-size: 10px;
    color: var(--text-muted);
}

.lvl-active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-ton);
    flex-shrink: 0;
}

.lvl-progress {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    cursor: default;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    padding: 10px 8px 4px;
    margin-left: -8px;
    margin-right: -8px;
}

.lvl-progress:hover .lvl-progress-fill {
    background: white;
    box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

.lvl-progress:hover .lvl-progress-text {
    color: var(--text-secondary);
}

.lvl-progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.lvl-progress-fill {
    height: 100%;
    background: var(--accent-ton);
    border-radius: 4px;
    transition: width 0.6s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.lvl-progress-text {
    font-size: 10px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* === RESPONSIVE === */
.verify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    flex-shrink: 0;
}
.verify-btn:hover {
    color: var(--accent-ton);
    border-color: var(--border-light);
    background: var(--bg-active);
}
.verify-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === DOMAIN MANAGEMENT === */
.add-domain-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-active);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}
.add-domain-btn:hover {
    border-color: var(--accent-ton);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.ns-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ns-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-active);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    width: fit-content;
}
.ns-badge:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}
.ns-copy-icon {
    font-size: 11px;
    opacity: 0.4;
    transition: var(--transition);
}
.ns-badge:hover .ns-copy-icon {
    opacity: 1;
    color: var(--accent-ton);
}
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}
.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}
.dropdown-trigger:hover {
    background: var(--bg-active);
    border-color: var(--border);
    color: var(--text-primary);
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 50;
    display: none;
    overflow: hidden;
    animation: fadeIn 120ms ease;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
}
.dropdown-item:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}
.dropdown-item.danger {
    color: var(--red);
}
.dropdown-item.danger:hover {
    background: rgba(239,68,68,0.1);
}
/* === TOAST SYSTEM === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: toastIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    min-width: 240px;
}
.toast-success {
    border-left: 3px solid var(--green);
}
.toast-error {
    border-left: 3px solid var(--red);
}
.toast-out {
    animation: toastOut 300ms ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(24px); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 1600px) {
    .dash-chart {
        width: 580px;
        min-width: 580px;
    }
    .video-card {
        width: 580px;
        min-width: 580px;
    }
}

@media (max-width: 1400px) {
    .dash-chart {
        width: 460px;
        min-width: 460px;
    }
    .video-card {
        width: 460px;
        min-width: 460px;
    }
}

@media (max-width: 1200px) {
    .dash-main {
        flex-direction: column;
    }
    .dash-chart {
        width: 100%;
        min-width: 0;
    }
    .dash-chart .chart-container {
        height: 180px;
    }
    .dash-stats-right {
        width: 100%;
        min-width: 0;
    }
    .dash-bottom {
        flex-direction: column;
    }
    .lvl-card {
        width: 100%;
        min-width: 0;
    }
    .video-card {
        width: 100%;
        min-width: 0;
        min-height: 200px;
    }
}

@media (max-width: 1024px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-table-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
        min-width: 64px;
    }
    .sidebar .nav-label,
    .sidebar .network-btn span,
    .sidebar .user-info,
    .sidebar .nav-badge,
    .sidebar .context-btn {
        display: none;
    }
    .sidebar .nav-item {
        justify-content: center;
        padding: 10px;
    }
    .sidebar .network-btn {
        justify-content: center;
        padding: 8px;
    }
    .sidebar .network-toggle {
        flex-direction: column;
        gap: 4px;
    }
    .sidebar .user-profile {
        justify-content: center;
    }
    .sidebar .avatar {
        margin: 0;
    }
    .content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 12px 16px;
    }
    .login-card {
        width: 90%;
        padding: 24px;
    }
    .dash-stats-right {
        width: 100%;
        min-width: 0;
    }
    .dash-bottom {
        flex-direction: column;
    }
    .lvl-card {
        width: 100%;
        min-width: 0;
    }
    .stats-grid-2x2 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid-2x2 {
        grid-template-columns: 1fr;
    }
    .stat-value {
        font-size: 24px;
    }
    .dash-chart .stat-value {
        font-size: 22px;
    }
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    position: relative;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.profile-badge { font-size: 11px; font-weight: 700; background: var(--accent); color: #000; padding: 1px 6px; border-radius: 4px; }
.profile-id { font-size: 11px; color: var(--text-muted); }
.profile-dots { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; font-size: 14px; border-radius: 4px; }
.profile-dots:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.profile-dropdown { display: none; position: absolute; bottom: 100%; right: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 4px; min-width: 130px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.profile-dropdown.show { display: block; }
.profile-dropdown a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--red); cursor: pointer; border-radius: 6px; text-decoration: none; }
.profile-dropdown a:hover { background: rgba(255,0,0,0.08); }

/* ====================================================================
   DOMAINS PAGE v2 — премиум-минималистичный UI
   Палитра: #090909–#111111, серые, белый; акцент только для статусов.
   ==================================================================== */
.dpage {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.dpage .nav-item, .dpage .dropdown-item { color: inherit; }

.dpage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 2px 0;
}
.dpage-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    margin: 0;
}
.dpage-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    background: #f4f5f7;
    color: #09090b;
    border: 1px solid #e2e3e7;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 180ms ease, transform 180ms ease;
}
.dpage-add-btn:hover { background: #fff; transform: translateY(-1px); }
.dpage-add-btn i { font-size: 11px; }

/* --- Stat grid --- */
.dstat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.dstat-card {
    position: relative;
    background: #0b0b0d;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 18px 18px 14px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.dstat-card .dstat-head { display: flex; align-items: center; justify-content: space-between; }
.dstat-card .dstat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dstat-card .dstat-body { display: flex; flex-direction: column; gap: 2px; }
.dstat-card .dstat-val {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--mono);
    letter-spacing: -0.4px;
    line-height: 1.1;
}
.dstat-card.loading .dstat-val::after {
    content: '…';
    color: var(--text-muted);
}
.dstat-card .dstat-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.dstat-card .dstat-mini {
    position: absolute;
    right: 14px;
    bottom: 12px;
    width: 120px;
    height: 40px;
    opacity: 0.85;
}

/* --- Main split --- */
.dpage-main {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "stats geo"
        "table geo";
    column-gap: 16px;
    row-gap: 48px;
    align-items: stretch;
}
.dpage-main > .dstat-grid { grid-area: stats; }
.dpage-main > .dpage-left { grid-area: table; }
.dpage-main > .dpage-right { grid-area: geo; }

.dpage-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.dpage-right .dgeo-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.dpage-right .dgeo-map {
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: auto;
}
.dpage-card {
    background: #0a0a0c;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}
.dpage-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.dc-head-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}
.dc-head-sub {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* --- Toolbar --- */
.dpage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.dpage-tabs { display: flex; gap: 22px; }
.dpage-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0 10px;
    position: relative;
    font-family: inherit;
    transition: color 180ms ease;
}
.dpage-tab:hover { color: var(--text-secondary); }
.dpage-tab.active {
    color: var(--text-primary);
}
.dpage-tab.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.85);
}
.dpage-tools { display: flex; align-items: center; gap: 8px; }
.dpage-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0c0c0e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    padding: 7px 12px;
    width: 220px;
}
.dpage-search i { font-size: 11px; color: var(--text-muted); }
.dpage-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
}
.dpage-search input::placeholder { color: var(--text-muted); }
.dpage-filters-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #0c0c0e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: color 180ms ease, border-color 180ms ease;
}
.dpage-filters-btn:hover { color: var(--text-primary); border-color: rgba(255, 255, 255, 0.12); }

/* --- Table --- */
.dpage-table { width: 100%; border-collapse: collapse; }
.dpage-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 6px 10px 12px;
    border-bottom: none;
}
.dpage-table td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 13px;
    vertical-align: middle;
}
.dpage-table tr:hover td { background: rgba(255, 255, 255, 0.012); }
.dpage-row-empty td {
    padding: 56px 12px;
    text-align: center;
    color: var(--text-muted);
}
.dpage-row-empty td i { font-size: 28px; display: block; margin-bottom: 10px; opacity: 0.3; }
.dpage-row-empty td span { font-size: 13px; }

.dp-cell-fav {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}
.dp-fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    transition: color 0.2s ease;
}
.dp-fav-btn:hover { color: #ffd700; }
.dp-fav-btn.active {
    color: #ffe033;
    text-shadow: 0 0 8px #ffd700, 0 0 18px rgba(255, 215, 0, 0.55);
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.dp-cell-name .dp-name-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dp-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    transition: color 180ms ease;
}
.dp-name i { font-size: 9px; opacity: 0.45; margin-left: 4px; }
.dp-name:hover { color: var(--text-secondary); }
.dp-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
.dp-cell-visits .dp-visits { display: flex; align-items: center; gap: 14px; }
.dp-num {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 22px;
}
.dp-num.muted { color: var(--text-muted); }
.dp-sparkline { width: 64px; height: 22px; opacity: 0.85; }
.dp-cell-inc, .dp-cell-conv { font-variant-numeric: tabular-nums; }

.dbadge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}
.dbadge-active {
    background: rgba(16, 185, 129, 0.10);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.18);
}
.dbadge-pending {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.dp-verify {
    margin-left: 6px;
    width: 22px; height: 22px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 180ms ease, border-color 180ms ease;
}
.dp-verify:hover { color: var(--text-primary); border-color: rgba(255, 255, 255, 0.12); }
.dp-dots {
    width: 28px; height: 28px;
    background: none;
    border: 1px solid transparent;
}
.dp-dots:hover { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.06); }
.dropdown-divider { height: 1px; background: rgba(255, 255, 255, 0.04); margin: 4px 0; }

/* --- Geo (jsVectorMap) --- */
.dgeo-card { gap: 12px; }
.dgeo-map {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    background: radial-gradient(ellipse at center, #0c0c0e 0%, #07070a 100%);
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
}

/* jsVectorMap контейнер */
.dgeo-map .jvm-container {
    background: transparent !important;
}
.dgeo-map svg { width: 100%; height: 100%; display: block; }

/* Регионы (страны) — тёмная заливка, при hover — чуть светлее */
.dgeo-map .jvm-region {
    fill: rgba(255,255,255,0.06);
    stroke: rgba(255,255,255,0.1);
    stroke-width: 0.5;
    transition: fill 200ms ease;
}
.dgeo-map .jvm-region:hover {
    fill: rgba(255,255,255,0.14);
}

/* Маркеры — неоновые точки */
.dgeo-map .jvm-marker {
    fill: #4cb2ff;
    fill-opacity: 0.9;
    stroke: #fff;
    stroke-width: 1;
    filter: drop-shadow(0 0 6px rgba(75, 178, 255, 0.8));
    transition: r 200ms ease;
}
.dgeo-map .jvm-marker:hover {
    fill: #fff;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
}

/* Tooltip — на body, не внутри .dgeo-map */
.jvm-tooltip {
    background: #0c0c0e !important;
    color: #f0f2f5 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-family: inherit !important;
    z-index: 99999 !important;
}

.dgeo-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin-top: 10px;
}
.dgeo-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 18px 0;
}
.dgeo-item { padding: 6px 0; }
.dgeo-i-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.dgeo-i-name { font-size: 12px; color: var(--text-secondary); }
.dgeo-i-pct { font-size: 11px; color: var(--text-primary); font-family: var(--mono); }
.dgeo-i-bar {
    height: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.dgeo-i-fill { height: 100%; background: rgba(255, 255, 255, 0.6); border-radius: 2px; }
.dgeo-i-sub { font-size: 10px; color: var(--text-muted); }

/* --- Bottom row --- */
.dpage-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.dpage-traffic-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.dpage-pill {
    padding: 6px 11px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.dpage-pill:hover { color: var(--text-secondary); }
.dpage-pill.active {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
}
.dpage-sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.06); margin: 0 4px; }
.dpage-select {
    padding: 6px 28px 6px 11px;
    background: #0c0c0e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23787e8a' d='M5 6L1 2h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.dpage-select option { background: #0c0c0e; color: var(--text-primary); }
.dpage-icon-btn {
    width: 30px;
    height: 30px;
    background: #0c0c0e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.dpage-icon-btn:hover { color: var(--text-secondary); border-color: rgba(255, 255, 255, 0.12); }
.dpage-chart-wrap {
    position: relative;
    height: 240px;
    margin-top: 6px;
}
.dpage-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* --- Split --- */
.dpage-split-body {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}
.dpage-split-chart-wrap {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dpage-split-chart-wrap canvas { width: 100% !important; height: 100% !important; }
.dpage-split-legend { display: flex; flex-direction: column; gap: 14px; }
.dlegend-item {
    display: grid;
    grid-template-columns: 8px 1fr auto;
    align-items: center;
    gap: 10px;
}
.dlegend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dlegend-info { display: flex; flex-direction: column; gap: 4px; }
.dlegend-name { font-size: 12px; color: var(--text-secondary); }
.dlegend-bar {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    display: block;
    overflow: hidden;
}
.dlegend-bar span {
    display: block;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
}
.dlegend-meta { font-size: 10px; color: var(--text-muted); }
.dlegend-val { font-size: 14px; font-weight: 600; color: var(--text-primary); font-family: var(--mono); }

/* --- Responsive --- */
@media (max-width: 1400px) {
    .dpage-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .dpage-head { flex-direction: column; align-items: flex-start; }
    .dpage-toolbar { flex-direction: column; align-items: stretch; }
    .dpage-search { width: 100%; }
    .dstat-grid { grid-template-columns: 1fr; }
    .dgeo-stats { grid-template-columns: 1fr; }
    .dpage-split-body { grid-template-columns: 1fr; }
}
