/* ========================================
   ОСНОВНЫЕ СТИЛИ — Chilavik-server
   Используется на всех страницах
   ======================================== */

/* ========================================
   CSS ПЕРЕМЕННЫЕ ДЛЯ ТЕМ
   ======================================== */

:root {
    /* Тема по умолчанию (Аметистовая) */
    --theme-bg: #0a0618;
    --theme-bg-gradient1: #2d1b4e;
    --theme-bg-gradient2: #3d1f5e;
    --theme-card-bg: rgba(20, 10, 40, 0.4);
    --theme-card-bg-hover: rgba(30, 15, 55, 0.7);
    --theme-accent: #a855f7;
    --theme-accent-light: #d4a0ff;
    --theme-accent-dark: #7a3ab8;
    --theme-text: #e8d5f5;
    --theme-text-muted: #7a5a99;
    --theme-text-dark: #9a7ab5;
    --theme-border: rgba(160, 80, 255, 0.08);
    --theme-border-hover: rgba(160, 80, 255, 0.2);
    --theme-shadow: rgba(160, 60, 255, 0.2);
    --theme-glow: rgba(168, 85, 247, 0.3);
    --theme-gradient: linear-gradient(135deg, #d4a0ff 0%, #ff6bcb 60%, #ff8a9e 100%);
    --theme-input-bg: rgba(10, 6, 24, 0.6);
    --theme-success: #27ae60;
    --theme-danger: #eb5757;
    --theme-warning: #f2994a;
    --sidebar-bg: rgba(18, 8, 35, 0.92);
    --sidebar-width: 220px;
}

/* ========================================
   ТЕМЫ
   ======================================== */

[data-theme="royal_blue"] {
    --theme-bg: #0a0e1a;
    --theme-bg-gradient1: #1a2a4e;
    --theme-bg-gradient2: #1a1a5e;
    --theme-card-bg: rgba(10, 20, 40, 0.4);
    --theme-card-bg-hover: rgba(20, 30, 55, 0.7);
    --theme-accent: #4a7fff;
    --theme-accent-light: #8ab4ff;
    --theme-accent-dark: #2a5adf;
    --theme-text: #e8edf5;
    --theme-text-muted: #6a7a99;
    --theme-text-dark: #8a9ab5;
    --theme-border: rgba(74, 127, 255, 0.08);
    --theme-border-hover: rgba(74, 127, 255, 0.2);
    --theme-shadow: rgba(74, 127, 255, 0.2);
    --theme-glow: rgba(74, 127, 255, 0.3);
    --theme-gradient: linear-gradient(135deg, #4a7fff 0%, #6a4aff 60%, #8a4aff 100%);
    --theme-input-bg: rgba(10, 14, 26, 0.6);
    --sidebar-bg: rgba(10, 14, 26, 0.92);
}

[data-theme="amber"] {
    --theme-bg: #1a0e0a;
    --theme-bg-gradient1: #4e2a1a;
    --theme-bg-gradient2: #5e1a1a;
    --theme-card-bg: rgba(40, 20, 10, 0.4);
    --theme-card-bg-hover: rgba(55, 30, 20, 0.7);
    --theme-accent: #ff8f4a;
    --theme-accent-light: #ffb88a;
    --theme-accent-dark: #df6a2a;
    --theme-text: #f5ede8;
    --theme-text-muted: #997a6a;
    --theme-text-dark: #b58a7a;
    --theme-border: rgba(255, 143, 74, 0.08);
    --theme-border-hover: rgba(255, 143, 74, 0.2);
    --theme-shadow: rgba(255, 143, 74, 0.2);
    --theme-glow: rgba(255, 143, 74, 0.3);
    --theme-gradient: linear-gradient(135deg, #ff8f4a 0%, #ff6a4a 60%, #ff4a6a 100%);
    --theme-input-bg: rgba(26, 14, 10, 0.6);
    --sidebar-bg: rgba(26, 14, 10, 0.92);
}

[data-theme="apple_green"] {
    --theme-bg: #0a1a0a;
    --theme-bg-gradient1: #1a4e2a;
    --theme-bg-gradient2: #1a5e2a;
    --theme-card-bg: rgba(10, 40, 20, 0.4);
    --theme-card-bg-hover: rgba(20, 55, 30, 0.7);
    --theme-accent: #4aff7f;
    --theme-accent-light: #8affb4;
    --theme-accent-dark: #2adf5a;
    --theme-text: #e8f5ed;
    --theme-text-muted: #6a997a;
    --theme-text-dark: #8ab59a;
    --theme-border: rgba(74, 255, 127, 0.08);
    --theme-border-hover: rgba(74, 255, 127, 0.2);
    --theme-shadow: rgba(74, 255, 127, 0.2);
    --theme-glow: rgba(74, 255, 127, 0.3);
    --theme-gradient: linear-gradient(135deg, #4aff7f 0%, #4aff4a 60%, #7aff4a 100%);
    --theme-input-bg: rgba(10, 26, 10, 0.6);
    --sidebar-bg: rgba(10, 26, 10, 0.92);
}

[data-theme="pink_orange"] {
    --theme-bg: #1a0a12;
    --theme-bg-gradient1: #4e1a2a;
    --theme-bg-gradient2: #5e1a3a;
    --theme-card-bg: rgba(40, 10, 20, 0.4);
    --theme-card-bg-hover: rgba(55, 20, 30, 0.7);
    --theme-accent: #ff6a8a;
    --theme-accent-light: #ff8aaa;
    --theme-accent-dark: #df4a6a;
    --theme-text: #f5e8ed;
    --theme-text-muted: #996a7a;
    --theme-text-dark: #b58a9a;
    --theme-border: rgba(255, 106, 138, 0.08);
    --theme-border-hover: rgba(255, 106, 138, 0.2);
    --theme-shadow: rgba(255, 106, 138, 0.2);
    --theme-glow: rgba(255, 106, 138, 0.3);
    --theme-gradient: linear-gradient(135deg, #ff6a8a 0%, #ff4a6a 60%, #ff4a4a 100%);
    --theme-input-bg: rgba(26, 10, 18, 0.6);
    --sidebar-bg: rgba(26, 10, 18, 0.92);
}

/* ========================================
   ГЛОБАЛЬНЫЕ СТИЛИ
   ======================================== */

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

html, body {
    height: 100%;
}

body {
    background: var(--theme-bg);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--theme-text);
    background-image: 
        radial-gradient(circle at 15% 25%, var(--theme-bg-gradient1) 0%, var(--theme-bg) 60%),
        radial-gradient(circle at 85% 75%, var(--theme-bg-gradient2) 0%, var(--theme-bg) 50%);
    background-attachment: fixed; /* <-- ДОБАВИТЬ ЭТО */
    transition: background 0.4s ease, color 0.3s ease;
}
a {
    color: var(--theme-accent-light);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--theme-accent);
}

/* ========================================
   СКРОЛЛБАР
   ======================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--theme-card-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--theme-accent);
    border-radius: 10px;
}

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

/* ========================================
   ЛЕВАЯ ПАНЕЛЬ (САЙДБАР)
   ======================================== */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--theme-border);
    padding: 28px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: background 0.4s ease, border-color 0.3s ease;
}

.sidebar .logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: block;
    margin-bottom: 28px;
}

.sidebar .nav-menu {
    list-style: none;
    padding: 0;
}

.sidebar .nav-menu li {
    margin-bottom: 2px;
}

.sidebar .nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--theme-text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: 0.3s;
}

.sidebar .nav-menu a:hover {
    background: rgba(160, 80, 255, 0.06);
    color: var(--theme-accent-light);
}

.sidebar .nav-menu a.active {
    background: rgba(160, 80, 255, 0.1);
    color: var(--theme-accent-light);
}

.sidebar .nav-menu a i {
    width: 18px;
    color: var(--theme-text-muted);
    font-size: 0.9rem;
}

.sidebar .nav-menu a.active i {
    color: var(--theme-accent);
}

.sidebar .nav-divider {
    height: 1px;
    background: var(--theme-border);
    margin: 14px 0;
}

.sidebar .sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--theme-border);
    font-size: 0.65rem;
    color: var(--theme-text-muted);
}

.sidebar .sidebar-footer .discord-link {
    color: var(--theme-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.3s;
}

.sidebar .sidebar-footer .discord-link:hover {
    color: var(--theme-accent-light);
}

/* ========================================
   ОСНОВНОЙ КОНТЕНТ
   ======================================== */

.main-content {
    flex: 1;
    padding: 30px 40px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background 0.4s ease;
}

/* ========================================
   ВЕРХНЯЯ ПАНЕЛЬ (ПРОФИЛЬ)
   ======================================== */

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--theme-border);
    margin-bottom: 28px;
    flex-shrink: 0;
}

.top-bar .profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border-radius: 60px;
    background: rgba(160, 80, 255, 0.08);
    border: 1px solid var(--theme-border);
    transition: 0.3s;
    position: relative;
}

.top-bar .profile-btn:hover {
    background: rgba(160, 80, 255, 0.15);
    border-color: var(--theme-border-hover);
}

.top-bar .profile-btn .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--theme-bg);
    border: 2px solid rgba(168, 85, 247, 0.2);
}

.top-bar .profile-btn .name {
    color: var(--theme-text);
    font-size: 0.85rem;
    font-weight: 500;
}

.top-bar .profile-btn .chevron {
    color: var(--theme-text-muted);
    font-size: 0.7rem;
    transition: 0.3s;
}

.top-bar .profile-btn .chevron.open {
    transform: rotate(180deg);
}

/* ========================================
   ВЫПАДАЮЩЕЕ МЕНЮ
   ======================================== */

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    background: linear-gradient(145deg, #1a0d2e, #120a22);
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 6px 0;
    display: none;
    z-index: 200;
    backdrop-filter: blur(12px);
}

.dropdown-menu.show {
    display: block;
    animation: dropFade 0.2s ease;
}

@keyframes dropFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--theme-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(160, 80, 255, 0.08);
    color: var(--theme-text);
}

.dropdown-menu .dropdown-item i {
    width: 16px;
    color: var(--theme-text-muted);
    font-size: 0.8rem;
}

.dropdown-menu .dropdown-item.danger {
    color: var(--theme-danger);
}

.dropdown-menu .dropdown-item.danger:hover {
    background: rgba(235, 87, 87, 0.08);
}

.dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--theme-border);
    margin: 4px 12px;
}

.dropdown-menu .user-info {
    padding: 8px 16px;
    border-bottom: 1px solid var(--theme-border);
}

.dropdown-menu .user-info .user-name {
    font-weight: 600;
    color: var(--theme-text);
    font-size: 0.85rem;
}

.dropdown-menu .user-info .user-id {
    font-size: 0.65rem;
    color: var(--theme-text-muted);
    word-break: break-all;
}

/* ========================================
   ФУТЕР
   ======================================== */

.main-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--theme-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--theme-text-muted);
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.main-footer a {
    color: var(--theme-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.3s;
}

.main-footer a:hover {
    color: var(--theme-accent-light);
}

/* ========================================
   ГЛАВНАЯ СТРАНИЦА
   ======================================== */

.glass-card {
    background: var(--theme-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 48px;
    padding: 40px 45px 30px;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 25px 60px -12px var(--theme-shadow);
    border: 1px solid var(--theme-border);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--theme-border-hover);
}

.server-title {
    text-align: center;
    margin-bottom: 24px;
}

.server-title h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: break-word;
}

.server-title .subtitle {
    font-size: 0.9rem;
    color: var(--theme-text-muted);
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-top: -4px;
}

.login-area {
    display: flex;
    justify-content: center;
    margin: 20px 0 22px;
}

.btn-login {
    background: linear-gradient(145deg, var(--theme-accent-dark), var(--theme-accent));
    border: 1px solid var(--theme-accent);
    color: #fff;
    padding: 14px 40px;
    border-radius: 60px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px var(--theme-shadow);
    text-transform: uppercase;
    text-decoration: none;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.btn-login .emoji-account {
    font-size: 1.5rem;
    line-height: 1;
}

.btn-login:hover {
    box-shadow: 0 0 50px var(--theme-glow);
    transform: scale(1.03);
    border-color: var(--theme-accent-light);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.info-card {
    background: var(--theme-card-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 28px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--theme-border);
    transition: 0.3s ease;
}

.info-card:hover {
    background: var(--theme-card-bg-hover);
    border-color: var(--theme-border-hover);
}

.info-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--theme-text-muted);
    margin-bottom: 6px;
}

.info-card .value {
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--theme-accent-light);
}

.info-card .value .online-icon {
    font-size: 0.8rem;
    color: var(--theme-accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(168, 85, 247, 0.12);
    padding: 4px 18px 4px 14px;
    border-radius: 60px;
    border: 1px solid var(--theme-accent);
    color: var(--theme-accent-light);
    font-size: 1.1rem;
    box-shadow: 0 0 20px var(--theme-glow);
}

.status-badge.offline {
    background: rgba(180, 60, 120, 0.12);
    border-color: var(--theme-danger);
    color: #e8a0d0;
}

.status-badge i {
    font-size: 1.2rem;
}

.text-muted {
    color: var(--theme-text-muted);
    font-size: 0.7rem;
    margin-top: 4px;
}

/* ========================================
   ПРОФИЛЬ
   ======================================== */

.profile-content {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
    margin-bottom: 22px;
}

.page-title span {
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-card {
    background: var(--theme-card-bg);
    border-radius: 20px;
    border: 1px solid var(--theme-border);
    padding: 26px 28px;
    margin-bottom: 22px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 22px;
}

.avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.avatar-wrap .main-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(168, 85, 247, 0.2);
    background: var(--theme-bg);
}

.avatar-wrap .upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(145deg, var(--theme-accent-dark), var(--theme-accent));
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    border: 2px solid rgba(18, 10, 34, 0.9);
}

.avatar-wrap .upload-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--theme-glow);
}

.user-info .user-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-info .user-name .edit-btn {
    background: rgba(160, 80, 255, 0.08);
    border: 1px solid var(--theme-border);
    color: var(--theme-accent-light);
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}

.user-info .user-name .edit-btn:hover {
    background: rgba(160, 80, 255, 0.15);
    border-color: var(--theme-border-hover);
}

.user-info .user-id {
    color: var(--theme-text-muted);
    font-size: 0.7rem;
    margin-top: 2px;
    font-family: 'Courier New', monospace;
}

.user-info .user-platform {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(160, 80, 255, 0.06);
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.6rem;
    color: var(--theme-accent-light);
    margin-top: 4px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.stats-row .stat-item {
    background: rgba(10, 6, 24, 0.4);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--theme-border);
}

.stats-row .stat-item .stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--theme-accent-light);
}

.stats-row .stat-item .stat-label {
    font-size: 0.5rem;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.info-section {
    background: var(--theme-card-bg);
    border-radius: 20px;
    padding: 18px 26px;
    border: 1px solid var(--theme-border);
    margin-bottom: 22px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.info-section .info-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-accent-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 24px;
    color: var(--theme-text);
    font-size: 0.8rem;
}

.info-section .info-grid .label {
    color: var(--theme-text-muted);
}

.info-section .info-grid .value {
    color: var(--theme-text);
    word-break: break-all;
}

/* ========================================
   ТЕМЫ В ПРОФИЛЕ
   ======================================== */

.themes-section {
    background: var(--theme-card-bg);
    border-radius: 20px;
    padding: 20px 26px;
    border: 1px solid var(--theme-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.themes-section .themes-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-accent-light);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.theme-option {
    background: rgba(10, 6, 24, 0.4);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    border: 2px solid var(--theme-border);
    transition: all 0.3s ease;
    text-align: center;
}

.theme-option:hover {
    transform: translateY(-2px);
    border-color: var(--theme-border-hover);
}

.theme-option.active {
    border-color: var(--theme-accent);
    box-shadow: 0 0 30px var(--theme-glow);
}

.theme-option .theme-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid var(--theme-border);
}

.theme-option .theme-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-text);
}

.theme-option .theme-desc {
    font-size: 0.6rem;
    color: var(--theme-text-muted);
    margin-top: 2px;
}

.theme-option .theme-check {
    display: none;
    color: var(--theme-accent);
    font-size: 0.9rem;
    margin-top: 6px;
}

.theme-option.active .theme-check {
    display: block;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 15, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
    animation: modalFade 0.25s ease;
}

@keyframes modalFade {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-box {
    background: linear-gradient(145deg, #1a0d2e, #120a22);
    border-radius: 20px;
    padding: 26px 24px;
    max-width: 380px;
    width: 100%;
    border: 1px solid var(--theme-border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-box .modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--theme-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

.modal-box .modal-close:hover {
    color: var(--theme-accent-light);
    transform: rotate(90deg);
}

.modal-box .modal-icon {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.modal-box .modal-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-accent-light);
    margin-bottom: 12px;
}

.modal-box .modal-input {
    background: var(--theme-input-bg);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--theme-text);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    transition: 0.3s;
    font-family: inherit;
}

.modal-box .modal-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 20px var(--theme-glow);
}

.modal-box .modal-hint {
    font-size: 0.6rem;
    color: var(--theme-text-muted);
    margin-top: 4px;
}

.modal-box .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    justify-content: flex-end;
}

.modal-box .modal-actions .btn {
    padding: 8px 22px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
    font-size: 0.8rem;
}

.modal-box .modal-actions .btn-primary {
    background: linear-gradient(145deg, var(--theme-accent-dark), var(--theme-accent));
    color: #fff;
}

.modal-box .modal-actions .btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px var(--theme-glow);
}

.modal-box .modal-actions .btn-secondary {
    background: rgba(160, 80, 255, 0.08);
    color: var(--theme-accent-light);
}

.modal-box .modal-actions .btn-secondary:hover {
    background: rgba(160, 80, 255, 0.15);
}

/* ========================================
   АДАПТИВ
   ======================================== */

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        height: auto;
        position: relative;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid var(--theme-border);
    }

    .sidebar .logo {
        margin-bottom: 12px;
        font-size: 1.1rem;
    }

    .sidebar .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
    }

    .sidebar .nav-menu li {
        margin-bottom: 0;
    }

    .sidebar .nav-menu a {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .sidebar .nav-divider {
        display: none;
    }

    .sidebar .sidebar-footer {
        display: none;
    }

    .main-content {
        padding: 16px;
        min-height: auto;
    }

    .top-bar .profile-btn .name {
        display: none;
    }

    .glass-card {
        padding: 24px 20px 20px;
        border-radius: 28px;
        max-width: 100%;
    }

    .server-title h1 {
        font-size: 2.2rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-row {
        flex-direction: column;
        text-align: center;
    }

    .user-info {
        text-align: center;
    }

    .user-info .user-name {
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-section .info-grid {
        grid-template-columns: 1fr;
    }

    .themes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .server-title h1 {
        font-size: 1.8rem;
    }

    .info-card .value {
        font-size: 1.6rem;
    }

    .btn-login {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .themes-grid {
        grid-template-columns: 1fr;
    }

    .modal-box {
        padding: 18px 16px;
        margin: 10px;
    }
}

/* ========================================
   УТИЛИТЫ
   ======================================== */

.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-muted { color: var(--theme-text-muted); }
.text-accent { color: var(--theme-accent); }

.w-full { width: 100%; }
.max-w-800 { max-width: 800px; }
.mx-auto { margin-left: auto; margin-right: auto; }