/* style.css — все стили для сайта «УРОКИ AI» */

/* ═══════════════════════════════════════════════
   ОБЩИЕ ПЕРЕМЕННЫЕ И СБРОС
   ═══════════════════════════════════════════════ */

:root {
    /* Неоновые цвета */
    --cyan: #00e5ff;
    --purple: #b388ff;
    --electric: #2979ff;
    --pink: #ff80ab;

    /* Фоны */
    --bg-dark: #0a0a1a;
    --bg-darker: #050510;
    --bg-panel: rgba(15, 15, 35, 0.6);

    /* Текст */
    --text-main: #e0e0ff;
    --text-dim: #8888aa;
    --text-muted: #555570;

    /* Эффекты */
    --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.5), 0 0 40px rgba(0, 229, 255, 0.2);
    --glow-purple: 0 0 20px rgba(179, 136, 255, 0.5), 0 0 40px rgba(179, 136, 255, 0.2);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 20, 40, 0.5);

    /* Шрифты */
    --font-title: 'Orbitron', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    position: relative;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   ФОН — ТЁМНЫЙ ГРАДИЕНТ + SVG-ПАТТЕРН
   ═══════════════════════════════════════════════ */

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(41, 121, 255, 0.08), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(179, 136, 255, 0.06), transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 229, 255, 0.05), transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* Контейнер для SVG-узоров школьных предметов */
.bg-pattern {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.school-item {
    position: absolute;
    animation: float-pattern 12s ease-in-out infinite;
}

/* Субтильный паттерн для страницы чата */
.bg-pattern-subtle .school-item {
    animation-duration: 20s;
}

/* Лёгкое плавание узоров */
@keyframes float-pattern {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-15px); }
}

/* ═══════════════════════════════════════════════
   КАНВАС С ЧАСТИЦАМИ (цифровая рябь)
   ═══════════════════════════════════════════════ */

#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════
   ГЛАВНАЯ СТРАНИЦА — flex-контейнер
   ═══════════════════════════════════════════════ */

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 2;
    gap: 40px;
    padding: 20px;
}

/* Текст-заголовок над кнопкой */
.hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeInDown 1s ease 0.3s forwards;
}

.hero-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--electric));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 60px rgba(0, 229, 255, 0.3);
}

.title-accent {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.3rem);
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 3px;
}

/* ──────────────────────────────────────
   Декоративные вращающиеся кольца
   ────────────────────────────────────── */

.ring-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 255, 0.15);
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 340px;
    height: 340px;
    animation: spin 15s linear infinite;
    border-color: rgba(0, 229, 255, 0.12);
}

.ring-2 {
    width: 420px;
    height: 420px;
    animation: spin 25s linear infinite reverse;
    border-color: rgba(179, 136, 255, 0.1);
}

.ring-3 {
    width: 520px;
    height: 520px;
    animation: spin 40s linear infinite;
    border-color: rgba(41, 121, 255, 0.08);
}

/* Пунктирные сегменты на кольцах */
.ring-1 { border-style: dashed; }
.ring-3 { border-style: dotted; }

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ──────────────────────────────────────
   ГЛАВНАЯ КНОПКА
   ────────────────────────────────────── */

.enter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 22px 60px;
    font-family: var(--font-title);
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    border-radius: 16px;
    background: linear-gradient(135deg, #00e5ff 0%, #2979ff 40%, #6c4dff 70%, #b388ff 100%);
    background-size: 200% 200%;
    box-shadow:
        0 0 30px rgba(0, 229, 255, 0.4),
        0 0 60px rgba(179, 136, 255, 0.25),
        0 8px 32px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    z-index: 2;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards, pulse-glow 3s ease-in-out 1.6s infinite;
}

.enter-btn:hover {
    transform: scale(1.06) translateY(-3px);
    background-position: 100% 100%;
    box-shadow:
        0 0 50px rgba(0, 229, 255, 0.7),
        0 0 100px rgba(179, 136, 255, 0.4),
        0 12px 40px rgba(0, 0, 0, 0.6);
}

.enter-btn:active {
    transform: scale(1.02);
}

.btn-text {
    position: relative;
    z-index: 2;
}

/* Внутреннее свечение кнопки */
.btn-glow {
    position: absolute;
    top: 0; left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.enter-btn:hover .btn-glow {
    left: 100%;
}

/* Пульсация свечения кнопки */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(0, 229, 255, 0.4),
            0 0 60px rgba(179, 136, 255, 0.25),
            0 8px 32px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow:
            0 0 45px rgba(0, 229, 255, 0.6),
            0 0 90px rgba(179, 136, 255, 0.35),
            0 8px 32px rgba(0, 0, 0, 0.5);
    }
}

/* Голографический блик под кнопкой */
.holo-glow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(0, 229, 255, 0.2), transparent 70%);
    filter: blur(20px);
    z-index: 1;
    animation: holo-pulse 4s ease-in-out infinite;
}

@keyframes holo-pulse {
    0%, 100% { opacity: 0.5; width: 300px; }
    50% { opacity: 0.8; width: 360px; }
}

/* ═══════════════════════════════════════════════
   ФУТЕР
   ═══════════════════════════════════════════════ */

.footer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    padding: 12px 16px;
    z-index: 10;
    pointer-events: none;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    line-height: 1.6;
    opacity: 0.7;
}

.footer-content span {
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   СТРАНИЦА АГЕНТА (ЧАТ)
   ═══════════════════════════════════════════════ */

.agent-body {
    overflow: hidden;
}

.agent-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Шапка чата */
.agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: var(--glass-border);
    flex-shrink: 0;
    opacity: 0;
    animation: fadeInDown 0.6s ease forwards;
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-title {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.agent-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 1px;
}

.back-btn {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--cyan);
    text-decoration: none;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.05);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.back-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

/* Лента сообщений */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
}

/* Кастомный скроллбар */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--cyan), var(--purple));
    border-radius: 10px;
}

/* Пузырь сообщения */
.message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
    animation: messageAppear 0.4s ease forwards;
    opacity: 1;
}

/* Сообщение пользователя — справа */
.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(41, 121, 255, 0.2), rgba(108, 77, 255, 0.15));
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
    border-bottom-right-radius: 4px;
}

/* Сообщение агента — слева */
.message.agent {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(20, 20, 50, 0.6), rgba(30, 20, 60, 0.5));
    border: 1px solid rgba(179, 136, 255, 0.25);
    box-shadow: 0 0 15px rgba(179, 136, 255, 0.08);
    border-bottom-left-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Метка автора сообщения */
.message .msg-author {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: 600;
}

.message.user .msg-author {
    color: var(--cyan);
}

.message.agent .msg-author {
    color: var(--purple);
}

/* Текст сообщения */
.message .msg-text {
    color: var(--text-main);
    white-space: pre-wrap;
}

/* Анимация появления сообщения */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Статус «печатает…» */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    align-self: flex-start;
    margin-left: 24px;
    background: rgba(20, 20, 50, 0.5);
    border: 1px solid rgba(179, 136, 255, 0.2);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    margin-bottom: 8px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--purple);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Зона ввода */
.input-area {
    display: flex;
    gap: 12px;
    padding: 16px 24px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: var(--glass-border);
    flex-shrink: 0;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.message-input {
    flex: 1;
    padding: 14px 20px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.message-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    background: rgba(10, 10, 25, 0.9);
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), var(--electric));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
    white-space: nowrap;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Сообщение об ошибке */
.message.error {
    align-self: center;
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.3);
    color: #ff8888;
    font-size: 0.85rem;
    max-width: 90%;
}

/* ═══════════════════════════════════════════════
   АНИМАЦИИ ПОЯВЛЕНИЯ
   ═══════════════════════════════════════════════ */

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════ */

/* Планшеты */
@media (max-width: 768px) {
    .ring-1 { width: 260px; height: 260px; }
    .ring-2 { width: 320px; height: 320px; }
    .ring-3 { width: 400px; height: 400px; }

    .message {
        max-width: 85%;
    }

    .agent-title {
        font-size: 1.3rem;
    }

    .input-area {
        padding: 12px 16px 16px;
    }

    .chat-container {
        padding: 16px;
    }
}

/* Телефоны */
@media (max-width: 480px) {
    .enter-btn {
        padding: 18px 40px;
        letter-spacing: 2px;
    }

    .hero-title {
        letter-spacing: 3px;
    }

    .ring-container {
        display: none;
    }

    .message {
        max-width: 92%;
        font-size: 0.9rem;
    }

    .agent-header {
        padding: 14px 16px;
    }

    .back-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .footer-content {
        font-size: 9px;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   ПАЛИТРА (обновлённая под референс: #050510, неон #00D2FF → #9370DB)
   ════════════════════════════════════════════════════════════════════════ */
:root {
    --bg-dark: #050510;
    --bg-darker: #02020a;
    --bg-panel: rgba(15, 15, 35, 0.7);
    --neon-cyan: #00d2ff;
    --neon-purple: #9370db;
    --neon-gradient: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    --text-main: #e0e0ff;
    --text-dim: #8888aa;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(20, 20, 45, 0.55);
}

body {
    background: var(--bg-dark);
}

/* ═════════════════════════════════════════════════════════════════════════
   ВЕРХНЕЕ МЕНЮ — минималистичные пункты с иконками слева, белый sans-serif
   ════════════════════════════════════════════════════════════════════════ */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-darker);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    text-decoration: none;
}
.nav-icon {
    width: 20px;
    height: 20px;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px var(--neon-cyan));
}
.nav-menu {
    display: flex;
    gap: 12px;
    align-items: center;
}
.nav-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.nav-btn.ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.nav-btn.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--neon-cyan);
    color: #fff;
}
.nav-btn.neon {
    background: var(--neon-gradient);
    border: 1px solid var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.35);
}
.nav-btn.neon:hover {
    box-shadow: 0 0 25px rgba(147, 112, 219, 0.5);
    filter: brightness(1.1);
}
.nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════════════
   СТРАНИЦЫ АВТОРИЗАЦИИ (регистрация / вход)
   ════════════════════════════════════════════════════════════════════════ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-wrapper {
    width: 100%;
    max-width: 420px;
}
.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}
.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
}
.auth-title {
    font-family: var(--font-title);
    font-size: 1.9rem;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 300;
}
.field {
    margin-bottom: 16px;
}
.field label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 7px;
    letter-spacing: 0.4px;
}
.field input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.7);
    border: 1px solid rgba(0, 210, 255, 0.18);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}
.field input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.25);
    background: rgba(10, 10, 25, 0.9);
}
.form-note {
    margin-top: 6px;
    font-size: 0.82rem;
    color: #ff6b6b;
    min-height: 1.2em;
}
.auth-btn {
    width: 100%;
    padding: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 12px;
    background: var(--neon-gradient);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 18px rgba(0, 210, 255, 0.35);
}
.auth-btn:hover:not(:disabled) {
    box-shadow: 0 0 28px rgba(147, 112, 219, 0.5);
    transform: translateY(-1px);
}
.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.auth-footer {
    margin-top: 18px;
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
}
.auth-footer a {
    color: var(--neon-cyan);
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════════
   КАПЧА — минималистичный блок 320×180, слайдер, щит, кнопка Подтвердить
   ════════════════════════════════════════════════════════════════════════ */
.captcha-block {
    width: 100%;
    max-width: 320px;
    height: 180px;
    margin: 26px auto 10px;
    background: rgba(10, 10, 25, 0.6);
    border: 1px solid rgba(0, 210, 255, 0.15);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.captcha-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.captcha-icon {
    width: 24px;
    height: 24px;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}
.captcha-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    letter-spacing: 0.5px;
}
.captcha-slider-wrap {
    width: 230px;
    position: relative;
}
.captcha-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 210, 255, 0.2);
}
.captcha-progress {
    height: 100%;
    width: 0%;
    background: var(--neon-gradient);
    border-radius: 6px;
    transition: width 0.15s linear;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.5);
}
.captcha-handle {
    position: absolute;
    left: 0%;
    top: 50%;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: ew-resize;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.6);
    transition: transform 0.05s linear;
}
.captcha-handle:active { transform: translate(-50%, -50%) scale(1.15); }
.captcha-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 0.3px;
}
.captcha-btn {
    width: 150px;
    padding: 9px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    border-radius: 10px;
    cursor: not-allowed;
    opacity: 0.5;
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.2);
}
.captcha-btn:not([disabled]):hover {
    opacity: 1;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
    background: rgba(0, 210, 255, 0.1);
}
.captcha-status {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    min-height: 1em;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════
   ЛИЧНЫЙ КАБИНЕТ (профиль)
   ════════════════════════════════════════════════════════════════════════ */
.profile-wrapper {
    display: flex;
    justify-content: center;
    padding: 32px 20px;
    min-height: 70vh;
}
.profile-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}
.profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 26px;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--neon-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #050510;
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.45);
}
.profile-info h2.profile-name {
    font-family: var(--font-title);
    font-size: 1.5rem;
    margin-bottom: 4px;
    letter-spacing: 1px;
}
.profile-info .profile-email {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.profile-badge {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}
.profile-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    margin: 20px 0;
}
.profile-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
}
.stat-value {
    display: block;
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}
.profile-actions {
    display: flex;
    gap: 12px;
}
.profile-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}
.profile-btn.neon {
    background: var(--neon-gradient);
    color: #fff;
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.35);
}
.profile-btn.ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ════════════════════════════════════════════════════════════════════════
   ШАПКА ЧАТА — как на референсе
   ════════════════════════════════════════════════════════════════════════ */
.chat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(2, 2, 10, 0.6);
    border-bottom: 1px solid rgba(0, 210, 255, 0.15);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 60;
}
.chat-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    color: #fff;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.chat-subtitle {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0;
    letter-spacing: 0.5px;
}
.home-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 210, 255, 0.05);
    transition: all 0.3s ease;
    white-space: nowrap;
}
.home-btn:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

/* ════════════════════════════════════════════════════════════════════════
   СТРАНИЦА ЧАТА — боковая панель + основная область (стиль референса)
   ════════════════════════════════════════════════════════════════════════ */
.agent-wrapper {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 60px);
    position: relative;
    z-index: 2;
    max-width: none;
    margin: 0;
    width: 100%;
    overflow: hidden;
    background: var(--bg-dark);
}
.chat-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    flex-direction: row;
}
.chat-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #02020a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 210, 255, 0.03);
}
.sidebar-title {
    font-family: var(--font-title);
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: #fff;
}
.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    background: var(--neon-gradient);
    border: 1px solid var(--neon-cyan);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.35);
    white-space: nowrap;
}
.new-chat-btn:hover { filter: brightness(1.1); box-shadow: 0 0 22px rgba(147,112,219,0.5); }
.sidebar-search {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-search input {
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
}
.sidebar-search input:focus { border-color: var(--neon-cyan); }
.chat-list {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}
.chat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
}
.chat-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
.chat-item.active {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 18px rgba(0, 210, 255, 0.1);
}
.chat-item.empty {
    cursor: default;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 24px;
}
.chat-item-main .chat-item-title {
    font-weight: 600;
    color: #fff;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-item-main .chat-item-preview {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #050510;
    overflow: hidden;
    min-height: 75vh;
    height: 100%;
}
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-dim);
    padding: 40px 20px;
}
.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 1px dashed rgba(0, 210, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: var(--neon-cyan);
    font-size: 24px;
}
.empty-title {
    color: #fff;
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.empty-desc {
    font-size: 0.9rem;
    max-width: 260px;
    margin: 0 auto;
    line-height: 1.6;
}

.chat-active {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #050510;
}
.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: rgba(5, 5, 16, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.chat-info .chat-badge {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--neon-purple);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    display: block;
}
.chat-info .chat-name {
    font-family: var(--font-title);
    font-size: 1.15rem;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
}
.chat-actions {
    display: flex;
    gap: 8px;
}
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.25s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover {
    background: rgba(0, 210, 255, 0.12);
    border-color: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
}

/* Лента сообщений */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
    background: #050510;
    min-height: 0;
}
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 10px; }

/* Пузырь сообщения — как на референсе */
.message {
    display: flex;
    flex-direction: column;
    max-width: 72%;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    word-wrap: break-word;
    animation: messageAppear 0.4s ease forwards;
    opacity: 1;
    position: relative;
    color: #fff;
}
/* Сообщение ИИ — неоновый контур, тёмный фон */
.message.agent {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(20, 20, 50, 0.8), rgba(30, 20, 60, 0.7));
    border: 1px solid rgba(147, 112, 219, 0.5);
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.2);
}
/* Сообщение пользователя — справа, спокойный стиль */
.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(41, 121, 255, 0.15));
    border: 1px solid rgba(0, 210, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}
.message .msg-text {
    color: #fff;
}
.message.user .msg-text {
    color: #fff;
}
.message .msg-author {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 7px;
    font-weight: 600;
}
.message.agent .msg-author { color: var(--neon-purple); }
.message.user .msg-author { color: var(--neon-cyan); }

.msg-content { display: flex; flex-direction: column; gap: 10px; }

/* Картинка в сообщении */
.msg-image {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #000;
    max-width: 100%;
}
.msg-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
}

.msg-time {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 8px;
    align-self: flex-end;
}
.message.user .msg-time { align-self: flex-end; }
.message.agent .msg-time { align-self: flex-start; }

/* ИИ-контент: таблицы, картинки, жирный текст, дроби (KaTeX) */
.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.88rem;
}
.ai-table th, .ai-table td {
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 10px;
    text-align: left;
}
.ai-table th { background: rgba(0, 210, 255, 0.1); color: var(--neon-cyan); }
.message .msg-text h1, .message .msg-text h2, .message .msg-text h3 {
    color: #fff;
    font-family: var(--font-title);
    margin: 12px 0 6px;
    letter-spacing: 0.5px;
}
.message .msg-text strong { color: #fff; }
.message .msg-text p { margin: 6px 0; color: var(--text-main); }
.message .msg-text ul, .message .msg-text ol { margin: 8px 0 8px 20px; color: var(--text-main); }
.message .msg-text code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-cyan);
}
.message .msg-text pre {
    background: rgba(10, 10, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-main);
    margin: 8px 0;
}
.message .msg-text pre code { background: none; padding: 0; color: inherit; }

/* Статус печатает */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    align-self: flex-start;
    margin-left: 24px;
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid rgba(147, 112, 219, 0.25);
    border-radius: 16px;
    margin-bottom: 10px;
    box-shadow: 0 0 16px rgba(147, 112, 219, 0.1);
}
.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-purple);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Поле ввода снизу — как на референсе */
.input-area {
    display: flex;
    gap: 12px;
    padding: 18px 24px 22px;
    background: #050510;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    position: relative;
}
.pending-preview {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px dashed var(--neon-cyan);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--neon-cyan);
    z-index: 5;
}
.pending-preview img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 5px;
}
.remove-preview {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 4px;
}
.message-input {
    flex: 1;
    padding: 12px 18px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}
.message-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
    background: rgba(10, 10, 25, 0.75);
}
.message-input::placeholder { color: var(--text-dim); }

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: #02020a;
    background: #00d2ff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
}
.send-btn:hover:not(:disabled) {
    background: #33dcff;
    box-shadow: 0 0 32px rgba(0, 210, 255, 0.7);
}
.send-btn:active { transform: scale(0.98); }
.send-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Анимации */
@keyframes messageAppear {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-7px); opacity: 1; }
}

/* Адаптив чата */
@media (max-width: 900px) {
    .agent-wrapper { flex-direction: column; }
    .chat-layout { flex-direction: column; }
    .chat-sidebar { width: 100%; height: 34vh; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .chat-main { min-height: 64vh; }
}
@media (max-width: 600px) {
    .chat-top { padding: 12px 16px; }
    .chat-title { font-size: 1.15rem; }
    .chat-container { padding: 16px; }
    .message { max-width: 85%; }
    .input-area { padding: 14px 16px 18px; }
}

/* ════════════════════════════════════════════════════════════════════════
   АДМИН-ПАНЕЛЬ (отдельная страница)
   ════════════════════════════════════════════════════════════════════════ */
.admin-body { overflow: hidden; }
.admin-wrapper {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
    overflow: hidden;
}
.admin-nav {
    width: 240px;
    flex-shrink: 0;
    background: #000000;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 210, 255, 0.05);
}
.admin-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--neon-purple);
    background: rgba(147, 112, 219, 0.1);
    border: 1px solid rgba(147, 112, 219, 0.2);
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.6px;
}
.admin-brand span {
    font-family: var(--font-title);
    font-size: 1.05rem;
    color: #fff;
    letter-spacing: 0.5px;
}
.admin-nav-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
}
.admin-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}
.admin-nav-item.active {
    background: rgba(0, 210, 255, 0.12);
    color: #fff;
    border-left-color: var(--neon-cyan);
    box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.1);
}
.admin-nav-item .nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.admin-nav-footer { padding: 12px 20px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.admin-nav-item.logout { color: rgba(255, 90, 90, 0.7); }
.admin-nav-item.logout:hover { color: #ff6b6b; background: rgba(255, 90, 90, 0.08); }

.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--bg-dark);
}
.admin-section { max-width: 1100px; }
.hidden { display: none !important; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    letter-spacing: 1px;
}
.section-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}
.section-toolbar input {
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    min-width: 220px;
}
.section-toolbar input:focus { border-color: var(--neon-cyan); }
.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(10, 10, 25, 0.4);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.88rem;
}
.admin-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-table td {
    padding: 12px 14px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.status-badge {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
}
.status-active { color: #00d2ff; border: 1px solid rgba(0, 210, 255, 0.3); background: rgba(0, 210, 255, 0.08); }
.status-banned { color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.08); }
.empty-msg {
    text-align: center;
    color: var(--text-dim);
    padding: 30px;
    font-size: 0.95rem;
}

.btn-neon {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--neon-cyan);
    background: transparent;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.25);
    transition: all 0.25s ease;
}
.btn-neon:hover {
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.5);
    background: rgba(0, 210, 255, 0.1);
}
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 10px;
}
.stat-card {
    background: rgba(10, 10, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 6px;
}
.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* ═════════════════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .agent-wrapper { flex-direction: column; }
    .chat-layout { flex-direction: column; }
    .chat-sidebar { width: 100%; height: 38vh; border-right: none; border-bottom: var(--glass-border); }
    .chat-main { min-height: 60vh; }
}
@media (max-width: 600px) {
    .top-nav { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .nav-menu { gap: 8px; }
    .auth-card { padding: 24px 18px; }
    .captcha-block { max-width: 100%; }
    .profile-stats { flex-direction: column; gap: 12px; }
    .admin-nav { width: 64px; align-items: center; }
    .admin-nav span, .admin-nav-item-text, .admin-brand span, .section-title { display: none; }
    .admin-nav-item { justify-content: center; padding: 14px 0; }
    .admin-main { padding: 16px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ГЛАВНАЯ СТРАНИЦА — кнопка Premium (золото)
   ═══════════════════════════════════════════════════════════════════════ */
#premiumBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    font-family: var(--font-title);
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffd700 0%, #f4a400 45%, #ffd700 100%);
    box-shadow:
        0 0 25px rgba(255, 215, 0, 0.55),
        0 0 50px rgba(255, 215, 0, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.5);
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.4);
}
#premiumBtn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.8),
        0 0 70px rgba(255, 215, 0, 0.5),
        0 12px 32px rgba(0, 0, 0, 0.6);
    filter: brightness(1.12);
}
#premiumBtn:active { transform: scale(0.97); }

/* ═══════════════════════════════════════════════════════════════════════
   БОКОВАЯ ПАНЕЛЬ — скрытие/показ через стрелку
   ═══════════════════════════════════════════════════════════════════════ */
.chat-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #02020a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.28s ease, transform 0.28s ease;
    z-index: 40;
}
.chat-sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
    border-right: none;
}

/* Стрелка скрытия боковой панели (в шапке) */
#sidebarToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.25s ease;
}
#sidebarToggle:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--neon-cyan);
    color: #fff;
}
#sidebarToggle svg { width: 16px; height: 16px; }

/* Когда sidebar скрыт — кнопка поворачивается */
#chatSidebar.collapsed ~ .chat-main #sidebarToggle svg {
    transform: rotate(180deg);
}

/* Кнопка поддержки под историей чатов */
.sidebar-support {
    margin: 18px 16px;
}
.support-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 128, 171, 0.12);
    border: 1px solid rgba(255, 128, 171, 0.35);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.support-btn svg { width: 18px; height: 18px; }
.support-btn:hover {
    background: rgba(255, 128, 171, 0.25);
    border-color: var(--pink);
    box-shadow: 0 0 18px rgba(255, 128, 171, 0.35);
}

/* Аккаунты */
.sidebar-accounts {
    padding: 10px 16px 6px;
    flex-shrink: 0;
}
.sidebar-section-title {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin-bottom: 10px;
    margin-top: 6px;
}
.account-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.82rem;
    color: var(--text-main);
}
.account-item:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--neon-cyan);
}
.account-item.active {
    background: rgba(0, 210, 255, 0.18);
    border-color: var(--neon-cyan);
    color: #fff;
}
.account-item .account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--neon-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #02020a;
    flex-shrink: 0;
}
.account-item .account-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-item .account-remove {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    margin-left: auto;
    opacity: 0.6;
}
.account-item .account-remove:hover { opacity: 1; }

.add-account-btn {
    width: 100%;
    padding: 9px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: transparent;
    border: 1px solid var(--neon-purple);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(147, 112, 219, 0.25);
}
.add-account-btn:hover:not(:disabled) {
    box-shadow: 0 0 22px rgba(147, 112, 219, 0.5);
    background: rgba(147, 112, 219, 0.1);
    filter: brightness(1.1);
}
.add-account-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Настройки */
.sidebar-settings {
    padding: 6px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 220px;
}
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text-main);
}
.setting-label { flex: 1; font-family: var(--font-body); }
input[type="color"] {
    width: 44px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}
input[type="color"]::-webkit-color-picker-wrapper { padding: 0; }
input[type="color"]::-webkit-color-picker-button { border: none; }

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    transition: 0.25s;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
}
.switch input:checked + .switch-slider {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
}
.switch input:checked + .switch-slider:before {
    transform: translateX(18px);
}

/* Сообщение администратора в чате */
.message.admin {
    align-self: flex-start;
    background: rgba(147, 112, 219, 0.1);
    border: 1px solid rgba(147, 112, 219, 0.3);
    box-shadow: 0 0 16px rgba(147, 112, 219, 0.1);
}
.message.admin .msg-author { color: var(--neon-purple); }

/* Тип-бейдж чата (поддержка) в сайдбаре */
.type-badge {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    background: rgba(147, 112, 219, 0.15);
    border: 1px solid rgba(147, 112, 219, 0.35);
    color: var(--neon-purple);
    white-space: nowrap;
}
.type-badge-support {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    background: rgba(255, 128, 171, 0.15);
    border: 1px solid rgba(255, 128, 171, 0.35);
    color: var(--pink);
    white-space: nowrap;
}

/* Кнопки действий в строке чата (переименовать / удалить) */
.chat-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.chat-item:hover .chat-item-actions { opacity: 1; }
.chat-item.active .chat-item-actions { opacity: 1; }

.chat-act {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: all 0.2s ease;
}
.chat-act:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--neon-cyan);
    color: #fff;
}
.chat-act-delete:hover { background: rgba(255, 107, 107, 0.15); border-color: #ff6b6b; color: #ff6b6b; }

.rename-input {
    width: calc(100% - 70px);
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--neon-cyan);
    background: rgba(10, 10, 25, 0.6);
    color: #fff;
    outline: none;
}
.rename-input:focus { border-color: var(--neon-purple); }

.chat-act-save, .chat-act-cancel {
    font-size: 0.7rem;
    padding: 0 8px;
}
.chat-act-save:hover { background: rgba(0, 210, 255, 0.25); border-color: var(--neon-cyan); color: #fff; }
.chat-act-cancel:hover { background: rgba(255, 107, 107, 0.15); border-color: #ff6b6b; color: #ff6b6b; }

/* Адаптив: когда sidebar скрыт на мобильных */
@media (max-width: 900px) {
    .chat-sidebar { width: 280px; }
    .chat-sidebar.collapsed { width: 0; transform: translateX(-100%); }
}
@media (max-width: 600px) {
    .chat-sidebar { width: 260px; }
    .sidebar-settings { max-height: 200px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   НОВЫЕ ЭЛЕМЕНТЫ: удаление / переименование чатов, поддержка, админ-модалка
   ═══════════════════════════════════════════════════════════════════════ */

/* Метка типа чата (поддержка) в сайдбаре */
.type-badge {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    background: rgba(147, 112, 219, 0.15);
    border: 1px solid rgba(147, 112, 219, 0.35);
    color: var(--neon-purple);
    white-space: nowrap;
}

/* Кнопки действий в строке чата (переименовать / удалить) */
.chat-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.chat-item:hover .chat-item-actions { opacity: 1; }
.chat-item.active .chat-item-actions { opacity: 1; }

.chat-act {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: all 0.2s ease;
}
.chat-act:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--neon-cyan);
    color: #fff;
}
.chat-act-delete:hover { background: rgba(255, 107, 107, 0.15); border-color: #ff6b6b; color: #ff6b6b; }

/* Инпут переименования */
.rename-input {
    width: calc(100% - 70px);
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--neon-cyan);
    background: rgba(10, 10, 25, 0.6);
    color: #fff;
    outline: none;
}
.rename-input:focus { border-color: var(--neon-purple); }

.chat-act-save, .chat-act-cancel {
    font-size: 0.7rem;
    padding: 0 8px;
}
.chat-act-save:hover { background: rgba(0, 210, 255, 0.25); border-color: var(--neon-cyan); color: #fff; }
.chat-act-cancel:hover { background: rgba(255, 107, 107, 0.15); border-color: #ff6b6b; color: #ff6b6b; }

/* Сообщение администратора в чате */
.message.admin {
    align-self: flex-start;
    background: rgba(147, 112, 219, 0.1);
    border: 1px solid rgba(147, 112, 219, 0.3);
    box-shadow: 0 0 16px rgba(147, 112, 219, 0.1);
}
.message.admin .msg-author { color: var(--neon-purple); }

/* Бейджи ролей и ИИ в админ-панели */
.role-badge {
    font-size: 0.66rem;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-right: 4px;
}
.role-premium { color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.35); background: rgba(255, 215, 0, 0.1); }
.role-moderator { color: #00d2ff; border: 1px solid rgba(0, 210, 255, 0.35); background: rgba(0, 210, 255, 0.1); }
.role-support { color: #ff80ab; border: 1px solid rgba(255, 128, 171, 0.35); background: rgba(255, 128, 171, 0.1); }
.role-user { color: var(--text-dim); border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); }

.ai-badge {
    font-size: 0.66rem;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.ai-on { color: #00d2ff; border: 1px solid rgba(0, 210, 255, 0.35); background: rgba(0, 210, 255, 0.1); }
.ai-off { color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.1); }

.type-badge-support {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    background: rgba(255, 128, 171, 0.15);
    border: 1px solid rgba(255, 128, 171, 0.35);
    color: var(--pink);
    white-space: nowrap;
}

/* Модальное окно просмотра сообщений чата (админ) */
.admin-message-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: none;
}
.admin-message-modal.open { display: block; }
.admin-message-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.admin-message-modal-window {
    position: absolute;
    top: 10vh; left: 10%; right: 10%;
    width: 80%;
    max-width: 900px;
    height: 70vh;
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalAppear 0.3s ease forwards;
}
@keyframes modalAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.admin-message-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}
.admin-message-modal-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
}
.admin-message-modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--text-dim);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.admin-message-modal-close:hover { color: #fff; }

.admin-message-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    animation: messageAppear 0.3s ease forwards;
}
.modal-message.user { align-self: flex-start; background: rgba(20, 20, 50, 0.35); border: 1px solid rgba(0, 210, 255, 0.15); }
.modal-message.agent { align-self: flex-start; background: rgba(15, 15, 35, 0.5); border: 1px solid rgba(147, 112, 219, 0.25); }
.modal-message.admin { align-self: flex-end; background: rgba(147, 112, 219, 0.1); border: 1px solid rgba(147, 112, 219, 0.3); }
.mm-author {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.modal-message.user .mm-author { color: var(--neon-cyan); }
.modal-message.agent .mm-author { color: var(--neon-purple); }
.modal-message.admin .mm-author { color: var(--pink); }
.mm-time { font-weight: 400; opacity: 0.7; }
.mm-text { color: var(--text-main); white-space: pre-wrap; }
.mm-text.mm-plain { white-space: pre-wrap; }

.admin-message-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-message-modal-footer textarea {
    width: 100%;
    resize: vertical;
    min-height: 60px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
}
.admin-message-modal-footer textarea:focus { border-color: var(--neon-cyan); }
.admin-message-modal-footer .btn-neon.ghost {
    align-self: flex-start;
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: #fff;
}

/* Галочка согласия в регистрации */
.agree-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}
.agree-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}
.agree-field label {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.4;
    cursor: pointer;
}
.agree-field label a { color: var(--neon-cyan); text-decoration: underline; }

/* Бейджи ролей в профиле */
.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Бейдж владельца (красный) */
.role-owner {
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.35);
    background: rgba(255, 68, 68, 0.1);
}


/* ═══════════════════════════════════════════════════════════════════════
   АДМИН ВКЛАДКИ: Теги / Наказания / Создать
   ═══════════════════════════════════════════════════════════════════════ */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.admin-tab {
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.admin-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-cyan);
    color: #fff;
}
.admin-tab.active {
    background: var(--neon-gradient);
    border-color: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 18px rgba(0, 210, 255, 0.35);
}

/* Карточка создания аккаунта */
.admin-create-card {
    background: rgba(10, 10, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    margin: 20px auto;
}
.admin-create-card h3 {
    font-family: var(--font-title);
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: 1px;
}
.admin-create-note {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0 0 18px;
}

/* Регулятор высоты чата */
.chat-resize-handle {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background: rgba(0, 210, 255, 0.3);
    border-top: 1px solid rgba(0, 210, 255, 0.6);
    cursor: row-resize;
    z-index: 100;
    display: block;
}
.chat-resize-handle:hover {
    background: rgba(0, 210, 255, 0.5);
    height: 10px;
}

/* Кнопка просмотра профиля */
.view-profile-btn {
    background: rgba(147, 112, 219, 0.15);
    border: 1px solid rgba(147, 112, 219, 0.35);
    color: var(--neon-purple);
}
.view-profile-btn:hover {
    background: rgba(147, 112, 219, 0.3);
    border-color: var(--neon-purple);
    color: #fff;
}

/* ═════════════════════════════════════════════════════════════════════════════════════════
   НОВОЕ: режим ИИ (селектор рядом с отправкой)
   ═════════════════════════════════════════════════════════════════════════════════════════ */
.ai-mode-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    flex-shrink: 0;
}
.ai-mode-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.ai-mode-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.ai-mode-select {
    appearance: none;
    padding: 8px 34px 8px 12px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    min-width: 130px;
}
.ai-mode-select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.2);
}
.ai-mode-select option { background: #050510; color: #fff; padding: 8px; }
.ai-mode-arrow {
    position: absolute;
    right: 10px;
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-dim);
    pointer-events: none;
}
.ai-mode-locked {
    opacity: 0.55;
    pointer-events: none;
    background: rgba(10, 10, 25, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Индикатор остатка запросов возле кнопки отправки */
.ai-quota {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.ai-quota .quota-value { font-weight: 700; color: var(--text-main); }
.ai-quota.warn { color: #ffd700; border-color: rgba(255, 215, 0, 0.35); }
.ai-quota.empty { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.35); }

/* Заблокированный режим — подсказка о премиуме (ненавязчиво) */
.ai-premium-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px dashed rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    color: #ffd700;
    font-size: 0.78rem;
    margin: 0 24px 8px;
    flex-shrink: 0;
}
.ai-premium-hint .lock-icon { font-size: 1rem; }

/* Сообщение: ИИ глобально отключён */
.ai-global-off {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}
.ai-global-off .off-icon {
    font-size: 44px;
    margin-bottom: 14px;
    opacity: 0.5;
}
.ai-global-off .off-title {
    color: #fff;
    font-family: var(--font-title);
    font-size: 1.25rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.ai-global-off .off-desc {
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Мульtlайн-поле ввода (textarea) */
.message-input {
    flex: 1;
    min-height: 44px;
    max-height: 150px;
    resize: none;
    padding: 12px 18px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    line-height: 1.5;
    overflow-y: auto;
}
.message-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
    background: rgba(10, 10, 25, 0.75);
}
.message-input::placeholder { color: var(--text-dim); }

/* Блокировка кнопки отправки при лимите/недоступности */
.send-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* ═════════════════════════════════════════════════════════════════════════════════════════
   ПАНЕЛЬ ПОДДЕРЖКИ / МОДЕРАТОРА (страницы support / moderator)
   ═════════════════════════════════════════════════════════════════════════════════════════ */
.staff-body { overflow: hidden; }
.staff-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-darker);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.staff-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-decoration: none;
}
.staff-menu { display: flex; gap: 10px; align-items: center; }
.staff-panel {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: var(--bg-dark);
}
.staff-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #02020a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.staff-sidebar.collapsed { width: 0; transform: translateX(-100%); border-right: none; }
.staff-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 210, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.staff-sidebar-title {
    font-family: var(--font-title);
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: #fff;
}
.staff-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.staff-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.88rem;
    border-left: 3px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
    white-space: nowrap;
}
.staff-nav-item:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.staff-nav-item.active {
    background: rgba(0, 210, 255, 0.12);
    color: #fff;
    border-left-color: var(--neon-cyan);
    box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.1);
}
.staff-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.staff-nav-footer { padding: 12px 20px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.staff-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--bg-dark);
}
.staff-section { max-width: 1200px; }
.staff-section-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: #fff;
    margin: 0 0 20px;
    letter-spacing: 1px;
}
.staff-card {
    background: rgba(10, 10, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
}
.staff-card h3 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: #fff;
    margin: 0 0 14px;
    letter-spacing: 0.5px;
}
.staff-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.staff-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.staff-input {
    flex: 1;
    min-width: 170px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-main);
    background: rgba(10, 10, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
}
.staff-input:focus { border-color: var(--neon-cyan); }
.staff-input::placeholder { color: var(--text-dim); }
.staff-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(10, 10, 25, 0.4);
}
.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.86rem;
}
.staff-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-weight: 600;
    text-align: left;
    padding: 11px 14px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.staff-table td {
    padding: 11px 14px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}
.staff-table tr:last-child td { border-bottom: none; }
.staff-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.staff-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 30px;
    font-size: 0.95rem;
}
.staff-badge {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.staff-badge-premium { color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.35); background: rgba(255, 215, 0, 0.1); }
.staff-badge-support { color: #ff80ab; border: 1px solid rgba(255, 128, 171, 0.35); background: rgba(255, 128, 171, 0.1); }
.staff-badge-moderator { color: #00d2ff; border: 1px solid rgba(0, 210, 255, 0.35); background: rgba(0, 210, 255, 0.1); }
.staff-badge-guest { color: var(--text-dim); border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); }
.staff-badge-active { color: #00d2ff; border: 1px solid rgba(0, 210, 255, 0.3); background: rgba(0, 210, 255, 0.08); }
.staff-badge-banned { color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.08); }

/* Сообщение о блокировке пользователя (модалка/страница) */
.blocked-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}
.blocked-notice .lock-big { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.blocked-notice .blocked-title {
    color: #ff6b6b;
    font-family: var(--font-title);
    font-size: 1.4rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.blocked-notice .blocked-desc {
    font-size: 0.95rem;
    max-width: 340px;
    margin: 0 auto 18px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТИВНОСТЬ (от 320px)
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .agent-wrapper { flex-direction: column; }
    .chat-layout { flex-direction: column; }
    .chat-sidebar { width: 100%; height: 38vh; border-right: none; border-bottom: var(--glass-border); }
    .chat-main { min-height: 60vh; }

    .admin-wrapper { flex-direction: column; }
    .admin-nav { width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .admin-nav-item { justify-content: center; padding: 10px 4px; }
    .admin-nav-item-text { display: none; }
    .admin-main { padding: 16px 12px; }

    .staff-panel { flex-direction: column; }
    .staff-sidebar { width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .staff-nav-item { justify-content: center; padding: 10px 4px; }
    .staff-nav-item-text { display: none; }
    .staff-main { padding: 16px 12px; }
}

@media (max-width: 600px) {
    .top-nav { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .nav-menu { gap: 8px; }
    .auth-card { padding: 24px 18px; }
    .captcha-block { max-width: 100%; }
    .profile-stats { flex-direction: column; gap: 12px; }
    .admin-nav { width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .admin-nav span, .admin-nav-item-text, .admin-brand span, .section-title { display: none; }
    .admin-nav-item { justify-content: center; padding: 14px 0; }
    .admin-main { padding: 16px 12px; }
}

@media (max-width: 480px) {
    /* Главная */
    .enter-btn {
        padding: 16px 32px;
        letter-spacing: 2px;
    }

    .hero-title {
        letter-spacing: 3px;
    }

    .ring-container {
        display: none;
    }

    /* Регистрация */
    .captcha-block { max-width: 100%; height: auto; }
    .captcha-slider-wrap { width: 100%; }
    .captcha-btn { width: 100%; }

    /* Чат */
    .message {
        max-width: 92%;
        font-size: 0.9rem;
    }

    .agent-header {
        padding: 14px 16px;
    }

    .back-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .footer-content {
        font-size: 9px;
    }

    .chat-sidebar {
        width: 100%;
        height: 34vh;
        border-right: none;
        border-bottom: var(--glass-border);
    }

    .chat-main {
        min-height: 56vh;
    }

    .chat-container {
        padding: 16px;
    }

    .message {
        max-width: 85%;
    }

    .input-area {
        padding: 14px 16px 18px;
    }

    .ai-mode-selector {
        margin-left: 6px;
    }

    .ai-mode-wrap {
        min-width: auto;
    }

    .ai-mode-select {
        min-width: 110px;
        padding: 7px 30px 7px 10px;
        font-size: 0.78rem;
    }

    .ai-quota {
        margin-left: 0;
        margin-top: 8px;
        order: 3;
        width: 100%;
        justify-content: center;
        font-size: 0.68rem;
        padding: 5px 8px;
    }

    .message-input {
        min-height: 48px;
    }

    .send-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    /* Панели поддержки / модератора на телефоне */
    .staff-sidebar { width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .staff-nav-item { justify-content: center; padding: 10px 4px; }
    .staff-nav-item-text { display: none; }
    .staff-main { padding: 14px 16px; }

    .staff-card { padding: 16px; }
    .staff-row { flex-direction: column; align-items: stretch; }
    .staff-input { min-width: 100%; }

    .admin-nav { width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .admin-nav-item { justify-content: center; padding: 10px 4px; }
    .admin-nav-item-text { display: none; }
    .admin-main { padding: 14px 16px; }
}

/* Кастомный скроллбар для панелей */
.staff-main::-webkit-scrollbar { width: 6px; }
.staff-main::-webkit-scrollbar-track { background: transparent; }
.staff-main::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 10px; }
