/* assets/css/style.css - единый стиль Кибероникс */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, #f6f9fc 0%, #eef2f5 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Декоративные фоновые элементы */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.shape-1 {
    width: 40vw;
    height: 40vw;
    background: #3b82f6;
    top: -15vh;
    left: -10vw;
}

.shape-2 {
    width: 35vw;
    height: 35vw;
    background: #a855f7;
    bottom: -10vh;
    right: -5vw;
}

.shape-3 {
    width: 25vw;
    height: 25vw;
    background: #10b981;
    top: 40%;
    left: 70%;
    opacity: 0.25;
}

/* Контейнеры */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* Навигация */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b, #2d3a5e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* Карточки */
.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    border-radius: 2rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 55px -18px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.card-body {
    padding: 1.2rem;
}

.card-footer {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.8rem 1.2rem;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #1e293b;
}

.btn-outline-light:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

.btn-outline-primary:hover {
    background: #3b82f6;
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid #64748b;
    color: #64748b;
}

.btn-outline-secondary:hover {
    background: #64748b;
    color: white;
}

.btn-outline-info {
    background: transparent;
    border: 1px solid #8b5cf6;
    color: #8b5cf6;
}

.btn-outline-info:hover {
    background: #8b5cf6;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: white;
}

/* .btn-outline-success не существовал — из-за этого кнопка "Анализ диалогов"
   на bot-stats.php (единственное место, где использовался этот класс)
   оставалась без обводки/цвета и падала на голые стили .btn, выбиваясь из
   ряда рядом со своими btn-outline-info/btn-outline-primary соседями. */
.btn-outline-success {
    background: transparent;
    border: 1px solid #10b981;
    color: #10b981;
}

.btn-outline-success:hover {
    background: #10b981;
    color: white;
}

/* Формы */
.form-group {
    margin-bottom: 0.8rem;
}

.form-label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: #1e293b;
}

.form-control {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 60px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Переключатель видимости пароля (значок "глаз") — регистрация
   (register.php), задание нового пароля при восстановлении
   (reset-password.php). JS: cyberonixTogglePasswordVisibility() в
   assets/js/main.js. Обёртка нужна, чтобы позиционировать кнопку-иконку
   поверх правого края поля без лишней разметки вокруг самого input. */
.password-input-wrap {
    position: relative;
}
.password-input-wrap input.form-control {
    padding-right: 2.6rem;
}
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle-btn:hover {
    color: #475569;
}
[data-theme="dark"] .password-toggle-btn {
    color: #64748b;
}
[data-theme="dark"] .password-toggle-btn:hover {
    color: #cbd5e1;
}

textarea.form-control {
    border-radius: 1rem;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.2em;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: #3b82f6;
}

.form-check-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
}

/* Алерты */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fed7aa;
    color: #92400e;
    border: 1px solid #fdba74;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 1;
}

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
}

.table th {
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 40px;
}

.bg-success {
    background: #10b981;
    color: white;
}

.bg-danger {
    background: #ef4444;
    color: white;
}

.bg-secondary {
    background: #64748b;
    color: white;
}

.bg-info {
    background: #8b5cf6;
    color: white;
}

.bg-primary {
    background: #3b82f6;
    color: white;
}

.bg-dark {
    background: #1e293b;
    color: white;
}

.bg-teal {
    background: #14b8a6;
    color: white;
}

.bg-warning {
    background: #f59e0b;
    color: white;
}

.bg-light {
    background: #f1f5f9;
    color: #1e293b;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    max-width: 500px;
    width: 90%;
    margin: 20px;
}

.modal-lg {
    max-width: 800px;
}

.modal-content {
    background: white;
    border-radius: 2rem;
    overflow: hidden;
    animation: fadeSlideUp 0.25s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-body {
    padding: 1.2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 0.8rem 1.2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Сетка */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

/* .col-md-3 отсутствовал в таблице стилей, хотя используется на нескольких
   страницах (stats.php, admin/partner-payouts.php, bot-analysis.php,
   tasks.php, customers.php, bot-dialogs.php) — без width/padding эти карточки
   схлопывались до размера контента и "прижимались" друг к другу внутри
   flex-строки .row. */
.col-md-3 {
    width: 25%;
    padding: 0 10px;
}

.col-md-4 {
    width: 33.333%;
    padding: 0 10px;
}

.col-md-5 {
    width: 41.666%;
    padding: 0 10px;
}

.col-md-6 {
    width: 50%;
    padding: 0 10px;
}

.col-md-7 {
    width: 58.333%;
    padding: 0 10px;
}

.col-md-8 {
    width: 66.666%;
    padding: 0 10px;
}

.col-md-12 {
    width: 100%;
    padding: 0 10px;
}

/* Базовый цвет ссылок без явного класса (кнопки/бейджи/уже оформленные
   ссылки переопределяют своим классом) — иначе браузер применяет
   дефолтный синий/фиолетовый цвет ссылок, который не зависит от темы */
a { color: #1e293b; }
a:visited { color: #1e293b; }
[data-theme="dark"] a { color: #f1f5f9; }
[data-theme="dark"] a:visited { color: #f1f5f9; }

/* Утилиты */
.text-center { text-align: center; }
.text-muted { color: #64748b; }
.footer { border-top: 1px solid #e2e8f0; color: #64748b; }
.checkout-status-info { color: #2563eb; }
.text-white { color: white; }
.text-danger { color: #ef4444; }
.text-success { color: #10b981; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.ms-2 { margin-left: 8px; }
.ms-3 { margin-left: 12px; }
.ms-auto { margin-left: auto; }

.me-2 { margin-right: 8px; }
.me-3 { margin-right: 12px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }

.w-100 { width: 100%; }

/* Специфичные стили */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    overflow-x: auto;
}

.bot-card {
    transition: transform 0.2s;
    height: 100%;
}

.bot-card:hover {
    transform: translateY(-5px);
}

/* Диалоги */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-group-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.8rem;
    transition: all 0.2s;
}

.list-group-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.prompt-textarea {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 1rem;
}

/* Поле "Обновить промт через ИИ" — тот же увеличенный размер шрифта, что и
   у основного текста промта выше, для единообразия и читаемости */
.prompt-instructions-textarea {
    font-size: 15px;
    line-height: 1.5;
}

/* ========================================
   ПОШАГОВЫЙ МАСТЕР (ONBOARDING)
   ======================================== */

/* Отступ сверху */
.onboarding-container {
    max-width: 1300px;
    margin: 40px auto 0;
    padding: 0 30px;
}

.onboarding-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 50px;
    flex-wrap: wrap;
}

.onboarding-form-col {
    flex: 1;
    min-width: 480px;
    max-width: 800px;
}

/* ===== ВИДЖЕТ ПРЕДПРОСМОТРА — ФИКСИРОВАННЫЙ ===== */
/* Раньше колонка была шире (480px) под старое окно предпросмотра шириной
   380px — с тех пор окно приведено к эталонному размеру 323px (как у бота
   "Кибер" на главной и у настоящего виджета), и широкая колонка стала
   оставлять вокруг него слишком много пустого места, из-за чего страница
   выглядела разбалансированной. Колонка сужена вплотную под новый размер
   окна — форма слева при этом получает больше места (flex: 1). */
.onboarding-preview-col {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    width: 363px;
    max-width: 380px;
    flex: 0 0 auto;
    z-index: 50;
}

/* Карточки */
.onboarding-form-col .card {
    margin-bottom: 24px;
    border-radius: 20px;
    border: none !important;
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.15) !important;
}

.onboarding-form-col .card:hover {
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.2) !important;
}

.onboarding-form-col .card-header {
    padding: 16px 20px;
    font-size: 16px;
}

.onboarding-form-col .card-body {
    padding: 24px;
}

/* Формы */
.onboarding-form-col .form-group {
    margin-bottom: 20px;
}

.onboarding-form-col .form-label {
    font-size: 14px;
    margin-bottom: 6px;
}

.onboarding-form-col .form-control {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 12px;
}

.onboarding-form-col textarea.form-control {
    padding: 12px 16px;
}

/* Индикатор шагов */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.step.active {
    background: #3b82f6;
    color: white;
}

.step.completed {
    background: #10b981;
    color: white;
}

.step .step-number {
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

/* Сфера деятельности */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* AI-анализ сайта на первом шаге создания бота */
.site-analysis-box {
    margin-top: 14px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
    border: 1px solid rgba(59,130,246,0.25);
    animation: siteAnalysisReveal 0.4s ease-out;
}
@keyframes siteAnalysisReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.site-analysis-header {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
    color: #3b82f6;
}
.site-analysis-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.site-analysis-chips span {
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.3);
    color: #3b82f6;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 20px;
}
[data-theme="dark"] .site-analysis-chips span { color: #93c5fd; }

.industry-option {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 13px;
}

.industry-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.industry-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* Аватарки */
.avatar-preview {
    text-align: center;
    margin-bottom: 16px;
}

.avatar-preview img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3b82f6;
    background: #e2e8f0;
}

.avatar-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.avatar-tab-btn {
    transition: all 0.2s;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
}

.avatar-tab-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.avatar-tab-btn:not(.active) {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.avatar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    border-radius: 16px;
}

.avatar-gallery-item {
    cursor: pointer;
    text-align: center;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid transparent;
}

.avatar-gallery-item.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.avatar-gallery-item img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-gallery-item .avatar-name {
    font-size: 10px;
}

/* Хобби */
.hobbies-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.hobby-option {
    padding: 4px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.hobby-option:hover {
    background: #e2e8f0;
}

.hobby-option.selected {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Запрещённые темы */
.forbidden-topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.forbidden-topic-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.forbidden-topic-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ef4444;
}

/* Цели бота */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.goal-option {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.goal-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.goal-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.goal-option i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.goal-option strong {
    display: block;
    font-size: 14px;
}

.goal-option p {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Страницы сайта */
.page-item {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.product-item {
    background: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.row-split {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.row-split .form-control {
    flex: 1;
    min-width: 120px;
}

.page-status {
    margin-top: 6px;
    font-size: 12px;
}

/* ===== ПРЕДПРОСМОТР ВИДЖЕТА ===== */
.onboarding-preview-col .preview-box {
    position: sticky;
    top: 30px;
    border-radius: 24px;
    overflow: hidden;
}

.onboarding-preview-col .chat-preview {
    /* Ровно тот же размер, что и у настоящего окна виджета на сайте
       (widget/widget.js) и у демо-окна бота "Кибер" на главной странице
       (assets/css/landing.css, .lp-demo-widget) — единый эталонный размер
       диалогового окна для всего проекта. Раньше здесь был width:380px без
       фиксированной высоты (высота "плавала" по контенту) — из-за этого
       предпросмотр не совпадал по размеру ни с сайтом, ни с "Мои боты",
       и выглядел то обрезанным, то слишком узким. */
    width: 323px;
    height: 467px;
    margin: 0 auto;
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* ===== ШАПКА ЧАТА — ИКОНКИ СПРАВА, ИМЯ ПЕРЕНОСИТСЯ ===== */
.onboarding-preview-col .chat-header {
    background: #3b82f6;
    color: white;
    padding: 12px 14px;
    font-weight: 600;
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 8px;
    font-size: 15px;
    min-height: 60px;
    width: 100%;
    flex-shrink: 0;
}

.onboarding-preview-col .chat-header img {
    /* Синхронно по смыслу с HEADER_AVATAR_SIZE в widget/widget.js (реальный
       виджет на сайте, там 44px) — пропорционально чуть меньше, чтобы не
       выходить за пределы уменьшенной шапки предпросмотра в кабинете. По
       просьбе пользователя аватар в шапке сделан чуть меньше, чем в
       предыдущей версии (было 44px здесь при 54px на сайте). */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.25);
    grid-row: 1 / 3;
    grid-column: 1;
    align-self: center;
}

/* ИМЯ БОТА — МОЖЕТ ПЕРЕНОСИТЬСЯ НА ВТОРУЮ СТРОКУ */
.onboarding-preview-col .chat-header .chat-bot-name {
    font-weight: 600;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
    min-width: 0;
    max-width: 100%;
}

/* СТАТУС "ОНЛАЙН" — ВСЕГДА СПРАВА, НЕ СДВИГАЕТСЯ */
.onboarding-preview-col .chat-header .online-badge {
    display: inline-block;
    padding: 2px 12px;
    background: #059669;
    border-radius: 20px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    white-space: nowrap;
    grid-row: 1 / 3;
    grid-column: 3;
    align-self: center;
}

/* КОНТЕЙНЕР С ИКОНКАМИ — ВСЕГДА СПРАВА */
.onboarding-preview-col .chat-header .chat-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    grid-row: 1 / 3;
    grid-column: 4;
    align-self: center;
}

/* ИКОНКИ В ШАПКЕ */
.onboarding-preview-col .chat-header .chat-actions button {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.onboarding-preview-col .chat-header .chat-actions button:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}

.onboarding-preview-col .chat-header .chat-actions button:active {
    transform: scale(0.9);
}

/* СТАТУС "ОНЛАЙН" - ТЁМНО-ЗЕЛЁНЫЙ */
.onboarding-preview-col .chat-header .online-badge {
    display: inline-block;
    padding: 2px 12px;
    background: #059669;
    border-radius: 20px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* ===== СООБЩЕНИЯ В ЧАТЕ ===== */
.onboarding-preview-col .chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Сообщение бота — слева */
.onboarding-preview-col .message-bot {
    background: white;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    align-self: flex-start;
    color: #1e293b;
}

/* Сообщение пользователя — справа с "пузырьком" как в Telegram */
.onboarding-preview-col .message-user {
    align-self: flex-end;
    max-width: 85%;
    margin: 4px 0;
}

.onboarding-preview-col .message-user .bubble {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 18px 18px 4px 18px;
    font-size: 13px;
    word-wrap: break-word;
    text-align: left;
}

.onboarding-preview-col .chat-input {
    display: flex;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 12px;
    align-items: center;
    flex-shrink: 0;
}

.onboarding-preview-col .chat-input-inner {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.onboarding-preview-col .chat-input input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 40px;
    padding: 10px 48px 10px 16px;
    outline: none;
    font-size: 13px;
    background: #ffffff;
    color: #1e293b;
}

/* КНОПКА ОТПРАВКИ СО СТРЕЛКОЙ ➤ — встроена внутрь поля ввода, как в реальном виджете */
.onboarding-preview-col .chat-input .send-btn {
    position: absolute;
    right: 4px;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.2s;
    font-size: 16px;
    font-weight: bold;
}

.onboarding-preview-col .chat-input .send-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* ===== ИКОНКИ В ЧАТЕ (общие) ===== */
.chat-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.chat-actions button {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

.chat-actions button:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}

.chat-actions button:active {
    transform: scale(0.9);
}

/* ===== КНОПКА ВЫЗОВА ВИДЖЕТА (общие стили) ===== */
.btn-preview {
    border: none;
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    /* Раньше здесь были min-height/min-width: 48px — их нет в реальном виджете
       (widget/widget.js), из-за чего кнопка "Компактная" в предпросмотре не
       могла стать меньше 48px и выглядела заметно крупнее, чем на реальном
       сайте клиента (жалоба пользователя со скриншотами одного и того же
       бота). Итоговый размер полностью задаётся padding/иконкой из JS
       (updateWidgetPreview/updateWidgetPosition), как и в widget.js. */
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    z-index: 1000;
}

.btn-preview.round { 
    border-radius: 50%; 
    width: 56px; 
    height: 56px; 
    padding: 0; 
}

.btn-preview.round .btn-text { display: none; }

.btn-preview img { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    object-fit: cover; 
    flex-shrink: 0; 
}

.btn-preview .btn-text { 
    display: inline-flex; 
    align-items: center; 
    white-space: nowrap; 
}

/* ===== ПОЗИЦИИ КНОПКИ (ДЕСКТОП) ===== */
.btn-preview.position-bottom-right { position: fixed; bottom: 24px; right: 24px; }
.btn-preview.position-bottom-left { position: fixed; bottom: 24px; left: 24px; }
.btn-preview.position-top-right { position: fixed; top: 24px; right: 24px; }
.btn-preview.position-top-left { position: fixed; top: 24px; left: 24px; }

/* ПОСЕРЕДИНЕ — ВЕРТИКАЛЬНАЯ КНОПКА, ПРИЛИПАЕТ К КРАЮ (десктоп).
   Это осознанный дизайн, а не баг: на десктопе кнопка в положении
   "посередине" разворачивается вертикально и прилипает к краю экрана.
   Раньше на реальном сайте (widget/widget.js) эта позиция ошибочно
   рисовалась обычной горизонтальной кнопкой — сейчас widget.js исправлен,
   чтобы совпадать с этим предпросмотром (см. getPositionStyles/кнопка
   в createWidget, ветка isMobile === false). */
.btn-preview.position-middle-right {
    position: fixed; top: 50%; right: 0; transform: translateY(-50%);
    border-radius: 30px 0 0 30px !important;
    padding: 16px 12px; flex-direction: column; min-height: 80px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.btn-preview.position-middle-right .btn-text { writing-mode: vertical-lr; letter-spacing: 2px; }
.btn-preview.position-middle-right img { width: 28px; height: 28px; margin-bottom: 4px; }
.btn-preview.position-middle-left { position: fixed; top: 50%; left: 0; transform: translateY(-50%);
    border-radius: 0 30px 30px 0 !important; padding: 16px 12px; flex-direction: column; min-height: 80px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
.btn-preview.position-middle-left .btn-text { writing-mode: vertical-lr; letter-spacing: 2px; }
.btn-preview.position-middle-left img { width: 28px; height: 28px; margin-bottom: 4px; }

/* ===== ВИДЖЕТ ПРЕДПРОСМОТРА — скрываем кнопку внутри ===== */
.onboarding-preview-col .widget-button-preview {
    display: none !important;
}

/* ===== ОТДЕЛЬНАЯ КНОПКА ВЫЗОВА ===== */
.widget-button-preview {
    display: block;
}

/* Выбор цвета */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-container .slider-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.color-picker-container .slider-group {
    flex: 1;
    min-width: 120px;
}

.color-picker-container .slider-group label {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.color-picker-container input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 3px;
    outline: none;
}

.color-picker-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #3b82f6;
    cursor: pointer;
}

.color-picker-container .color-preview-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
}

.color-picker-container .color-preview-row .color-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    flex-shrink: 0;
}

.color-picker-container .color-preview-row input {
    width: 100px;
    font-family: monospace;
}

/* Кнопки навигации */
.form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 20px;
}

.form-buttons .btn {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 40px;
}

/* ========================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ======================================== */
@media (max-width: 768px) {
    .onboarding-row {
        flex-direction: column;
        align-items: center;
    }

    .onboarding-form-col {
        max-width: 100%;
        min-width: auto;
    }

    /* ВИДЖЕТ НА МОБИЛЬНЫХ — ОТКРЫВАЕТСЯ СВЕРХУ */
    .onboarding-preview-col {
        position: fixed;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 420px;
        z-index: 9999;
        padding: 0;
        display: none;
        bottom: auto !important;
        right: auto !important;
        flex: none;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .onboarding-preview-col.open {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(-30px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0) scale(1);
        }
    }

    .onboarding-preview-col .preview-box {
        position: static;
        border-radius: 16px;
        overflow: hidden;
    }

    .onboarding-preview-col .chat-preview {
        max-width: 100%;
        border-radius: 16px;
    }

    /* КНОПКА ЗАКРЫТИЯ В ШАПКЕ ВИДЖЕТА */
    .onboarding-preview-col .chat-header .chat-actions #previewCloseBtnMobile {
        display: inline-flex !important;
    }

    /* КНОПКА ВЫЗОВА НА МОБИЛЬНЫХ — ВСЕГДА ВИДНА И ФИКСИРОВАНА */
    .widget-button-preview {
        display: flex !important;
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 9998;
        width: auto;
        background: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* ПЕРЕОПРЕДЕЛЯЕМ ВСЕ СТИЛИ КНОПКИ НА МОБИЛЬНЫХ */
    .widget-button-preview .btn-preview {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        padding: 12px 24px;
        border-radius: 30px;
        /* Без min-height/min-width: 48px — см. комментарий у базового
           .btn-preview выше, тот же фикс размера кнопки под реальный
           виджет, распространён и на мобильное переопределение */
        position: static !important;
        transform: none !important;
        writing-mode: horizontal-tb !important;
        flex-direction: row !important;
        letter-spacing: normal !important;
        gap: 8px;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto;
        height: auto;
        border: none !important;
        font-family: inherit !important;
        text-decoration: none !important;
        transition: all 0.2s !important;
        z-index: 1000 !important;
        flex-shrink: 0 !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }

    .widget-button-preview .btn-preview.round {
        /* width/height задаются инлайново из JS по выбранному размеру кнопки
           (sz.round: 44/56/68px, как в widget/widget.js) — здесь только
           значение по умолчанию на случай, если JS ещё не отработал.
           Раньше тут же были min-width/min-height: 60px — они не пускали
           "Компактную" (44px) и "Стандартную" (56px) кнопку стать меньше
           60px на мобильных, из-за чего предпросмотр был крупнее реального
           виджета на сайте. */
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
    }

    .widget-button-preview .btn-preview.round .btn-text {
        display: none !important;
    }

    .widget-button-preview .btn-preview.square {
        border-radius: 6px;
    }

    .widget-button-preview .btn-preview img {
        width: 28px !important;
        height: 28px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        flex-shrink: 0 !important;
    }

    .widget-button-preview .btn-preview .btn-text {
        font-size: 14px !important;
        white-space: nowrap !important;
        writing-mode: horizontal-tb !important;
        letter-spacing: normal !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    .goals-grid {
        grid-template-columns: 1fr;
    }

    .industry-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .forbidden-topics-grid {
        grid-template-columns: 1fr;
    }

    .row-split {
        flex-direction: column;
    }

    .color-picker-container .slider-row {
        flex-direction: column;
        gap: 8px;
    }
}
/* === Новые элементы редактирования виджета === */
.bubble-sample {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: inline-block;
    max-width: 100%;
}
/* Сброс стандартной рамки браузера у fieldset — используется для блокировки
   формы при истёкшем триале, без сброса даёт системную рамку, которая менялась
   местами то чёрной, то белой в зависимости от темы браузера/ОС */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.gradient-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.gradient-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.15s, border-color 0.15s;
}
.gradient-swatch:hover { transform: scale(1.08); }
.gradient-swatch.selected { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.3); }

.user-avatars-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.user-avatar-item {
    position: relative;
    width: 56px;
    height: 56px;
}
.user-avatar-thumb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: border-color 0.15s;
}
.user-avatar-thumb:hover { border-color: #3b82f6; }
.user-avatar-delete {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* "Плюсик" для добавления своей аватарки — статичный элемент, поставленный
   САМЫМ ПЕРВЫМ перед всеми аватарками (готовыми и своими загруженными), внутри
   сетки #avatarGallery (см. onboarding.php/edit-bot.php), а не отдельной
   кнопкой под блоком, которую было легко не заметить. Оформлен заметно ярче
   тонкой пунктирной обводки — сплошная толстая рамка + залитый фон, чтобы сразу
   считывался как кнопка действия, а не как декоративная плашка-заглушка.
   justify-self/margin — чтобы он центрировался и как ячейка CSS grid
   (#avatarGallery), и как элемент flex-сетки (#myAvatarsList). */
.user-avatar-add {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    margin: 0 auto;
    cursor: pointer;
    color: #3b82f6;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    background: rgba(59,130,246,0.08);
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.user-avatar-add:hover { background: rgba(59,130,246,0.18); transform: scale(1.05); }
.user-avatar-add.disabled { cursor: not-allowed; opacity: 0.4; border-color: #cbd5e1; color: #94a3b8; background: transparent; }
.user-avatar-add.disabled:hover { transform: none; background: transparent; }
[data-theme="dark"] .user-avatar-add { border-color: #60a5fa; color: #60a5fa; background: rgba(96,165,250,0.12); }
[data-theme="dark"] .user-avatar-add:hover { background: rgba(96,165,250,0.22); }
[data-theme="dark"] .user-avatar-add.disabled { border-color: #334155; color: #64748b; background: transparent; }

.window-size-buttons {
    display: flex;
    gap: 8px;
}
.window-size-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.window-size-btn:hover { border-color: #3b82f6; }
.window-size-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* === Тёмная тема админ-панели === */
[data-theme="dark"] body { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .card { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .card-header { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .form-control { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .form-control::placeholder { color: #64748b; }
[data-theme="dark"] .navbar, [data-theme="dark"] header { background: #1e293b !important; border-color: #334155; }
[data-theme="dark"] .text-muted { color: #94a3b8 !important; }
[data-theme="dark"] .footer { border-top-color: #334155; color: #94a3b8; }
[data-theme="dark"] .checkout-status-info { color: #93c5fd; }
[data-theme="dark"] .onboarding-form-col, [data-theme="dark"] .onboarding-preview-col { color: #e2e8f0; }
[data-theme="dark"] .industry-option, [data-theme="dark"] .hobby-option, [data-theme="dark"] .forbidden-topic-item {
    background: #0f172a; border-color: #334155; color: #e2e8f0;
}
[data-theme="dark"] .industry-option:hover, [data-theme="dark"] .hobby-option:hover {
    background: #1e3a5f; border-color: #3b82f6;
}
[data-theme="dark"] .industry-option.selected, [data-theme="dark"] .hobby-option.selected {
    background: #1e3a5f !important; border-color: #3b82f6 !important; color: #ffffff !important;
}
[data-theme="dark"] .goal-option { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .goal-option:hover { background: #1e3a5f; border-color: #3b82f6; }
[data-theme="dark"] .goal-option.selected { background: #1e3a5f !important; border-color: #3b82f6 !important; color: #ffffff !important; }
[data-theme="dark"] select.form-control {
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
}
[data-theme="dark"] .form-control option { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .btn-outline-primary, [data-theme="dark"] .btn-outline-secondary { color: #93c5fd; border-color: #334155; background: transparent; }
[data-theme="dark"] .btn-outline-primary:hover, [data-theme="dark"] .btn-outline-secondary:hover { background: #1e293b; }
[data-theme="dark"] .avatar-tab-btn.active { background: #3b82f6 !important; color: #fff !important; }
[data-theme="dark"] .page-item, [data-theme="dark"] .product-item { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .bot-card, [data-theme="dark"] .dialog-list-item { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .dialog-thread { background: #0f172a; }
/* .list-group-item задаёт background: white инлайн в базовом правиле (см. выше по
   файлу) и никогда не переопределялся для тёмной темы — на странице "Документы"
   (documents.php) это давало почти нечитаемую карточку: белый фон + светлый текст/
   ссылки из общих тёмных переопределений body/a. */
[data-theme="dark"] .list-group-item { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .list-group-item:hover { border-color: #3b82f6; }

/* Всплывающие окна (модалки) — единый стиль подложки под тему сайта.
   Без этих правил подложка модалки оставалась белой в тёмной теме, а текст
   внутри (через .text-muted, .form-label и т.д.) уже перекрашивался в
   светло-серый общими тёмными стилями — получалась светлая надпись на
   белом фоне. */
[data-theme="dark"] .modal-content { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .modal-header { background: #1e293b; border-bottom-color: #334155; }
[data-theme="dark"] .modal-title { color: #e2e8f0; }
[data-theme="dark"] .modal-body { color: #cbd5e1; }
[data-theme="dark"] .modal-footer { background: #1e293b; border-top-color: #334155; }
[data-theme="dark"] .modal-close { color: #94a3b8; }
[data-theme="dark"] .modal-close:hover { color: #e2e8f0; }

/* === CRM-статус клиента (customers.php / customer-detail.php) ===
   Лёгкая заливка строки в списке клиентов по статусу — чтобы владелец сразу
   видел стадию работы с клиентом, не открывая каждую карточку. Цвета берутся
   из customerStatusOptions() (includes/functions.php) — здесь только классы
   для заливки строки таблицы; сам бейдж статуса красится инлайново прямо
   в PHP-шаблоне (цвет всё равно динамический, общий с этим списком). */
.customer-status-row-new { background: rgba(59,130,246,0.06); }
.customer-status-row-not_reached { background: rgba(239,68,68,0.08); }
.customer-status-row-in_progress { background: rgba(245,158,11,0.09); }
.customer-status-row-contacted { background: rgba(6,182,212,0.08); }
.customer-status-row-meeting { background: rgba(139,92,246,0.08); }
.customer-status-row-client { background: rgba(34,197,94,0.09); }
.customer-status-row-declined { background: rgba(219,39,119,0.07); }
.customer-status-row-irrelevant { background: rgba(120,113,108,0.08); }

[data-theme="dark"] .customer-status-row-new { background: rgba(59,130,246,0.14); }
[data-theme="dark"] .customer-status-row-not_reached { background: rgba(239,68,68,0.16); }
[data-theme="dark"] .customer-status-row-in_progress { background: rgba(245,158,11,0.16); }
[data-theme="dark"] .customer-status-row-contacted { background: rgba(6,182,212,0.16); }
[data-theme="dark"] .customer-status-row-meeting { background: rgba(139,92,246,0.18); }
[data-theme="dark"] .customer-status-row-client { background: rgba(34,197,94,0.16); }
[data-theme="dark"] .customer-status-row-declined { background: rgba(219,39,119,0.16); }
[data-theme="dark"] .customer-status-row-irrelevant { background: rgba(120,113,108,0.18); }

.customer-status-select {
    border: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 1em;
    padding-right: 22px;
}
.customer-status-changed-at { display: block; margin-top: 2px; }

/* Ячейка "Комментарии" в списке клиентов и история в модалке/карточке —
   см. customer_comments (includes/functions.php, api/*-customer-comment*.php) */
.customer-comment-cell {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}
.customer-comment-cell:hover { background: rgba(59,130,246,0.08); }
.customer-comment-snippet { flex: 1; font-size: 13px; }
.customer-comment-history-item { border-bottom: 1px solid #e2e8f0; }
.customer-comment-history-item:last-child { border-bottom: none; }
[data-theme="dark"] .customer-comment-cell:hover { background: rgba(59,130,246,0.16); }
[data-theme="dark"] .customer-comment-history-item { border-bottom-color: #334155; }

/* Планировщик задач по клиенту — customer_tasks (customers.php модалка,
   customer-detail.php карточка, tasks.php общий список) */
.customer-task-cell {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}
.customer-task-cell:hover { background: rgba(59,130,246,0.08); }
.customer-task-cell-overdue:hover { background: rgba(239,68,68,0.1); }
.customer-task-snippet { font-size: 13px; }
.customer-task-history-item { border-bottom: 1px solid #e2e8f0; }
.customer-task-history-item:last-child { border-bottom: none; }
[data-theme="dark"] .customer-task-cell:hover { background: rgba(59,130,246,0.16); }
[data-theme="dark"] .customer-task-cell-overdue:hover { background: rgba(239,68,68,0.18); }
[data-theme="dark"] .customer-task-history-item { border-bottom-color: #334155; }

/* Строки планировщика задач на tasks.php — по срочности */
.task-row-overdue { background: rgba(239,68,68,0.08); }
.task-row-today { background: rgba(245,158,11,0.08); }
.task-row-upcoming { background: transparent; }
.task-row-done { background: rgba(34,197,94,0.05); opacity: 0.75; }
.task-row-cancelled { background: rgba(100,116,139,0.05); opacity: 0.6; }
[data-theme="dark"] .task-row-overdue { background: rgba(239,68,68,0.16); }
[data-theme="dark"] .task-row-today { background: rgba(245,158,11,0.16); }
[data-theme="dark"] .task-row-done { background: rgba(34,197,94,0.1); }
[data-theme="dark"] .task-row-cancelled { background: rgba(100,116,139,0.12); }

/* Карточки клиентов в списке (customers.php) — замена горизонтально
   скроллящейся таблицы. Поля клиента раскладываются в CSS Grid
   (auto-fit/minmax), поэтому на узких экранах сами переносятся на новую
   строку вместо горизонтального скролла. Заливка статуса
   (.customer-status-row-*, см. выше) применяется к самой карточке — так как
   у .card уже есть свой белый/тёмный фон, оверрайдим его через
   background важностью правил ниже (порядок в файле: статус после .card). */
.customer-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.customer-card {
    padding: 14px 16px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
}
.customer-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.customer-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.customer-card-name {
    flex: 1;
    min-width: 120px;
    font-size: 15px;
}
.customer-card-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.customer-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px 16px;
    padding: 8px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
}
.customer-card-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
    margin-bottom: 2px;
}
.customer-card-value {
    display: block;
    font-size: 13px;
    word-break: break-word;
}
.customer-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.customer-card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(59,130,246,0.06);
    font-size: 13px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.customer-card-action-btn:hover {
    background: rgba(59,130,246,0.14);
    color: inherit;
    text-decoration: none;
}
.customer-card-action-btn.customer-task-cell-overdue {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
}
.customer-card-action-btn.customer-task-cell-overdue:hover { background: rgba(239,68,68,0.18); }

[data-theme="dark"] .customer-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
[data-theme="dark"] .customer-card-grid { border-color: #334155; }
[data-theme="dark"] .customer-card-label { color: #64748b; }
[data-theme="dark"] .customer-card-action-btn { background: rgba(59,130,246,0.14); }
[data-theme="dark"] .customer-card-action-btn:hover { background: rgba(59,130,246,0.22); }
[data-theme="dark"] .customer-card-action-btn.customer-task-cell-overdue { background: rgba(239,68,68,0.18); color: #f87171; }
[data-theme="dark"] .customer-card-action-btn.customer-task-cell-overdue:hover { background: rgba(239,68,68,0.26); }

.theme-toggle-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: inherit;
}
[data-theme="dark"] .theme-toggle-btn { border-color: #334155; }
[data-theme="dark"] .table th { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .table th, [data-theme="dark"] .table td { border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .prompt-textarea { background: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5 { color: #e2e8f0; }
[data-theme="dark"] .form-label { color: #e2e8f0; }
[data-theme="dark"] .form-check-label { color: #cbd5e1; }
[data-theme="dark"] .form-text { color: #94a3b8; }
[data-theme="dark"] .card-body { color: #cbd5e1; }
[data-theme="dark"] .card-body h1, [data-theme="dark"] .card-body h2, [data-theme="dark"] .card-body h3,
[data-theme="dark"] .card-body h4, [data-theme="dark"] .card-body h5, [data-theme="dark"] .card-body h6 { color: #e2e8f0; }
[data-theme="dark"] .card-body p, [data-theme="dark"] .card-body label, [data-theme="dark"] .card-body span { color: inherit; }
[data-theme="dark"] .small { color: #94a3b8; }
[data-theme="dark"] .avatar-tab-btn.btn-outline-primary { background: transparent; color: #93c5fd; border-color: #334155; }
[data-theme="dark"] .window-size-btn { background: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .window-size-btn.active { background: #3b82f6; color: #fff; }
[data-theme="dark"] .avatar-gallery-item .avatar-name { color: #94a3b8; }
[data-theme="dark"] .alert-info { background: #0c2d48; color: #bae6fd; border-color: #075985; }
[data-theme="dark"] .alert-warning { background: #451a03; color: #fde68a; border-color: #92400e; }
[data-theme="dark"] .alert-danger { background: #450a0a; color: #fecaca; border-color: #991b1b; }
[data-theme="dark"] .alert-success { background: #052e16; color: #bbf7d0; border-color: #166534; }

/* === Конструктор своего градиента === */
.color-swatch-input {
    width: 100%;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    padding: 3px;
    display: block;
}
[data-theme="dark"] .color-swatch-input { border-color: #334155; background: #0f172a; }

.custom-gradient-row {
    display: flex;
    gap: 12px;
}
.custom-gradient-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.custom-gradient-color label {
    font-size: 11px;
    color: #64748b;
}
.custom-gradient-color input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}
.custom-gradient-preview {
    height: 40px;
    border-radius: 10px;
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ==================== КАРКАС ЛИЧНОГО КАБИНЕТА (боковое меню) ==================== */
body.has-cabinet-sidebar {
    margin: 0;
}

.cabinet-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #ffffff;
    color: #334155;
    display: flex;
    flex-direction: column;
    z-index: 900;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
}

.cabinet-sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.cabinet-sidebar-brand a {
    color: #1e293b;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cabinet-sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cabinet-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.cabinet-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* Иконка-картинка в пункте меню (волк-логотип и т.п.) — занимает то же
   место, что и шрифтовая иконка fa-*, чтобы пункты меню не "прыгали" */
.cabinet-nav-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.cabinet-nav-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.cabinet-nav-item.active {
    background: #3b82f6;
    color: #ffffff;
}

.cabinet-nav-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* Индикатор "есть новое" в пункте меню сайдбара (templates/sidebar.php) —
   просто кружок без числа (раньше был такой же пилюлеобразный бейдж с
   цифрой, как .cabinet-nav-badge выше, но пользователь описал его как
   "красную полосу" и попросил заменить на кружок; сам счётчик в пункте
   меню не нужен, важен только факт "есть новое"). Отдельный класс от
   .cabinet-nav-badge, т.к. тот же .cabinet-nav-badge с числом всё ещё
   используется в других местах (например dialogs.php — количество
   непрочитанных диалогов у конкретного бота), где число полезно. */
/* Селектор специально ПРИВЯЗАН к .cabinet-nav-item (а не просто .cabinet-nav-dot
   сам по себе) — это повышает специфичность выше, чем у общего правила
   ".cabinet-nav-item span" (flex: 1; ...) чуть ниже в файле. Без этого
   привязывания общее правило для ЛЮБОГО <span> внутри пункта меню (оно нужно
   для текста-подписи) выигрывало по специфичности и растягивало пустой
   span-кружок через flex:1 на всю оставшуюся ширину — кружок оставался
   красной полосой шириной с половину пункта меню (проверено в headless-браузере:
   94.5×8px вместо 8×8px), хотя визуально выглядело как "ничего не изменилось". */
.cabinet-nav-item .cabinet-nav-dot {
    /* display: inline-block ОБЯЗАТЕЛЕН — это <span>, он строчный (inline) по
       умолчанию, а на строчных элементах браузер полностью игнорирует
       width/height. Без этой строки пустой <span> (без текста внутри)
       схлопывался в невидимую точку 0×0 — кружок физически не отображался
       (жалоба пользователя "нет кружочка"). */
    display: inline-block;
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.cabinet-sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cabinet-sidebar-footer .theme-toggle-btn {
    color: #334155;
    border-color: #e2e8f0;
    width: 100%;
}

.cabinet-sidebar-theme-btn {
    color: #334155;
    border-color: #e2e8f0;
    margin: 14px 16px 0;
    width: calc(100% - 32px);
    flex-shrink: 0;
}

.cabinet-sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
}

.cabinet-sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-sidebar-logout {
    color: #dc2626;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cabinet-sidebar-logout:hover {
    text-decoration: underline;
}

/* ==== Тёмная тема сайдбара — отдельный, полноценный набор цветов ==== */
[data-theme="dark"] .cabinet-sidebar {
    background: #0f172a;
    color: #cbd5e1;
    border-right-color: #1e293b;
}
[data-theme="dark"] .cabinet-sidebar-brand {
    border-bottom-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .cabinet-sidebar-brand a {
    color: #ffffff;
}
[data-theme="dark"] .cabinet-nav-item {
    color: #94a3b8;
}
[data-theme="dark"] .cabinet-nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}
[data-theme="dark"] .cabinet-nav-item.active {
    background: #3b82f6;
    color: #ffffff;
}
[data-theme="dark"] .cabinet-sidebar-footer {
    border-top-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .cabinet-sidebar-footer .theme-toggle-btn {
    color: #cbd5e1;
    border-color: rgba(255,255,255,0.15);
}
[data-theme="dark"] .cabinet-sidebar-theme-btn {
    color: #cbd5e1;
    border-color: rgba(255,255,255,0.15);
}
[data-theme="dark"] .cabinet-sidebar-user {
    color: #94a3b8;
}
[data-theme="dark"] .cabinet-sidebar-logout {
    color: #f87171;
}
[data-theme="dark"] .cabinet-mobile-topbar {
    background: #0f172a;
    border-bottom-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .cabinet-mobile-brand {
    color: #ffffff;
}
[data-theme="dark"] .cabinet-mobile-toggle {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}
[data-theme="dark"] .cabinet-mobile-theme-btn {
    border-color: #334155;
    color: #e2e8f0;
}

/* display:flex + flex-direction:column растягивают .cabinet-content на всю
   высоту вьюпорта колонкой; .container (основной контент страницы) — единственный
   гибкий элемент (flex: 1 0 auto), который забирает всё свободное место, а подвал
   (.footer, второй/следующий элемент колонки, см. templates/footer.php) в итоге
   всегда прижат к низу страницы, даже если содержимого мало (короткие страницы
   вроде payment-success.php/payment-failed.php раньше оставляли подвал сразу под
   карточкой с большим пустым куском экрана снизу) */
.cabinet-content {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cabinet-content > .container {
    flex: 1 0 auto;
    /* У .container есть свой "margin: 0 auto" для центрирования на обычных
       страницах (там он ни на что не влиял, т.к. блок и так занимал 100%
       ширины). Внутри flex-колонки авто-отступы по горизонтали трактуются
       иначе: элемент перестаёт растягиваться на всю ширину и вместо этого
       сжимается до своего max-width, центрируясь этими же отступами — именно
       так и "сузилась" вёрстка личного кабинета.
       Обнулять сами margin нельзя: на узких страницах (чекаут/оплата), где
       инлайн-стилем задан свой max-width (напр. 560px/640px), margin:0 auto
       как раз и должен центрировать карточку — обнуление margin прижимало бы
       её к левому краю вместо центра. Вместо этого явно задаём width: 100% —
       тогда flex-элемент сразу растягивается на всю доступную ширину (как раньше
       в блочной вёрстке), а там, где инлайн max-width сужает его дальше,
       оставшееся место снова честно делится марджинами пополам. */
    width: 100%;
}

/* Мобильные — сайдбар прячется полностью, вместо него липкая шапка с гамбургер-кнопкой,
   по нажатию на которую выезжает полноценная панель меню поверх контента */
.cabinet-mobile-topbar { display: none; }
.cabinet-sidebar-backdrop { display: none; }
.cabinet-sidebar-close { display: none; }

@media (max-width: 900px) {
    .cabinet-mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 950;
        background: #ffffff;
        padding: 12px 16px;
        border-bottom: 1px solid #e2e8f0;
    }

    .cabinet-mobile-brand {
        color: #1e293b;
        text-decoration: none;
        font-size: 17px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .cabinet-mobile-topbar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .cabinet-mobile-theme-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 18px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-color: #e2e8f0;
    }

    .cabinet-mobile-toggle {
        background: #f1f5f9;
        border: none;
        color: #1e293b;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 18px;
        cursor: pointer;
    }

    .cabinet-sidebar {
        width: 280px;
        max-width: 82vw;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1000;
        box-shadow: 0 0 40px rgba(0,0,0,0.4);
    }

    .cabinet-sidebar.open {
        transform: translateX(0);
    }

    .cabinet-sidebar-close {
        display: block;
        background: none;
        border: none;
        color: #94a3b8;
        font-size: 18px;
        cursor: pointer;
        padding: 4px 8px;
    }

    .cabinet-sidebar-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .cabinet-sidebar-brand a span,
    .cabinet-nav-item span,
    .cabinet-sidebar-user span,
    .cabinet-sidebar-logout span,
    .cabinet-sidebar-footer .theme-toggle-btn span,
    .cabinet-sidebar-theme-btn span {
        display: inline;
    }

    .cabinet-nav-item {
        justify-content: flex-start;
        padding: 12px 14px;
    }

    .cabinet-nav-badge,
    .cabinet-nav-dot {
        position: static;
    }

    .cabinet-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .cabinet-sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .cabinet-content {
        margin-left: 0;
    }
}

[data-theme="dark"] .cabinet-content { background: transparent; }

/* ==================== FLEX-УТИЛИТЫ (были в разметке, но не были определены) ==================== */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-start { justify-content: flex-start; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ==================== КАРТОЧКА БОТА НА "МОИ БОТЫ" — по ширине виджета ==================== */
.bot-card-wrap {
    flex-shrink: 0;
}

.bot-card {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bot-card:hover {
    transform: translateY(-6px);
}

.bot-card iframe {
    flex-shrink: 0;
}

.bot-card-info {
    padding: 14px 16px 10px;
}

.bot-card-actions {
    padding: 10px 16px 16px;
    border-top: 1px solid #eef2f7;
    margin-top: auto;
}

[data-theme="dark"] .bot-card {
    background: #1e293b;
}

[data-theme="dark"] .bot-card-actions {
    border-top-color: #334155;
}
.border-danger { border: 2px solid #ef4444 !important; }
.text-dark { color: #1e293b !important; }

/* ==================== ЕЩЁ НЕДОСТАЮЩИЕ УТИЛИТЫ (использовались в разметке повсеместно, но не были определены) ==================== */
.p-5 { padding: 3rem; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.small { font-size: 0.85em; }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }

.col-3 { width: 25%; padding: 0 10px; }
.col-4 { width: 33.333%; padding: 0 10px; }
.col-6 { width: 50%; padding: 0 10px; }
.col-8 { width: 66.666%; padding: 0 10px; }
.col-9 { width: 75%; padding: 0 10px; }
.col-12 { width: 100%; padding: 0 10px; }

@media (max-width: 640px) {
    .col-3, .col-4, .col-6, .col-8, .col-9,
    .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8 {
        width: 100%;
    }
}

/* ==================== ТЁМНАЯ ТЕМА: точечные исправления ==================== */

/* Логотип в шапке — градиентный текст, в тёмной теме тёмный на тёмном был не виден */
[data-theme="dark"] .navbar-brand {
    background: linear-gradient(135deg, #93c5fd, #60a5fa);
    background-clip: text;
    -webkit-background-clip: text;
}

/* Мягкая панель-подложка (например, блок "Обновить промт через ИИ") */
.soft-panel {
    background: #f8fafc;
    border-radius: 14px;
}
[data-theme="dark"] .soft-panel {
    background: #0f172a;
    border: 1px solid #334155;
}

/* Сообщение посетителя в диалогах — белый пузырёк должен всегда иметь тёмный текст,
   независимо от темы админки, иначе текст сливается со светлым фоном пузырька */
.dmsg.visitor {
    color: #1e293b !important;
}

/* Выбранный диалог в списке — эта строка сидит в инлайн-стилях страницы диалогов,
   поэтому здесь принудительно перебиваем через !important, чтобы не зависеть
   от порядка подключения стилей на странице */
[data-theme="dark"] .dialog-list-item.active {
    background: #1e3a5f !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}
[data-theme="dark"] .dialog-list-item .ddate {
    color: #94a3b8 !important;
}

/* ==================== МОБИЛЬНАЯ ВЁРСТКА — точечные исправления по разделам ==================== */

/* "Мои боты" — карточки центрируются, а не прижимаются к левому краю */
.bots-grid {
    justify-content: flex-start;
}
@media (max-width: 700px) {
    .bots-grid {
        justify-content: center;
    }
    .bot-card-wrap {
        max-width: 100%;
    }
}

/* "Статистика" — таблица со сводкой по ботам не влезала на мобильных, дата обрезалась.
   На узких экранах даём таблице скроллиться по горизонтали вместо переполнения макета */
@media (max-width: 700px) {
    .card-body > .table,
    .card-body table.table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .container .row .col-3,
    .container .row .col-md-3 {
        width: 50%;
    }
}

/* "Диалоги" (bot-dialogs.php) — заголовок диалога и кнопка "В личный кабинет"
   вставали в ряд и не помещались на мобильных, теперь друг под другом */
@media (max-width: 700px) {
    .container .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    .container .d-flex.justify-content-between.align-items-center.mb-4 > * {
        width: 100%;
    }
}

/* ==================== ТОВАР/УСЛУГА С ФОТО ==================== */
.product-item-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.product-image-upload {
    flex-shrink: 0;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.product-image-preview {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}
.product-image-btn {
    font-size: 11px;
    text-align: center;
    padding: 6px 4px;
    width: 100%;
    cursor: pointer;
    margin-bottom: 0;
}
.product-item-fields {
    flex: 1;
    min-width: 0;
}
@media (max-width: 480px) {
    .product-item-body { flex-direction: column; align-items: stretch; }
    .product-image-upload { width: 100%; flex-direction: row; }
    .product-image-preview { width: 60px; height: 60px; }
}
[data-theme="dark"] .product-image-preview {
    border-color: #334155;
}

/* ==================== ФАЙЛЫ ДЛЯ СКАЧИВАНИЯ ==================== */
.bot-file-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}
.bot-file-item-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.bot-file-upload {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: left;
    width: 100%;
}
.bot-file-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.bot-file-name-label {
    font-size: 12px;
    color: #64748b;
    word-break: break-word;
    line-height: 1.3;
    flex: 1;
    min-width: 60px;
}
.bot-file-upload .btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.bot-file-fields {
    flex: 1;
    min-width: 0;
}
@media (max-width: 480px) {
    .bot-file-item-body { flex-direction: column; align-items: stretch; }
    .bot-file-upload { flex-wrap: wrap; }
}
[data-theme="dark"] .bot-file-item {
    border-color: #334155;
    background: #0f172a;
}
[data-theme="dark"] .bot-file-icon {
    background: #1e3a5f;
}

/* ==================== ПОДАРКИ ДЛЯ КЛИЕНТОВ ==================== */
.gift-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}
.gift-item > * + * {
    margin-top: 14px;
}
.gift-type-toggle {
    display: flex;
    gap: 16px;
}
.gift-type-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.gift-file-item-body {
    display: flex;
}
.gift-conditions-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.gift-condition-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}
.gift-item .form-group {
    margin-top: 14px;
    margin-bottom: 0;
}
.gift-item .form-label {
    margin-bottom: 6px;
    display: block;
}
[data-theme="dark"] .gift-item {
    border-color: #334155;
    background: #0f172a;
}
.gift-promo-input {
    font-weight: 600;
}

/* Репитеры "Конкурентные преимущества" и "Прямые конкуренты" (onboarding.php,
   edit-bot.php) — оформление один в один с .gift-item, чтобы новые блоки не
   выбивались из общего стиля репитеров на этих формах. */
.advantage-item, .competitor-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}
[data-theme="dark"] .advantage-item, [data-theme="dark"] .competitor-item {
    border-color: #334155;
    background: #0f172a;
}

/* Оверлей "Идёт создание бота" (onboarding.php) — показывается по клику на
   "Создать бота →", пока идёт генерация промта через ИИ, чтобы не было
   ощущения, что страница зависла. */
.bot-creating-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.bot-creating-overlay.active { display: flex; }
.bot-creating-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 36px;
    max-width: 360px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
[data-theme="dark"] .bot-creating-box {
    background: #1e293b;
    color: #e2e8f0;
}
.bot-creating-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: bot-creating-spin 0.8s linear infinite;
}
[data-theme="dark"] .bot-creating-spinner { border-color: #334155; border-top-color: #60a5fa; }
@keyframes bot-creating-spin { to { transform: rotate(360deg); } }
.bot-creating-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.bot-creating-subtitle { font-size: 13px; color: #64748b; line-height: 1.4; margin-bottom: 18px; }
[data-theme="dark"] .bot-creating-subtitle { color: #94a3b8; }
.bot-creating-progress {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
}
[data-theme="dark"] .bot-creating-progress { background: #334155; }
.bot-creating-progress-bar {
    width: 40%;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    animation: bot-creating-progress-slide 1.3s ease-in-out infinite;
}
@keyframes bot-creating-progress-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(130%); }
    100% { transform: translateX(280%); }
}

/* .form-text использовался по всему проекту для мелких подсказок под полями,
   но нигде не был определён — рендерился обычным крупным текстом */
.form-text {
    color: #64748b;
    font-size: 0.85em;
    margin-top: 4px;
}

/* ==================== АССИСТЕНТЫ (ПОСМЕННАЯ РАБОТА) ==================== */
.assistant-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}
.assistant-item-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.assistant-avatar-block {
    flex-shrink: 0;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.assistant-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    background: #e2e8f0;
}
.assistant-fields {
    flex: 1;
    min-width: 0;
}
@media (max-width: 480px) {
    .assistant-item-body { flex-direction: column; align-items: stretch; }
    .assistant-avatar-block { width: 100%; flex-direction: row; }
}
[data-theme="dark"] .assistant-item {
    border-color: #334155;
    background: #0f172a;
}
[data-theme="dark"] .assistant-avatar-preview {
    border-color: #334155;
    background: #334155;
}

/* ==================== ИЗОБРАЖЕНИЕ ПОДАРКА ==================== */
.gift-image-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.gift-image-preview {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}
[data-theme="dark"] .gift-image-preview {
    border-color: #334155;
}

/* ==================== ПРЕДЛОЖЕНИЕ УБРАТЬ ПОДПИСЬ ВИДЖЕТА ==================== */
.branding-addon-block {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fdf4ff 0%, #eef2ff 100%);
    border: 2px solid #c4b5fd;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.15);
}
.branding-addon-block.branding-addon-selected {
    border-color: #8b5cf6;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}
.branding-addon-block.branding-addon-active {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
    border-color: #6ee7b7;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}
.branding-addon-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #8b5cf6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
}
.branding-addon-active .branding-addon-icon {
    background: #10b981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}
.branding-addon-body {
    flex: 1;
    min-width: 0;
}
.branding-addon-title {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
}
.branding-addon-text {
    font-size: 13px;
    color: #64748b;
}
.branding-addon-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #7c3aed;
    cursor: pointer;
}
.branding-addon-price {
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 800;
    color: #7c3aed;
    text-align: right;
    white-space: nowrap;
}
.branding-addon-price span {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}
.branding-addon-active .branding-addon-price {
    color: #10b981;
}
@media (max-width: 560px) {
    .branding-addon-block { flex-wrap: wrap; }
    .branding-addon-price { width: 100%; text-align: left; margin-top: 6px; }
}
[data-theme="dark"] .branding-addon-block {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
    border-color: #7c3aed;
}
[data-theme="dark"] .branding-addon-block.branding-addon-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.12) 100%);
    border-color: #10b981;
}
[data-theme="dark"] .branding-addon-title {
    color: #e2e8f0;
}
[data-theme="dark"] .branding-addon-text {
    color: #94a3b8;
}

/* ==================== ПОДДЕРЖКА: список обращений и переписка ==================== */
.support-ticket-item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #e2e8f0;
}
.support-ticket-item:hover {
    background: #f8fafc;
}
.support-ticket-item.active {
    background: #eff6ff;
}
.support-ticket-item-subject {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
}
[data-theme="dark"] .support-ticket-item {
    border-bottom-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .support-ticket-item:hover {
    background: #1e293b;
}
[data-theme="dark"] .support-ticket-item.active {
    background: #1e3a5f;
}

.support-msg-row {
    margin-bottom: 18px;
}
.support-msg-label {
    margin-bottom: 6px;
}
.support-msg-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
}
.support-msg-user {
    background: #3b82f6;
    color: #fff;
}
.support-msg-admin {
    background: #f1f5f9;
    color: #1e293b;
}
[data-theme="dark"] .support-msg-admin {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}

/* ==================== ТАРИФ "ИНДИВИДУАЛЬНОЕ СОПРОВОЖДЕНИЕ" (billing.php) ====================
   Пожелание пользователя 06.10.2026: выделить карточку заметнее остальных тарифов
   и расположить её в средней колонке сетки на десктопе, а не прижатой к левому
   краю (она идёт последней в списке тарифов и после 9 обычных тарифов — ровно
   3 полных ряда по 3 карточки — остаётся одна в начале нового ряда). */
.plan-card-enterprise {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.14));
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 10px 28px rgba(59, 130, 246, 0.22);
}
[data-theme="dark"] .plan-card-enterprise {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.26), rgba(139, 92, 246, 0.26));
}

/* .row (см. выше) — flex с flex-wrap: эта карточка — единственная на своей
   строке, поэтому margin: 0 auto на самом flex-элементе центрирует её в
   свободном пространстве именно этой строки (стандартное поведение auto-margin
   во flexbox), визуально помещая её в среднюю колонку. На мобильных (.col-4
   и так становится шириной 100% — см. @media (max-width: 640px) выше), поэтому
   центрирование там не нужно и отключается. */
@media (min-width: 641px) {
    .plan-card-enterprise-col {
        margin-left: auto;
        margin-right: auto;
    }
}
