/* Цветовая палитра по гайдбуку GTLogistics */
:root {
    --gt-red: #d2475e;
    --gt-dark-red: #bc4055;
    --gt-light-silver: #f0f0f0;
    --gt-silver: #dee4ed;
    --gt-black: #3e3346;
    --gt-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Arial', sans-serif;
    background: var(--gt-silver);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    gap: 16px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Акцентный паттерн в сером цвете */
    background-image: 
        linear-gradient(135deg, #c5ccd8 1.5px, transparent 1.5px),
        linear-gradient(135deg, transparent 10px, #c5ccd8 11px);
    background-size: 22px 22px;
    opacity: 0.065;           /* чуть заметнее, но всё ещё лёгкий */
    pointer-events: none;
    z-index: -1;
}

.chat-container {
    width: 100%;
    max-width: 1100px;
    height: 85vh;
    background: var(--gt-white);
    box-shadow: 0 20px 40px -10px rgba(62, 51, 70, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}

/* Шапка */
.chat-header {
    background: linear-gradient(90deg, var(--gt-black) 70%, #2a2330 100%);
    padding: 18px 30px;     /* ← возвращаем как было */
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    min-height: 78px;       /* ← возвращаем комфортную высоту */
}

.chat-header::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background: var(--gt-red);
    transform: rotate(45deg);
    opacity: 0.85;
    z-index: 0;
}

/* Логотип GTBrain в стиле бренда */
.logo-gtbrain {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 2.1rem;
    display: flex;
    align-items: center;
    color: var(--gt-white);
}

.logo-gtbrain .gt {
    color: var(--gt-red);
}

.logo-gtbrain .chevron {
    color: var(--gt-red);
    margin-left: 4px;
    font-size: 2.3rem;
    line-height: 1;
}

.logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 2rem;
    display: flex;
    align-items: center;
    z-index: 2;
}

.logo .gt {
    color: var(--gt-red);
}

.logo .brand {
    color: var(--gt-light-silver);
    margin-left: 2px;
}

.logo .chevron {
    color: var(--gt-red);
    margin-left: 4px;
}

.tagline {
    color: var(--gt-silver);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 1;
}

/* Область сообщений */
.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--gt-light-silver);
    scroll-behavior: smooth;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeSlideUp 0.3s ease;
}

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.message-content {
    padding: 16px 24px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.user .message-content {
    background: var(--gt-red);
    color: var(--gt-white);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
    border-bottom-right-radius: 4px; /* маленький скос как в логотипе */
}

.bot .message-content {
    background: var(--gt-white);
    color: var(--gt-black);
    border-left: 5px solid var(--gt-black);
    clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
}

.sources {
    font-size: 0.8rem;
    color: var(--gt-black);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gt-silver);
}

.sources ul {
    margin: 6px 0 0 20px;
}

.sources li {
    margin-bottom: 4px;
}

/* Анимация загрузки */
.loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--gt-red);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Подвал (Ввод) */
.chat-input-area {
    background: var(--gt-white);
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    border-top: 2px solid var(--gt-silver);
}

.chat-input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid var(--gt-silver);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--gt-black);
    background: var(--gt-white);
    outline: none;
    transition: all 0.2s;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.chat-input:focus {
    border-color: var(--gt-black);
    background: var(--gt-light-silver);
}

button {
    border: none;
    padding: 0 30px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gt-white);
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

#sendBtn, .clear-btn {
    padding: 16px 32px;
    font-weight: 700;
    letter-spacing: 1px;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

#sendBtn {
    background: var(--gt-red);
}

#sendBtn:hover {
    background: var(--gt-dark-red);
}

.clear-btn {
    background: var(--gt-black);
}

.clear-btn:hover {
    background: #2a2330;
}

/* Скроллбар */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--gt-light-silver);
    border-left: 1px solid var(--gt-silver);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gt-silver);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gt-red);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .chat-container {
        height: 95vh;
        clip-path: none;
    }
    .chat-header {
        padding: 15px 20px;
    }
    .logo {
        font-size: 1.5rem;
    }
    .tagline {
        font-size: 0.75rem;
        padding-left: 10px;
    }
    .chat-messages {
        padding: 15px;
    }
    .chat-input-area {
        padding: 15px;
        flex-wrap: wrap;
    }
    .chat-input {
        width: 100%;
        flex: none;
    }
    button {
        padding: 15px;
        flex: 1;
    }
    .chat-header::after {
        display: none;
    }
}

.rating-buttons {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rating-btn {
    padding: 8px 22px !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    background: var(--gt-light-silver) !important;
    color: var(--gt-black) !important;
    border: 2px solid var(--gt-silver) !important;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px) !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rating-btn:hover {
    transform: translateY(-1px);
}

.rating-btn.useful:hover {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: #fff !important;
}

.rating-btn.useless:hover {
    background: #f44336 !important;
    border-color: #f44336 !important;
    color: #fff !important;
}

.rating-status {
    font-size: 0.85rem;
    margin-left: 8px;
    min-width: 140px;
}

/* ===================== ТОП-БАР ПОЛЬЗОВАТЕЛЯ ===================== */
.top-user-bar {
    width: 100%;
    max-width: 1100px;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 10;
    background: transparent;
}

/* ===================== БЛОК ПОЛЬЗОВАТЕЛЯ ===================== */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    color: var(--gt-black);        /* тёмный текст на светлом фоне */
    font-weight: 600;
    font-size: 1.05rem;
    /* Просто строка — без фона, без clip-path */
    white-space: nowrap;
}

.user-menu {
    display: flex;
    gap: 8px;
}

.admin-link,
.logout-link {
    color: var(--gt-white);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 8px 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: all 0.2s ease;
}

.admin-link {
    background: var(--gt-red);
}

.admin-link:hover {
    background: var(--gt-dark-red);
}

.logout-link {
    background: #2a2330;
}

.logout-link:hover {
    background: var(--gt-black);
}

/* Убираем старые стили .user-info, которые были внутри шапки */
.chat-header .user-info {
    display: none; /* на всякий случай, если старый блок остался */
}

/* Адаптивность */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }
    
    .user-menu {
        gap: 10px;
    }
}

/* ===================== ЛОГОТИП GTBRAIN (новый) ===================== */
.header-logo {
    height: 25px;           /* ←←← ИЗМЕНЕНО */
    width: auto;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

Отлично, понял!
Сейчас бот отвечает «сплошным текстом», потому что в chat.js используется .textContent.
Мы хотим красивое форматирование: ### Заголовки, **жирный**, списки -, абзацы и т.д.
Я сделал минимальное и чистое решение без внешних библиотек.
1. Добавь этот CSS в конец style.css
CSS/* ===================== ФОРМАТИРОВАНИЕ МАРКДАУНА В ОТВЕТАХ ===================== */
.message-content h1, .message-content h2, .message-content h3 {
    margin: 18px 0 10px 0;
    font-weight: 700;
    color: var(--gt-black);
    border-bottom: 2px solid var(--gt-silver);
}

.message-content h3 {
    font-size: 1.15rem;
}

.message-content strong {
    color: var(--gt-red);
    font-weight: 700;
}

.message-content em {
    font-style: italic;
    color: var(--gt-black);
}

.message-content ul {
    margin: 12px 0 16px 28px;
    list-style: disc;
}

.message-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.message-content hr {
    border: 0;
    border-top: 2px solid var(--gt-silver);
    margin: 24px 0;
}

.message-content p {
    margin-bottom: 14px;
}

.sources::before {
    content: "🔒 ";
    font-size: 0.7rem;
    opacity: 0.6;
}

/* ===================== АДМИН-ПАНЕЛЬ (в едином стиле с чатом) ===================== */
.admin-container {
    width: 100%;
    max-width: 1400px;
    background: var(--gt-white);
    box-shadow: 0 20px 40px -10px rgba(62, 51, 70, 0.15);
    border-radius: 8px;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.admin-header {
    background: linear-gradient(90deg, var(--gt-black) 70%, #2a2330 100%);
    padding: 22px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    min-height: 78px;
}

.admin-header::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background: var(--gt-red);
    transform: rotate(45deg);
    opacity: 0.85;
    z-index: 0;
}

.admin-header .header-logo {
    height: 32px;
    width: auto;
}

.admin-title {
    color: var(--gt-white);
    font-size: 1.55rem;
    font-weight: 700;
    z-index: 1;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 30px;
    background: var(--gt-light-silver);
    border-bottom: 1px solid var(--gt-silver);
}

.tab-btn {
    background: #f0f0f0;
    color: var(--gt-black);
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--gt-red);
    color: white;
}

.tab-btn.active {
    background: var(--gt-red);
    color: white;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Таблицы */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.admin-table th {
    background: var(--gt-black);
    color: white;
    padding: 14px 16px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gt-silver);
    vertical-align: top;
}

.admin-table tr:hover {
    background: var(--gt-light-silver);
}

/* Карточки статистики */
.stat-card {
    background: var(--gt-light-silver);
    padding: 24px;
    border-radius: 8px;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--gt-black);
}

/* Формы */
.form-group label {
    font-weight: 600;
    color: var(--gt-black);
}

input, select, textarea {
    border: 2px solid var(--gt-silver);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

button:not(.tab-btn) {
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

/* Модальное окно */
#answerModal > div {
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}

/* ===================== АДМИН-ПАНЕЛЬ (ДОПОЛНИТЕЛЬНЫЕ СТИЛИ) ===================== */

.filters {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select {
    min-width: 100px;
}

.pagination {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.pagination button {
    min-width: 100px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-grid .stat-card {
    margin-bottom: 0;
    text-align: center;
}

.dashboard-grid .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--gt-black);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-container canvas {
    max-height: 250px;
    width: 100% !important;
}

/* Таблицы в админке */
#logsTable, #usersTable, #ratingByModelTable, #topUsersTable, #badAnswersTable, #balanceTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#logsTable th, #usersTable th, #ratingByModelTable th, #topUsersTable th, #badAnswersTable th, #balanceTable th {
    background: var(--gt-black);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-align: left;
}

#logsTable td, #usersTable td, #ratingByModelTable td, #topUsersTable td, #badAnswersTable td, #balanceTable td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gt-silver);
    vertical-align: top;
}

#logsTable tr:hover, #usersTable tr:hover, #ratingByModelTable tr:hover, #topUsersTable tr:hover, #badAnswersTable tr:hover, #balanceTable tr:hover {
    background: var(--gt-light-silver);
}

/* Статусы */
.status {
    color: green;
    margin-left: 10px;
}

.error {
    color: var(--gt-red);
}

/* Модальное окно */
#answerModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

#answerModal > div {
    background: white;
    max-width: 800px;
    max-height: 80vh;
    padding: 30px;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Маленькие кнопки */
.btn-small {
    padding: 4px 8px !important;
    font-size: 12px !important;
}

/* Адаптивность для админки */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: left;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}


/* ============================================
   ADMIN PANEL SPECIFIC STYLES
   ============================================ */

.admin-page .admin-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

.admin-main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

/* Карточки статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-mini-card {
    background: var(--gt-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(62, 51, 70, 0.05);
    border-left: 4px solid var(--gt-red);
}

.stat-mini-card .label {
    display: block;
    font-size: 0.85rem;
    color: var(--gt-black);
    opacity: 0.7;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-mini-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gt-black);
}

/* Секции и таблицы */
.admin-section {
    background: var(--gt-white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(62, 51, 70, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--gt-silver);
    color: var(--gt-black);
    font-weight: 600;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gt-light-silver);
    vertical-align: middle;
}

.admin-table tr:hover {
    background: var(--gt-light-silver);
    cursor: pointer;
}

/* Инпуты и Кнопки */
.gt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gt-silver);
    border-radius: 6px;
    font-family: inherit;
    margin-top: 5px;
    transition: border-color 0.2s;
}

.gt-input:focus {
    outline: none;
    border-color: var(--gt-red);
}

.monospace { font-family: monospace; font-size: 0.8rem; }

.btn-primary {
    background: var(--gt-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover { background: var(--gt-dark-red); }

.btn-outline-sm {
    background: transparent;
    border: 1px solid var(--gt-silver);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-outline-sm:hover { background: var(--gt-light-silver); }

/* Статусы */
.text-success { color: #28a745; }
.status-pill {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ok { background: #e8f5e9; color: #2e7d32; }
.status-error { background: #ffebee; color: var(--gt-red); }

/* Адаптивность */
@media (max-width: 900px) {
    .admin-main-layout {
        grid-template-columns: 1fr;
    }
}


#settings-container {
    height: 100%;
}

#settings-container input, #settings-container select{
    height: 38px;
    padding: 10px 12px;
}

#settings-container button{
    height: 38px;
    padding: 10px 12px;
}

#create .form-group {
    margin: 10px 0;
}   

.stat-card {
    margin: 10px 0;
}


/* ===================== ИСПРАВЛЕНИЕ СТИЛЕЙ КНОПОК ===================== */

/* Основные кнопки */
button {
    background: var(--gt-red);
    color: white;
    border: none;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

button:hover {
    background: var(--gt-dark-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Кнопки-вкладки */
.tab-btn {
    background: #f0f0f0;
    color: var(--gt-black);
    padding: 12px 24px;
    font-weight: 600;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.tab-btn:hover {
    background: var(--gt-red);
    color: white;
    transform: none;
    box-shadow: none;
}

.tab-btn.active {
    background: var(--gt-red);
    color: white;
}

/* Кнопки в фильтрах и пагинации */
.filters button,
.pagination button {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Маленькие кнопки в таблицах */
.btn-small {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px) !important;
}

/* Кнопки оценки */
.rating-btn {
    background: var(--gt-light-silver) !important;
    color: var(--gt-black) !important;
    border: 2px solid var(--gt-silver) !important;
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
}

.rating-btn:hover {
    transform: translateY(-1px);
}

.rating-btn.useful:hover {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

.rating-btn.useless:hover {
    background: #f44336 !important;
    border-color: #f44336 !important;
    color: white !important;
}

/* Адаптивность для сетки настроек */
@media (max-width: 900px) {
    #settings > div {
        grid-template-columns: 1fr !important;
    }
}

/* Улучшенные карточки */
.stat-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gt-silver);
    color: var(--gt-black);
}

.stat-card .form-group {
    margin-bottom: 18px;
}

.stat-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--gt-black);
}

.stat-card small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.8rem;
}

/* ===================== СТИЛИ ДЛЯ ФОРМЫ СОЗДАНИЯ ПОЛЬЗОВАТЕЛЯ ===================== */

#create {
    animation: fadeIn 0.3s ease;
}

#create .stat-card {
    box-shadow: 0 10px 30px rgba(62, 51, 70, 0.1);
    transition: transform 0.2s ease;
}

#create .stat-card:hover {
    transform: translateY(-2px);
}

#create input[type="text"],
#create input[type="password"] {
    border: 2px solid var(--gt-silver);
    border-radius: 4px;
    transition: border-color 0.2s ease;
    font-size: 1rem;
}

#create input[type="text"]:focus,
#create input[type="password"]:focus {
    outline: none;
    border-color: var(--gt-red);
    background: var(--gt-white);
}

#create input[type="checkbox"] {
    accent-color: var(--gt-red);
    cursor: pointer;
}

#create button[type="submit"] {
    background: var(--gt-red);
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

#create button[type="submit"]:hover {
    background: var(--gt-dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(210, 71, 94, 0.2);
}

#create .status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
}

#create .status.success {
    background: #e8f5e9;
    color: #2e7d32;
}

#create .status.error {
    background: #ffebee;
    color: var(--gt-red);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== СТРАНИЦА ЛОГИНА ===================== */

.login-page {
    padding: 0;
    gap: 0;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--gt-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(62, 51, 70, 0.2);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    animation: fadeSlideUp 0.4s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gt-black);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gt-black);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.label-icon {
    font-size: 1.1rem;
}

.login-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    border: 2px solid var(--gt-silver);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--gt-black);
    background: var(--gt-white);
    transition: all 0.2s ease;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.login-input:focus {
    outline: none;
    border-color: var(--gt-red);
    background: var(--gt-light-silver);
}

.login-input::placeholder {
    color: #aaa;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    height: 50px;
    background: var(--gt-red);
    color: var(--gt-white);
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: all 0.2s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background: var(--gt-dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(210, 71, 94, 0.25);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.login-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.login-error {
    min-height: 24px;
    margin-top: 16px;
    padding: 10px 14px;
    background: #ffebee;
    border-left: 4px solid var(--gt-red);
    border-radius: 4px;
    color: var(--gt-red);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    color: #999;
    font-size: 0.8rem;
}

.login-footer .dot {
    font-size: 0.5rem;
    opacity: 0.5;
}

/* Адаптивность для страницы логина */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-logo-img {
        height: 32px;
    }
}

.login-error:empty {
    display: none;
}

.login-footer-link {
    color: var(--gt-red);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.login-footer-link:hover {
    color: var(--gt-dark-red);
    border-bottom-color: var(--gt-dark-red);
}

/* ===================== ФУТЕР ЧАТА ===================== */

/* ===================== ФУТЕР ЧАТА ===================== */

.chat-footer {
    background: var(--gt-white);
    padding: 10px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--gt-silver);
    font-size: 0.75rem;
    color: #999;
    /* Скос верхнего левого и нижнего правого углов */
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.chat-footer-text {
    color: #aaa;
    font-weight: 400;
}

.chat-footer-dot {
    font-size: 0.4rem;
    opacity: 0.5;
}

.chat-footer-link {
    color: var(--gt-red);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.chat-footer-link:hover {
    color: var(--gt-dark-red);
    border-bottom-color: var(--gt-dark-red);
}

/* Адаптивность для футера */
@media (max-width: 768px) {
    .chat-footer {
        padding: 8px 15px;
        font-size: 0.7rem;
        flex-wrap: wrap;
        clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    }
}

/* Логотип-ссылка в админке */
.admin-header .logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.admin-header .logo-link:hover {
    opacity: 0.8;
}

.admin-header .logo-link:hover .header-logo {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}