/* ===== Настройка Discord-бота ===== */

/* Контент страницы в колонку */
.main-content {
    flex-direction: column;
    align-items: center;
}

/* Сетка карточек */
.cards-grid {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    position: relative;
    background: linear-gradient(135deg, #2c3139, #22252a);
    border: 1px solid #3a3f48;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #e0f7ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
    border-color: #5865F2;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(88, 101, 242, 0.25);
}

.card-icon {
    font-size: 42px;
    min-height: 50px;
    filter: drop-shadow(0 0 10px rgba(126, 200, 255, 0.3));
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

.card-desc {
    font-size: 12px;
    color: #aabbcc;
    line-height: 1.4;
}

.card-danger:hover {
    border-color: #ef5350;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(239, 83, 80, 0.25);
}

/* Заблокированная карточка */
.card.locked {
    opacity: 0.45;
    filter: grayscale(0.7);
    cursor: not-allowed;
}

.card.locked:hover {
    transform: none;
    border-color: #3a3f48;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.lock-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 16px;
    opacity: 0.9;
}

/* Сообщение об отсутствии доступа */
.access-msg {
    width: 100%;
    max-width: 1100px;
    padding: 14px 20px;
    border: 1px solid rgba(239, 83, 80, 0.4);
    background: rgba(239, 83, 80, 0.08);
    color: #ef9a9a;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ===== ПАНЕЛИ РАЗДЕЛОВ ===== */
.section-panel {
    width: 100%;
    max-width: 1100px;
    margin-top: 10px;
    background: linear-gradient(135deg, #2c3139, #22252a);
    border: 1px solid #3a3f48;
    border-radius: 12px;
    padding: 30px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Заголовок раздела: жирный курсив */
.panel-title {
    font-size: 22px;
    color: #ffffff;
    font-weight: 800;
    font-style: italic;
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Кнопка "Назад" — в стиле кнопки МЕНЮ */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3a3f48, #2c3139);
    border: 1px solid #4a505b;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.back-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #4a505b, #3a3f48);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.5);
}

/* Формы */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Лейблы — белые и жирные */
.form-group label {
    font-size: 13px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* Поля ввода — карточками, в стиле ползунка */
.form-group input,
.settings-form select,
.settings-form textarea {
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 13px 16px;
    color: #e0f7ff;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-form textarea {
    resize: none;
}

.form-group input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
    border-color: #5865F2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cfd8e3;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: #5865F2;
    cursor: pointer;
}

/* ===== Ползунок-переключатель ===== */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 13px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.switch-row:hover {
    border-color: #4a505b;
}

.switch-label {
    color: #cfd8e3;
    font-size: 14px;
    font-weight: 600;
}

.switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Выключено — КРАСНЫЙ */
.slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #e53935, #b71c1c);
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.4);
    transition: 0.25s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    top: 3px;
    left: 3px;
    transition: 0.25s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Включено — синий со свечением */
.switch input:checked + .slider {
    background: #5865F2;
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.5);
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
}

/* ===== Кнопки — в стиле кнопки МЕНЮ ===== */
.save-btn {
    margin-top: 6px;
    background: linear-gradient(135deg, #3a3f48, #2c3139);
    border: 1px solid #4a505b;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.save-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #4a505b, #3a3f48);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.5);
}

.save-btn.small {
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 0;
}

.save-btn.green {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border-color: #43a047;
}

.save-btn.red {
    background: linear-gradient(135deg, #b71c1c, #8e0000);
    border-color: #e53935;
}

.save-result {
    min-height: 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.save-result.ok  { color: #66bb6a; }
.save-result.err { color: #ef5350; }

/* Ссылка на портал разработчика */
.dev-link-row {
    text-align: center;
    margin-bottom: 25px;
}

.dev-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #3a3f48;
    border-radius: 8px;
    background: rgba(88, 101, 242, 0.08);
    color: #7ec8ff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.dev-link:hover {
    background: rgba(88, 101, 242, 0.18);
    border-color: #5865F2;
    transform: translateY(-1px);
}

/* ===== СЕТКА ИЗ ДВУХ КОЛОНОК (каналы + роли) ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 30px;
    align-items: start;
}

.two-col .hscroll {
    margin: 0 0 16px;
}

.col-title {
    margin: 0 0 14px;
}

/* ===== ЛЕНТЫ БЛОКОВ ===== */
.h-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin: 35px 0 14px;
    text-align: center;
}

.hscroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 14px 18px;
    margin: 0 8px 16px;
    scroll-snap-type: x mandatory;
}

.hscroll::-webkit-scrollbar {
    height: 8px;
    border-radius: 4px;
}

.hscroll::-webkit-scrollbar-thumb {
    background: #3a3f48;
    border-radius: 4px;
}

.hscroll::-webkit-scrollbar-thumb:hover {
    background: #4a505b;
}

.hscroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.hblock {
    scroll-snap-align: start;
    flex: 0 0 auto;
    min-width: 170px;
    max-width: 260px;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 14px 18px;
    color: #e0f7ff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hblock small {
    display: block;
    color: #8fa1b3;
    font-weight: 400;
    font-size: 11px;
    margin-top: 6px;
    white-space: normal;
}

.hblock:hover {
    border-color: #ef5350;
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.25);
}

.hblock:hover::after {
    content: '🗑 удалить';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 10px;
    color: #ef9a9a;
}

.hblock.empty {
    cursor: default;
    color: #6a707b;
    font-style: italic;
}

.hblock.empty:hover {
    border-color: #3a3f48;
    box-shadow: none;
}

.hblock.empty:hover::after {
    content: none;
}

/* ===== СПИСКИ (роли) ===== */
.list-col.wide {
    max-width: 700px;
    margin: 30px auto 0;
}

.list-col h4 {
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 14px;
    text-align: center;
}

.item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #cfd8e3;
}

.item-list li.empty {
    justify-content: center;
    color: #6a707b;
    font-style: italic;
}

.del-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.del-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

.inline-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.inline-form input {
    flex: 1;
    min-width: 150px;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 10px 12px;
    color: #e0f7ff;
    font-size: 13px;
    outline: none;
}

.inline-form input:focus {
    border-color: #5865F2;
}

/* Селекты в формах добавления */
.inline-form select {
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 10px 12px;
    color: #e0f7ff;
    font-size: 13px;
    outline: none;
    max-width: 240px;
}

.inline-form select:focus {
    border-color: #5865F2;
}

.hint {
    margin-top: 22px;
    font-size: 12px;
    color: #8fa1b3;
    text-align: center;
    line-height: 1.5;
}

.hint.top {
    margin: 0 0 20px;
}

/* ===== СТАТУС БОТА ===== */
.bot-status {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.bot-status.on {
    color: #66bb6a;
    background: rgba(102, 187, 106, 0.08);
    border: 1px solid rgba(102, 187, 106, 0.35);
}

.bot-status.off {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.08);
    border: 1px solid rgba(239, 83, 80, 0.35);
}

.disable-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== ЧИПЫ (мультивыбор) ===== */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.chip input { display: none; }

.chip span {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 16px;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 12px;
    color: #cfd8e3;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.chip small {
    font-size: 10px;
    color: #8fa1b3;
    font-weight: 400;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip input:checked + span {
    background: rgba(88, 101, 242, 0.15);
    border-color: #5865F2;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

/* Статичный чип @everyone */
.chip-static span {
    display: inline-flex;
    padding: 10px 16px;
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid #5865F2;
    border-radius: 12px;
    color: #ffffff;
    font-size: 13px;
    cursor: default;
}

/* ===== Карточки каналов с ролями ===== */
.chip-card {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 280px;
    transition: border-color 0.2s;
}

.chip-card:hover {
    border-color: #4a505b;
}

.chip-card-title {
    color: #e0f7ff;
    font-size: 13px;
    font-weight: 700;
}

.chip-card-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Тег роли — клик удаляет */
.role-tag {
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.5);
    border-radius: 999px;
    color: #aab6ff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    transition: 0.2s;
}

.role-tag:hover {
    background: rgba(239, 83, 80, 0.15);
    border-color: #ef5350;
    color: #ef9a9a;
}

.no-roles {
    color: #6a707b;
    font-size: 11px;
    font-style: italic;
    align-self: center;
}

/* Красивый лейбл редактора */
.label-fancy {
    font-size: 14px;
    font-weight: 800;
    font-style: italic;
    color: #ffffff;
    letter-spacing: 0.4px;
}

/* ===== ТУЛБАР РЕДАКТОРА ===== */
.md-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    align-items: center;
}

.md-btn {
    min-width: 34px;
    padding: 6px 9px;
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 6px;
    color: #cfd8e3;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.md-btn:hover {
    border-color: #5865F2;
    color: #ffffff;
}

.md-select {
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 6px;
    color: #cfd8e3;
    font-size: 12px;
    padding: 6px 8px;
    outline: none;
    cursor: pointer;
}

.md-select:focus { border-color: #5865F2; }

/* Эмодзи-пикер */
.emoji-picker {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    background: #1e2124;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.emoji-picker button {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    padding: 6px 0;
    transition: background 0.15s, transform 0.15s;
}

.emoji-picker button:hover {
    background: #2c3139;
    transform: scale(1.15);
}

/* Кнопки действий */
.msg-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ===== WYSIWYG-РЕДАКТОР ===== */
.md-editor {
    background: #22252a;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 13px 16px;
    color: #e0f7ff;
    font-size: 14px;
    min-height: 160px;
    outline: none;
    line-height: 1.55;
    word-break: break-word;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.md-editor:focus {
    border-color: #5865F2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.md-editor:empty:before {
    content: attr(data-placeholder);
    color: #6a707b;
}

.md-editor pre,  .preview-body pre,
.md-editor code, .preview-body code {
    background: #14161a;
    border: 1px solid #2f3237;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.md-editor pre, .preview-body pre {
    display: block;
    padding: 8px 10px;
    margin: 6px 0;
    white-space: pre-wrap;
}

.md-editor h1, .preview-body h1 { font-size: 1.4em;  font-weight: 800; color: #ffffff; margin: 4px 0; }
.md-editor h2, .preview-body h2 { font-size: 1.2em;  font-weight: 700; color: #ffffff; margin: 4px 0; }
.md-editor h3, .preview-body h3 { font-size: 1.05em; font-weight: 600; color: #ffffff; margin: 4px 0; }

/* Цитата и список в редакторе и предпросмотре */
.md-editor blockquote, .preview-body blockquote {
    border-left: 3px solid #5865F2;
    padding-left: 10px;
    margin: 6px 0;
    color: #b9bbbe;
}

.md-editor ul, .preview-body ul {
    list-style: disc;
    padding-left: 22px;
    margin: 6px 0;
}

.md-editor li, .preview-body li {
    margin: 2px 0;
}

.md-editor .ed-spoiler, .preview-body .ed-spoiler {
    background: #000;
    color: transparent;
    border-radius: 4px;
    padding: 0 6px;
    cursor: pointer;
}

.md-editor .ed-spoiler.revealed, .preview-body .ed-spoiler.revealed {
    color: #dcddde;
    background: #2f3134;
}

/* ===== ПРЕДПРОСМОТР ===== */
.preview-tags {
    color: #7ec8ff;
    font-size: 14px;
    margin-bottom: 8px;
}

.preview-body {
    font-size: 15px;
    color: #dcddde;
    line-height: 1.55;
    word-break: break-word;
}

.preview-body .empty {
    color: #6a707b;
    font-style: italic;
}

/* ===== ЖИВОЙ ПРЕДПРОСМОТР СООБЩЕНИЯ ===== */
.live-preview {
    background: #1e2124;
    border: 1px solid #3a3f48;
    border-radius: 12px;
    padding: 16px 18px;
    min-height: 160px;
}

.live-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.live-head .bot-avatar {
    width: 40px;
    height: 40px;
}

.live-head .bot-name {
    font-size: 14px;
}

/* Подсветка активного пункта меню */
.menu-item.active {
    border-color: rgba(88, 101, 242, 0.6);
    background: rgba(88, 101, 242, 0.12);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 900px) {
    .form-row,
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cards-grid {
        gap: 15px;
    }
    .card {
        padding: 24px 16px;
    }
    .card-icon {
        font-size: 36px;
    }
    .section-panel {
        padding: 20px;
    }
    .emoji-picker {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Информация по боту ===== */
.bot-info {
    background: #1e2124;
    border: 1px solid #3a3f48;
    border-radius: 12px;
    padding: 20px;
}

.info-h {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.bot-info-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.bot-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #5865F2;
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.4);
}

.bot-name {
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
}

.bot-tag-badge {
    background: #5865F2;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
    vertical-align: middle;
    margin-left: 6px;
}

.bot-sub {
    color: #8fa1b3;
    font-size: 12px;
    margin-top: 2px;
}

.bot-info-row {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: #cfd8e3;
}

.bot-info-row > span {
    color: #8fa1b3;
    min-width: 90px;
    font-weight: 600;
}

.bot-info-row code {
    background: #14161a;
    border: 1px solid #2f3237;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
}

.st-on  { color: #66bb6a; font-weight: 700; }
.st-off { color: #ef5350; font-weight: 700; }

/* Отступ между инфо-блоком и формой интеграции в правой колонке */
.col .bot-info {
    margin-bottom: 20px;
}

/* Колонки одинаковой высоты, контент не растягивается */
.two-col .col {
    display: flex;
    flex-direction: column;
}

/* ===== Два отдельных блока рядом ===== */
.settings-wrap {
    width: 100%;
    max-width: 1100px;
    margin-top: 10px;
}

.panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.panels-row .section-panel.half {
    width: 100%;
    max-width: none;
    margin-top: 0;
}

@media (max-width: 900px) {
    .panels-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Контент не выходит за шапку и копирайт ===== */

/* Шапка: липкая, но контент не проходит под ней */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Копирайт: обычный блок в самом низу страницы */
.footer {
    position: static;
    margin-top: 30px;
}

/* Отступы страницы теперь обычные — компенсация fixed не нужна */
.main-content {
    padding: 30px 20px 40px;
}

/* ============================================================
   ПОЛНОЭКРАННЫЙ РЕЖИМ «НАСТРОЙКА БОТА» / «КАНАЛЫ» / «СООБЩЕНИЯ»
   (класс fs-settings вешает JS на body)
   • блоки растянуты на всю ширину
   • всё, что не влезло, листается ВНУТРИ блоков
   • страница НЕ скроллится
   ============================================================ */

body.fs-settings {
    overflow: hidden;
}

body.fs-settings .main-content {
    align-items: stretch;
    padding: 15px 20px;
}

body.fs-settings .settings-wrap {
    width: 100%;
    max-width: none;
    margin-top: 0;
}

/* Левый блок широкий, правый (информация) — УЖЕ */
body.fs-settings .panels-row {
    width: 100%;
    grid-template-columns: 1fr 400px;
    align-items: start;
    gap: 20px;
}

/* Раздел каналов: два равных блока */
body.fs-settings #channelsPanel .panels-row {
    grid-template-columns: 1fr 1fr;
}

/* Раздел сообщений: два равных блока */
body.fs-settings #messagesPanel .panels-row {
    grid-template-columns: 1fr 1fr;
}

/* Раздел меню: два равных блока */
body.fs-settings #menuPanel .panels-row {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1200px) {
    body.fs-settings .panels-row {
        grid-template-columns: 1fr 340px;
    }
    body.fs-settings #channelsPanel .panels-row,
    body.fs-settings #messagesPanel .panels-row,
    body.fs-settings #menuPanel .panels-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Блоки: высота ограничена экраном, прокрутка ВНУТРИ */
body.fs-settings .panels-row .section-panel.half {
    width: 100%;
    max-width: none;
    margin: 0;
    max-height: calc(100vh - 215px);
    min-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #3a3f48 transparent;
}

/* Скроллбар в общем стиле */
body.fs-settings .section-panel.half::-webkit-scrollbar { width: 8px; }
body.fs-settings .section-panel.half::-webkit-scrollbar-thumb { background: #3a3f48; border-radius: 4px; }
body.fs-settings .section-panel.half::-webkit-scrollbar-thumb:hover { background: #4a505b; }
body.fs-settings .section-panel.half::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }

/* Подвал не добавляет лишний скролл */
body.fs-settings .footer {
    margin-top: 10px;
}

/* Узкие экраны: блоки в столбик, страница листается как обычно */
@media (max-width: 900px) {
    body.fs-settings { overflow: auto; }
    body.fs-settings .panels-row,
    body.fs-settings #channelsPanel .panels-row,
    body.fs-settings #messagesPanel .panels-row,
    body.fs-settings #menuPanel .panels-row {
        grid-template-columns: 1fr;
    }
    body.fs-settings .panels-row .section-panel.half {
        max-height: none;
        overflow-y: visible;
    }
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО И КОНСТРУКТОР ПОЛЕЙ
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, #2c3139, #22252a);
    border: 1px solid #3a3f48;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #3a3f48;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: #8fa1b3;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #3a3f48;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== КОНСТРУКТОР ПОЛЕЙ ===== */
.fields-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field-row {
    background: #1e2124;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 14px;
    position: relative;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.field-row .remove-field-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ef5350;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.field-row .remove-field-btn:hover {
    opacity: 1;
}

.field-row .form-row {
    margin-top: 10px;
}

.field-row .checkbox-row {
    margin-top: 8px;
}

/* ===== ПУНКТЫ МЕНЮ ===== */
.menu-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item-row {
    background: #1e2124;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 14px;
    position: relative;
    animation: fadeIn 0.2s ease;
}

.menu-item-row .remove-menu-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ef5350;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.menu-item-row .remove-menu-item-btn:hover {
    opacity: 1;
}

.menu-item-row .form-row {
    margin-top: 10px;
}

/* Цвета кнопок Discord */
.button-style-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.button-style-1 { background: #5865F2; color: white; } /* Primary */
.button-style-2 { background: #4f545c; color: white; } /* Secondary */
.button-style-3 { background: #3ba55d; color: white; } /* Success */
.button-style-4 { background: #ed4245; color: white; } /* Danger */
.button-style-5 { background: #3ba55d; color: white; } /* Link */

.menu-item-image-preview {
    margin-top: 10px;
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #3a3f48;
}
/* ===== ПУНКТЫ МЕНЮ ===== */
.menu-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item-row {
    background: #1e2124;
    border: 1px solid #3a3f48;
    border-radius: 10px;
    padding: 14px;
    position: relative;
    animation: fadeIn 0.2s ease;
}

.menu-item-row .remove-menu-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ef5350;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.menu-item-row .remove-menu-item-btn:hover {
    opacity: 1;
}

.menu-item-row .form-row {
    margin-top: 10px;
}

/* Цвета кнопок Discord */
.button-style-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.button-style-1 { background: #5865F2; color: white; }
.button-style-2 { background: #4f545c; color: white; }
.button-style-3 { background: #3ba55d; color: white; }
.button-style-4 { background: #ed4245; color: white; }
.button-style-5 { background: #3ba55d; color: white; }

.menu-item-image-preview {
    margin-top: 10px;
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #3a3f48;
}