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

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}



.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.ymap_poly_editor_container {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* ФИКС-КЛАСС для контейнера */
.polygon-editor-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}



/* АДАПТИВ */
@media (max-width: 768px) {
    .polygon-editor-wrapper {
        padding: 0 12px;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .polygon-editor-wrapper {
        padding: 0 8px;
        margin: 10px auto;
    }
}

/* ==================== СПИСОК ПОЛИГОНОВ ==================== */
#ymap_poly_editor_list {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.polygon-list {
    padding: 0;
}

/* Заголовок списка */
.polygon-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.polygon-list-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.polygon-list-count {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Контейнер элементов */
.polygon-list-items {
    max-height: 800px;
    overflow-y: auto;
    padding: 8px;
}

.polygon-list-items::-webkit-scrollbar {
    width: 6px;
}

.polygon-list-items::-webkit-scrollbar-track {
    background: transparent;
}

.polygon-list-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.polygon-list-items::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Элемент списка */
.polygon-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 6px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.polygon-list-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.polygon-list-item.active {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f640;
}

.polygon-list-item.active:hover {
    background: #dbeafe;
    border-color: #2563eb;
}

/* Индикатор цвета */
.polygon-item-color {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.polygon-list-item:hover .polygon-item-color {
    transform: scale(1.05);
}

.polygon-list-item.active .polygon-item-color {
    box-shadow: 0 0 0 3px #3b82f640;
}

/* Информация */
.polygon-item-info {
    flex: 1;
    min-width: 0;
}

.polygon-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.polygon-item-coords {
    font-size: 12px;
    color: #64748b;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.polygon-list-item.active .polygon-item-name {
    color: #1e40af;
}

.polygon-list-item.active .polygon-item-coords {
    color: #3b82f6;
    background: #dbeafe;
}

/* Кнопки действий */
.polygon-item-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.polygon-list-item:hover .polygon-item-actions {
    opacity: 1;
}

.polygon-item-actions button {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
}

.polygon-item-actions button:hover {
    transform: scale(1.1);
}

.btn-filter {
    color: #64748b;
}

.btn-filter:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #3b82f6;
}

.polygon-list-item.active .btn-filter {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-delete {
    color: #ef4444;
}

.btn-delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Пустое состояние */
.polygon-list-empty {
    padding: 48px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.polygon-list-empty::before {
    content: '';
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Анимация появления */
.polygon-list-item {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .polygon-list-header {
        padding: 12px 16px;
    }

    .polygon-list-item {
        padding: 10px 12px;
    }

    .polygon-item-color {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .polygon-item-name {
        font-size: 13px;
    }

    .polygon-item-coords {
        font-size: 11px;
    }

    .polygon-item-actions {
        opacity: 1;
    }
}

.ymap_poly_editor_container .ymaps-2-1-79-controls__toolbar_right {
    margin-right: 10px !important;
}

.ymap_poly_editor_container .ymap_poly_editor_map {
    width: 100%;
    height: 100%;
}

.ymap_poly_editor_status {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f5f7fa;
    border-radius: 6px;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 14px;
    color: #1e293b;
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ymap_poly_editor_status .ymap_poly_editor_badge {
    background: #3b82f6;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}


.polygon-item-color-wrapper {
    position: relative;
    flex-shrink: 0;
}

.polygon-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    opacity: 0;
    cursor: pointer;
    border-radius: 8px;
}

.polygon-item-color {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.polygon-item-color:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.polygon-item-color::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Строка с названием */
.polygon-item-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.polygon-name-input {
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    padding: 4px 8px;
    border-radius: 6px;
    width: 100%;
    transition: all 0.2s;
    outline: none;
}

.polygon-name-input:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.polygon-name-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.polygon-list-item.active .polygon-name-input {
    color: #1e40af;
}

/* Селект с ботом */
.polygon-item-bot {
    margin-top: 8px;
}

.polygon-item-bot .select2-container--default .select2-selection--single {
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.polygon-item-bot .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px;
    padding-left: 10px;
    color: #475569;
}

.polygon-item-bot .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 30px;
}

.polygon-item-bot .select2-container--default .select2-selection--single:hover {
    border-color: #cbd5e1;
}

.polygon-item-bot .select2-dropdown {
    border-color: #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.polygon-item-bot .select2-results__option {
    padding: 6px 10px;
    font-size: 13px;
}

.polygon-item-bot .select2-results__option--highlighted {
    background: #f1f5f9;
    color: #1e293b;
}

.polygon-item-bot .select2-search--dropdown .select2-search__field {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
}

.polygon-item-color:hover::after {
    opacity: 1;
}

.polygon-list-item.active .polygon-item-color {
    box-shadow: 0 0 0 3px #3b82f640;
}

.ymap_poly_editor_status .ymap_poly_editor_hint {
    font-size: 13px;
    color: #475569;
}

.ymap_poly_editor_status .ymap_poly_editor_coords {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: #e9edf4;
    padding: 2px 10px;
    border-radius: 16px;
    color: #0f172a;
    word-break: break-all;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ymap_poly_editor_btn {
    background: white;
    border: 1px solid #d1d9e6;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s;
}

.ymap_poly_editor_btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.ymap_poly_editor_btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.ymap_poly_editor_btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.ymap_poly_editor_btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.ymap_poly_editor_btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.ymap_poly_editor_btn-group {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ymap_poly_editor_toolbar {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-content {
    min-height: 150px;
    max-height: 400px;
    padding: 16px;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    outline: none;
    background: white;
}

/* ==================== TELEGRAM PREVIEW — СВЕТЛАЯ ТЕМА ==================== */
.telegram-preview {
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #e9ecef;
}

.tg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tg-avatar {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.tg-chat-name {
    font-size: 14px;
    font-weight: 600;
}

.tg-chat-status {
    font-size: 11px;
    opacity: 0.8;
}

.tg-messages {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.tg-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 90%;
}

.tg-bubble {
    background: #fff;
    border-radius: 6px 12px 12px 6px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #212529;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.tg-text {
    color: #212529;
    white-space: pre-wrap;
}

/* Картинка в сообщении */
.tg-bubble-media {
    padding: 4px !important;
    background: #fff !important;
}

/* Сетка медиа */
.tg-media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: -8px -12px 6px;
}

.tg-media-grid:has(.tg-image-preview:only-child) .tg-image-preview {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.tg-image-preview {
    width: calc(50% - 1px);
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.tg-image-preview:only-child {
    width: 100%;
    max-height: 300px;
}

.tg-video-wrap {
    position: relative;
    width: 100%;
    max-width: 280px;
}

.tg-video-preview {
    width: 100%;
    border-radius: 0;
    display: block;
}

/* Текст внутри пузыря */
.tg-text-content {
    padding: 0;
}

.tg-text-content .tg-text:first-child {
    margin-top: 0;
}

.tg-text {
    color: #212529;
    line-height: 1.4;
}

.tg-text b,
.tg-text strong {
    font-weight: 600;
}

.tg-text i,
.tg-text em {
    font-style: italic;
}

.tg-text u {
    text-decoration: underline;
}

.tg-text s,
.tg-text strike {
    text-decoration: line-through;
    color: #8d9ba8;
}

.tg-quote {
    border-left: 2px solid #3390ec;
    padding: 4px 0 4px 10px;
    margin: 4px 0;
    color: #6c757d;
    font-size: 13px;
}

/* Файлы */
.tg-files-list {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.tg-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.tg-file+.tg-file {
    border-top: 1px solid #f5f5f5;
}

.tg-file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tg-file-name {
    font-size: 13px;
    color: #212529;
}

.tg-file-size {
    font-size: 11px;
    color: #8d9ba8;
}

.tg-bubble {
    background: #fff;
    border-radius: 6px 12px 12px 6px;
    font-size: 14px;
    line-height: 1.45;
    color: #212529;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

.tg-time {
    font-size: 11px;
    color: #8d9ba8;
    margin-top: 2px;
    padding-left: 4px;
}

.tg-image-preview {
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
    display: block;
}

.tg-video-preview {
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
    display: block;
}

.tg-media-caption {
    padding: 6px 8px 4px;
    font-size: 12px;
    color: #8d9ba8;
}

/* Файл */
.tg-bubble-file {
    background: #fff !important;
}

.tg-text b,
.tg-text strong {
    font-weight: 600;
}

.tg-text i,
.tg-text em {
    font-style: italic;
}

.tg-text u {
    text-decoration: underline;
}

.tg-text s,
.tg-text strike {
    text-decoration: line-through;
    color: #8d9ba8;
}

.tg-text a {
    color: #3390ec;
    text-decoration: none;
}

/* Цитата */
.tg-quote {
    border-left: 2px solid #3390ec;
    padding: 4px 0 4px 10px;
    margin: 4px 0;
    color: #6c757d;
    font-size: 13px;
    background: transparent;
}

.tg-time {
    font-size: 11px;
    color: #8d9ba8;
    margin-top: 2px;
    padding-left: 4px;
}

/* Опрос */
.tg-poll {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.tg-poll-question {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    color: #212529;
}

.tg-poll-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    position: relative;
    padding: 6px 8px;
    background: #f0f4ff;
    border-radius: 6px;
    font-size: 13px;
    color: #212529;
}

.tg-poll-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 6px;
    opacity: 0.2;
}

.tg-poll-option span:first-of-type {
    flex: 1;
    z-index: 1;
}

.tg-poll-percent {
    font-weight: 600;
    color: #667eea;
    z-index: 1;
}

.tg-poll-votes {
    font-size: 11px;
    color: #8d9ba8;
    margin-top: 4px;
}

/* Файл */
.tg-file {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tg-file-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #3390ec;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tg-file-name {
    font-size: 13px;
    color: #212529;
    font-weight: 500;
}

.tg-file-size {
    font-size: 11px;
    color: #8d9ba8;
    margin-top: 2px;
}

/* Контейнер предпросмотра */
.preview-area {
    padding: 0 !important;
}


.recipient-search {
    position: relative;
}

.recipient-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}

.recipient-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.recipient-dropdown-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: #6c757d;
    font-size: 13px;
    text-align: center;
    justify-content: center;
}

.recipient-dropdown-empty i {
    font-size: 18px;
}

.recipient-dropdown-item:hover {
    background: #f8f9fa;
}

.recipient-dropdown-item.selected {
    background: rgba(13, 110, 253, 0.05);
}

.recipient-dropdown-item i {
    font-size: 16px;
}

.recipient-dropdown-item i.bi-megaphone {
    color: #6f42c1;
}

.recipient-dropdown-item i.bi-robot {
    color: #0d6efd;
}

.tg-file-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #0d6efd;
    flex-shrink: 0;
}

.tg-file-name {
    font-size: 13px;
    font-weight: 500;
    color: #212529;
}

.tg-file-size {
    font-size: 11px;
    color: #8d9ba8;
    margin-top: 2px;
}

.broadcast-editor .card-body {
    /* max-width: 900px;
    min-width: 700px; */
    width: 900px;
}

.editor-content blockquote.editor-quote {
    display: block;
    border-left: 4px solid #0d6efd;
    padding: 10px 16px;
    margin: 10px 0;
    background: #f8f9fa;
    color: #495057;
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.editor-content blockquote.editor-quote::before {
    content: '❝ ';
    font-size: 20px;
    color: #0d6efd;
    font-style: normal;
}


.editor-content:focus {
    border-color: #0d6efd;
}

.editor-content:empty::before {
    content: attr(placeholder);
    color: #adb5bd;
}

.emoji-picker {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    font-size: 20px;
    letter-spacing: 4px;
    line-height: 2;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-width: 300px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.broadcast-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 992px) {
    .broadcast-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 15px;
    color: #212529;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.card-body {
    padding: 20px;
}

/* ==================== ФОРМЫ ==================== */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* ==================== ВЫБОР ТИПА ПОЛУЧАТЕЛЕЙ ==================== */
.recipient-type-selector {
    display: flex;
    gap: 8px;
}

.recipient-option {
    flex: 1;
    cursor: pointer;
}

.recipient-option input {
    display: none;
}

.recipient-option .option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 13px;
    color: #6c757d;
    transition: all 0.2s;
}

.recipient-option .option-content i {
    font-size: 20px;
}

.recipient-option.active .option-content,
.recipient-option input:checked+.option-content {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
    color: #0d6efd;
}

/* ==================== ПОЛУЧАТЕЛИ ==================== */
.recipient-search {
    position: relative;
}

.recipient-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 16px;
    z-index: 1;
}

.recipient-search .form-control {
    padding-left: 40px;
}

.selected-recipients {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.recipient-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 12px;
    color: #495057;
}

.recipient-tag i {
    cursor: pointer;
    color: #adb5bd;
    font-size: 14px;
}

.recipient-tag i:hover {
    color: #dc3545;
}

/* ==================== РЕДАКТОР ==================== */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #495057;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 4px;
}

.editor-textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
}

.editor-textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* ==================== ВЛОЖЕНИЯ ==================== */
.attachments-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
}

.remove-attachment {
    cursor: pointer;
    color: #adb5bd;
    font-size: 16px;
    margin-left: 4px;
}

.remove-attachment:hover {
    color: #dc3545;
}

.add-attachment-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    color: #6c757d;
    font-size: 13px;
    transition: all 0.2s;
}

.add-attachment-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

/* ==================== ОПРОС ==================== */
.poll-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== ПРЕДПРОСМОТР ==================== */
.preview-area {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.preview-phone {
    width: 100%;
    max-width: 320px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 16px;
    overflow: hidden;
}

.preview-header {
    padding: 12px 16px;
    background: #0d6efd;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.preview-message {
    padding: 16px;
    background: white;
    font-size: 13px;
    line-height: 1.5;
}

.preview-message p {
    margin: 0 0 8px 0;
}

.preview-poll {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.poll-question {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 13px;
}

.poll-option-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #6c757d;
}

.option-bar {
    height: 8px;
    background: #0d6efd;
    border-radius: 4px;
    min-width: 20px;
}

.preview-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 8px;
}

/* ==================== ВЫБОР ВРЕМЕНИ ==================== */
.send-time-selector {
    display: flex;
    gap: 8px;
}

.time-option {
    flex: 1;
    cursor: pointer;
}

.time-option input {
    display: none;
}

.time-option .option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 13px;
    color: #6c757d;
    transition: all 0.2s;
}

.time-option .option-content i {
    font-size: 20px;
}

.time-option.active .option-content,
.time-option input:checked+.option-content {
    border-color: #198754;
    background: rgba(25, 135, 84, 0.05);
    color: #198754;
}

/* ==================== СТАТИСТИКА ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.stat-item {
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
}

.stat-label {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

/* ==================== КНОПКИ ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background: #0d6efd;
    color: white;
}

.btn-primary:hover {
    background: #0b5ed7;
}

.btn-outline-primary {
    background: transparent;
    border-color: #0d6efd;
    color: #0d6efd;
}

.btn-outline-primary:hover {
    background: #0d6efd;
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border-color: #dee2e6;
    color: #495057;
}

.btn-outline-secondary:hover {
    background: #f8f9fa;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Drag-and-Drop стили */
.main_page_tree-item.sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 6px;
}

.main_page_tree-item.sortable-chosen {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

.main_page_tree-item.sortable-drag {
    opacity: 0.8;
}

/* Подсветка папки при наведении */
.main_page_tree-item[data-type="folder"].drag-over>.main_page_tree-row {
    background: rgba(13, 110, 253, 0.1);
    border: 2px solid #0d6efd;
    border-radius: 6px;
}

/* Контекстное меню */
.context-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    padding: 8px 0;
}

/* Подсветка папки при наведении во время drag-and-drop */
.main_page_tree-item[data-type="folder"].drag-over {
    background: rgba(13, 110, 253, 0.08);
    border: 2px dashed #0d6efd;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Анимация для перетаскиваемого элемента */
.main_page_tree-item.sortable-ghost {
    opacity: 0.4;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.main_page_tree-item.sortable-chosen {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg) scale(1.02);
    z-index: 1000;
}

/* Контекстное меню */
.context-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 200px;
    padding: 8px 0;
}

.context-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
    color: #333;
}

.context-item:hover {
    background: #f8f9fa;
}

.context-divider {
    height: 1px;
    background: #dee2e6;
    margin: 4px 0;
}


/* Перетаскиваемый элемент */
.main_page_tree-item.sortable-chosen {
    opacity: 0.7;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    background: white;
}

/* Призрак на месте элемента */
.main_page_tree-item.sortable-ghost {
    opacity: 0.3;
    background: #f0f0f0;
    border: 2px dashed #ccc;
}

/* Подсветка папки при наведении */
.main_page_tree-item[data-type="folder"].drag-over {
    background: rgba(13, 110, 253, 0.1) !important;
    border: 2px solid #0d6efd !important;
    border-radius: 8px !important;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.2);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Иконка папки при наведении */
.main_page_tree-item[data-type="folder"].drag-over .main_page_tree-icon.folder i {
    animation: folderOpen 0.5s ease;
    color: #0d6efd;
}

@keyframes folderOpen {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) rotate(-10deg);
    }

    100% {
        transform: scale(1);
    }
}



/* Контейнер для визуализации связей */
.bots-connections-container {
    background: white;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    padding: 24px;
    flex: 1;
    overflow: auto;
    position: relative;
    min-height: 500px;
}

/* Панель инструментов */
.bots-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.bots-toolbar .bots-search-wrap {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.bots-toolbar .bots-search-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8899aa;
    font-size: 18px;
}

.bots-toolbar .bots-search-wrap input {
    width: 100%;
    padding: 10px 16px 10px 46px;
    border: 1px solid #dce3ec;
    border-radius: 40px;
    font-size: 15px;
    background: white;
    transition: 0.2s;
    outline: none;
    font-family: 'Roboto', sans-serif;
}

.bots-toolbar .bots-search-wrap input:focus {
    border-color: #0066b3;
    box-shadow: 0 0 0 3px rgba(0, 80, 180, 0.1);
}

.bots-toolbar .bots-btn-add {
    background: #00478a;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 15px;
    transition: 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.bots-toolbar .bots-btn-add:hover {
    background: #003366;
    color: white;
}

/* Сетка связей */
.connections-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    height: 100%;
    min-height: 400px;
    position: relative;
}

/* Колонка ботов */
.bots-column {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #eef2f6;
    overflow-y: auto;
    max-height: 600px;
}

.bots-column .column-title {
    font-size: 16px;
    font-weight: 600;
    color: #0b2a44;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-item {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #eef2f6;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.bot-item:hover {
    border-color: #b0c8dd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bot-item.selected {
    border-color: #00478a;
    background: #f0f6fe;
    box-shadow: 0 0 0 3px rgba(0, 71, 138, 0.1);
}

.bot-item .bot-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a2a3a;
}

.bot-item .bot-token {
    font-size: 12px;
    color: #8899aa;
    font-family: monospace;
    margin-top: 4px;
    word-break: break-all;
}

.bot-item .bot-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.bot-item .bot-status.active {
    background: #2e9b5e;
}

.bot-item .bot-status.inactive {
    background: #b0bcc8;
}

.bot-item .bot-connections-count {
    font-size: 12px;
    color: #6a7f92;
    margin-top: 6px;
}

/* Центральная область - визуализация связей */
.connections-visual {
    background: #fafcfe;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connections-visual svg {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.connection-line {
    stroke: #00478a;
    stroke-width: 2;
    fill: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.connection-line:hover {
    opacity: 1;
    stroke-width: 3;
}

.connection-node {
    cursor: pointer;
    transition: all 0.2s;
}

.connection-node:hover {
    filter: brightness(0.9);
}

.connection-label {
    font-size: 11px;
    fill: #1a2a3a;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Колонка каналов/чатов */
.channels-column {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #eef2f6;
    overflow-y: auto;
    max-height: 600px;
}

.channels-column .column-title {
    font-size: 16px;
    font-weight: 600;
    color: #0b2a44;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-item {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #eef2f6;
    transition: all 0.15s;
    cursor: default;
}

.channel-item:hover {
    border-color: #b0c8dd;
}

.channel-item .channel-name {
    font-weight: 500;
    font-size: 14px;
    color: #1a2a3a;
}

.channel-item .channel-type {
    font-size: 12px;
    color: #6a7f92;
    margin-top: 2px;
}

/* Выбранный бот */
.bot-item.selected {
    border-left: 3px solid #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

/* Бот, связанный с выбранным каналом */
.bot-item.linked-to-channel {
    border-left: 3px solid #198754;
    background: rgba(25, 135, 84, 0.08);
}

/* Контейнер тостов */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

/* Сам тост */
.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 500px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success i {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error i {
    color: #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning i {
    color: #ffc107;
}

.toast-info {
    border-left: 4px solid #0dcaf0;
}

.toast-info i {
    color: #0dcaf0;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
}

.toast-close:hover {
    color: #000;
}

/* Выбранный канал */
.channel-item.selected {
    border-left: 3px solid #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

/* Канал, связанный с выбранным ботом */
.channel-item.linked {
    border-left: 3px solid #198754;
    background: rgba(25, 135, 84, 0.05);
}

/* Анимация при наведении */
.bot-item,
.channel-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-item:hover,
.channel-item:hover {
    transform: translateX(4px);
}

/* Выбранный бот */
.bot-item.selected {
    border-left: 3px solid #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

/* Связанный канал */
.channel-item.linked {
    border-left: 3px solid #198754;
    background: rgba(25, 135, 84, 0.05);
}

/* Описание бота */
.bot-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Модальное окно для создания бота */
.bots-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.bots-modal-overlay.active {
    display: flex;
}

.bots-modal {
    background: white;
    border-radius: 24px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.bots-modal h2 {
    font-size: 24px;
    font-weight: 600;
    color: #0b2a44;
    margin-bottom: 24px;
}

.bots-modal .form-group {
    margin-bottom: 20px;
}

.bots-modal .form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.bots-modal .form-group input,
.bots-modal .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    transition: 0.2s;
    outline: none;
}

.bots-modal .form-group input:focus,
.bots-modal .form-group select:focus {
    border-color: #0066b3;
    box-shadow: 0 0 0 3px rgba(0, 80, 180, 0.1);
}

.bots-modal .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.bots-modal .modal-actions button {
    padding: 10px 24px;
    border-radius: 40px;
    border: none;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
}

.bots-modal .modal-actions .btn-cancel {
    background: #f0f4f9;
    color: #2c3e50;
}

.bots-modal .modal-actions .btn-cancel:hover {
    background: #e2e8f0;
}

.bots-modal .modal-actions .btn-save {
    background: #00478a;
    color: white;
}

.bots-modal .modal-actions .btn-save:hover {
    background: #003366;
}

/* Адаптив */
@media (max-width: 1200px) {
    .connections-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bots-column,
    .channels-column {
        max-height: 300px;
    }

    .connections-visual {
        min-height: 300px;
    }
}


/* Призрак на месте элемента */
.main_page_tree-item.sortable-ghost {
    opacity: 0.3;
    background: #f0f0f0;
    border: 2px dashed #ccc;
}

/* Перетаскиваемый элемент */
.main_page_tree-item.sortable-chosen {
    opacity: 0.8;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    background: white;
}

/* Подсветка папки при наведении */
.main_page_tree-item[data-type="folder"].drag-over {
    background: rgba(13, 110, 253, 0.1) !important;
    border: 2px solid #0d6efd !important;
    border-radius: 8px !important;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.2);
    transition: all 0.2s ease;
}

/* Контекстное меню */
.context-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 200px;
    padding: 8px 0;
}

.context-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.context-item:hover {
    background: #f8f9fa;
}

.context-divider {
    height: 1px;
    background: #dee2e6;
    margin: 4px 0;
}

/* Курсор при перетаскивании */
.main_page_tree-row {
    cursor: grab;
}

.main_page_tree-row:active {
    cursor: grabbing;
}

/* Индикатор для пустых папок */
.main_page_tree-children:empty::after {
    content: 'Перетащите сюда ботов или папки';
    display: block;
    padding: 12px 16px;
    color: #adb5bd;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    margin: 4px 0;
}

.context-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.context-item:hover {
    background: #f8f9fa;
}

.context-divider {
    height: 1px;
    background: #dee2e6;
    margin: 4px 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f7fa;
    color: #1a1a1a;
    height: 100vh;
    overflow: hidden;
}

/* Основной контейнер — на всю высоту */
.main_page_app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ----- SIDEBAR (левое меню) ----- */
.main_page_sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 28px 20px 20px 20px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
    height: 100vh;
    overflow-y: auto;
}

/* Название системы */
.main_page_system-title {
    font-size: 28px;
    font-weight: 700;
    color: #0b3b5c;
    letter-spacing: -0.5px;
    margin-bottom: 36px;
    padding-left: 4px;
}

.main_page_system-title small {
    font-weight: 300;
    font-size: 14px;
    color: #6c7a8a;
    display: block;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* Меню */
.main_page_nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    flex-grow: 1;
}

.main_page_nav-menu li {
    margin-bottom: 6px;
}

.main_page_nav-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.15s ease;
    background: transparent;
}

.main_page_nav-menu a i {
    font-size: 22px;
    width: 28px;
    color: #5e6f7e;
    transition: color 0.15s;
}

.main_page_nav-menu a:hover {
    background-color: #eef2f7;
    color: #0b3b5c;
}

.main_page_nav-menu a:hover i {
    color: #0b3b5c;
}

.main_page_nav-menu a.active {
    background-color: #e3edf7;
    color: #00478a;
    font-weight: 600;
}

.main_page_nav-menu a.active i {
    color: #00478a;
}

/* Нижняя часть сайдбара — юзер и выход */
.main_page_sidebar-footer {
    border-top: 1px solid #e9edf2;
    padding-top: 20px;
    margin-top: 10px;
}

.main_page_user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 12px 4px;
}

.main_page_user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 40px;
    background: #d4dfeb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 18px;
    color: #1f3a57;
    flex-shrink: 0;
}

.main_page_user-name {
    font-weight: 500;
    font-size: 16px;
    color: #1a2a3a;
}

.main_page_user-role {
    font-size: 13px;
    color: #6b7b8b;
}

.main_page_logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #b91c1c;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    margin-top: 4px;
}

.main_page_logout-btn i {
    font-size: 20px;
}

.main_page_logout-btn:hover {
    background: #fee9e7;
    color: #a11616;
}

/* ----- ОСНОВНАЯ ОБЛАСТЬ (контент) ----- */
.main_page_main-content {
    flex: 1;
    background-color: #f5f7fa;
    padding: 28px 36px 36px 36px;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Хлебные крошки / заголовок */
.main_page_page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.main_page_page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #0b2a44;
    margin: 0;
}

.main_page_badge-date {
    background: #e9edf2;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    color: #2c3e50;
}

/* Карточки-плитки (дашборд) */
.main_page_stat-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f6;
    transition: 0.1s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main_page_stat-card:hover {
    border-color: #cad8e6;
    box-shadow: 0 6px 16px rgba(0, 40, 80, 0.04);
}

.main_page_stat-card .main_page_stat-label {
    font-size: 15px;
    font-weight: 500;
    color: #556a7a;
    letter-spacing: 0.2px;
}

.main_page_stat-card .main_page_stat-number {
    font-size: 38px;
    font-weight: 700;
    color: #0b2a44;
    line-height: 1.2;
    margin-top: 6px;
}

.main_page_stat-card .main_page_stat-sub {
    font-size: 14px;
    color: #6e7f8e;
    margin-top: 8px;
}

.main_page_stat-icon {
    font-size: 28px;
    color: #00478a;
    opacity: 0.6;
}

/* Секция "Быстрые действия" (карточки чат-ботов) */
.main_page_bot-card {
    background: white;
    border-radius: 18px;
    padding: 20px 22px;
    border: 1px solid #eef2f6;
    transition: 0.15s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main_page_bot-card:hover {
    border-color: #b8cbdd;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.02);
}

.main_page_bot-card .main_page_bot-name {
    font-weight: 600;
    font-size: 18px;
    color: #0b2a44;
}

.main_page_bot-card .main_page_bot-desc {
    font-size: 14px;
    color: #5e717f;
    margin: 6px 0 12px 0;
}

.main_page_bot-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    background: #e6f3e6;
    color: #14633b;
    width: fit-content;
}

.main_page_bot-status.inactive {
    background: #f1f3f4;
    color: #5c6b79;
}

/* Разделитель */
.main_page_section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a3147;
    margin-bottom: 18px;
    margin-top: 6px;
}

/* Адаптив */
@media (max-width: 992px) {
    .main_page_sidebar {
        width: 240px;
        min-width: 240px;
        padding: 20px 14px;
    }

    .main_page_system-title {
        font-size: 24px;
    }

    .main_page_main-content {
        padding: 20px 18px;
    }
}

@media (max-width: 768px) {
    .main_page_app-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .main_page_sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 16px;
    }

    .main_page_main-content {
        height: auto;
        overflow: visible;
        padding: 20px 16px;
    }

    .main_page_stat-card .main_page_stat-number {
        font-size: 30px;
    }

    .main_page_page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f7fa;
    color: #1a1a1a;
    height: 100vh;
    overflow: hidden;
}

/* Основной контейнер */
.main_page_app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.main_page_sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 28px 20px 20px 20px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
    height: 100vh;
    overflow-y: auto;
}

.main_page_system-title {
    font-size: 28px;
    font-weight: 700;
    color: #0b3b5c;
    letter-spacing: -0.5px;
    margin-bottom: 36px;
    padding-left: 4px;
}

.main_page_system-title small {
    font-weight: 300;
    font-size: 14px;
    color: #6c7a8a;
    display: block;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.main_page_nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    flex-grow: 1;
}

.main_page_nav-menu li {
    margin-bottom: 6px;
}

.main_page_nav-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.15s ease;
    background: transparent;
}

.main_page_nav-menu a i {
    font-size: 22px;
    width: 28px;
    color: #5e6f7e;
    transition: color 0.15s;
}

.main_page_nav-menu a:hover {
    background-color: #eef2f7;
    color: #0b3b5c;
}

.main_page_nav-menu a:hover i {
    color: #0b3b5c;
}

.main_page_nav-menu a.active {
    background-color: #e3edf7;
    color: #00478a;
    font-weight: 600;
}

.main_page_nav-menu a.active i {
    color: #00478a;
}

.main_page_sidebar-footer {
    border-top: 1px solid #e9edf2;
    padding-top: 20px;
    margin-top: 10px;
}

.main_page_user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 12px 4px;
}

.main_page_user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 40px;
    background: #d4dfeb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 18px;
    color: #1f3a57;
    flex-shrink: 0;
}

.main_page_user-name {
    font-weight: 500;
    font-size: 16px;
    color: #1a2a3a;
}

.main_page_user-role {
    font-size: 13px;
    color: #6b7b8b;
}

.main_page_logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #b91c1c;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    margin-top: 4px;
}

.main_page_logout-btn i {
    font-size: 20px;
}

.main_page_logout-btn:hover {
    background: #fee9e7;
    color: #a11616;
}

/* ===== ОСНОВНАЯ ОБЛАСТЬ ===== */
.main_page_main-content {
    flex: 1;
    background-color: #f5f7fa;
    padding: 28px 36px 36px 36px;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== СТАТИСТИКА (дашборд) ===== */
.main_page_page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.main_page_page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #0b2a44;
    margin: 0;
}

.main_page_badge-date {
    background: #e9edf2;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    color: #2c3e50;
}

.main_page_stat-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f6;
    transition: 0.1s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main_page_stat-card:hover {
    border-color: #cad8e6;
    box-shadow: 0 6px 16px rgba(0, 40, 80, 0.04);
}

.main_page_stat-card .main_page_stat-label {
    font-size: 15px;
    font-weight: 500;
    color: #556a7a;
    letter-spacing: 0.2px;
}

.main_page_stat-card .main_page_stat-number {
    font-size: 38px;
    font-weight: 700;
    color: #0b2a44;
    line-height: 1.2;
    margin-top: 6px;
}

.main_page_stat-card .main_page_stat-sub {
    font-size: 14px;
    color: #6e7f8e;
    margin-top: 8px;
}

.main_page_stat-icon {
    font-size: 28px;
    color: #00478a;
    opacity: 0.6;
}

.main_page_bot-card {
    background: white;
    border-radius: 18px;
    padding: 20px 22px;
    border: 1px solid #eef2f6;
    transition: 0.15s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main_page_bot-card:hover {
    border-color: #b8cbdd;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.02);
}

.main_page_bot-card .main_page_bot-name {
    font-weight: 600;
    font-size: 18px;
    color: #0b2a44;
}

.main_page_bot-card .main_page_bot-desc {
    font-size: 14px;
    color: #5e717f;
    margin: 6px 0 12px 0;
}

.main_page_bot-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    background: #e6f3e6;
    color: #14633b;
    width: fit-content;
}

.main_page_bot-status.inactive {
    background: #f1f3f4;
    color: #5c6b79;
}

.main_page_section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a3147;
    margin-bottom: 18px;
    margin-top: 6px;
}

/* ===== ТУЛБАР (страница чат-ботов) ===== */
.main_page_toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.main_page_toolbar .main_page_search-wrap {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.main_page_toolbar .main_page_search-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8899aa;
    font-size: 18px;
}

.main_page_toolbar .main_page_search-wrap input {
    width: 100%;
    padding: 10px 16px 10px 46px;
    border: 1px solid #dce3ec;
    border-radius: 40px;
    font-size: 15px;
    background: white;
    transition: 0.2s;
    outline: none;
    font-family: 'Roboto', sans-serif;
}

.main_page_toolbar .main_page_search-wrap input:focus {
    border-color: #0066b3;
    box-shadow: 0 0 0 3px rgba(0, 80, 180, 0.1);
}

.main_page_toolbar .main_page_search-wrap input::placeholder {
    color: #9aabbb;
}

.main_page_toolbar .main_page_btn-add {
    background: #00478a;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 15px;
    transition: 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.main_page_toolbar .main_page_btn-add:hover {
    background: #003366;
    color: white;
}

.main_page_toolbar .main_page_btn-mass-action {
    background: white;
    border: 1px solid #dce3ec;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 15px;
    color: #2c3e50;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
}

.main_page_toolbar .main_page_btn-mass-action:hover {
    background: #f0f4f9;
    border-color: #b0c4d8;
}

.main_page_selection-info {
    font-size: 14px;
    color: #556a7a;
    padding: 6px 16px;
    background: #eef2f6;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.main_page_selection-info .main_page_selection-count {
    font-weight: 600;
    color: #0b2a44;
}

.bot-indicator {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
    font-size: 11px;
}

.bot-indicator.active i {
    color: #0d6efd;
}

.bot-indicator.inactive i {
    color: #adb5bd;
}

/* Бейдж канала */
.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Бейдж чата */
.chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===== ДЕРЕВО (страница чат-ботов) ===== */
.main_page_tree-container {
    background: white;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
    min-height: 400px;
}

.main_page_tree-container.minPad {
    padding: 0;
}

.main_page_tree-item {
    user-select: none;
}

.main_page_tree-item .main_page_tree-row {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    transition: background 0.1s;
    border-radius: 6px;
    margin: 1px 8px;
    gap: 8px;
    min-height: 44px;
}

.main_page_tree-item .main_page_tree-row:hover {
    background: #f0f6fe;
}

.main_page_tree-item .main_page_tree-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #00478a;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6a7f92;
    transition: transform 0.2s;
    flex-shrink: 0;
    font-size: 14px;
    cursor: pointer;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-toggle.expanded {
    transform: rotate(90deg);
}

.main_page_tree-item .main_page_tree-row .main_page_tree-toggle.empty {
    visibility: hidden;
    cursor: default;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-icon {
    font-size: 20px;
    width: 28px;
    flex-shrink: 0;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-icon.folder {
    color: #f5b342;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-icon.channel {
    color: #0066b3;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-icon.chat {
    /* color: #0066b3; */
    color: #198754;
}

/* .main_page_tree-item .main_page_tree-row .main_page_tree-icon.chat {
    color: #0066b3;
} */

.main_page_tree-item .main_page_tree-row .main_page_tree-label {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1a2a3a;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-label a {
    color: #1a2a3a;
    text-decoration: none;
    transition: color 0.15s;
    display: inline-block;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-label a:hover {
    color: #00478a;
    text-decoration: underline;
}

.main_page_tree-item .main_page_tree-row .main_page_tree-badge {
    font-size: 12px;
    background: #eef2f6;
    padding: 2px 12px;
    border-radius: 30px;
    color: #556a7a;
    white-space: nowrap;
}

.main_page_tree-item .main_page_tree-children {
    padding-left: 28px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 0;
}

.main_page_tree-item .main_page_tree-children.open {
    max-height: 1000px;
}

.main_page_tree-item.hidden-by-search {
    display: none;
}

.main_page_bot-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.main_page_bot-status-indicator.active {
    background: #2e9b5e;
}

.main_page_bot-status-indicator.inactive {
    background: #b0bcc8;
}

.main_page_tree-item .main_page_tree-row.folder-row {
    cursor: pointer;
}

.main_page_tree-item .main_page_tree-row.bot-row {
    cursor: default;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 992px) {
    .main_page_sidebar {
        width: 240px;
        min-width: 240px;
        padding: 20px 14px;
    }

    .main_page_system-title {
        font-size: 24px;
    }

    .main_page_main-content {
        padding: 20px 18px;
    }
}

@media (max-width: 768px) {
    .main_page_app-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .main_page_sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 16px;
    }

    .main_page_main-content {
        height: auto;
        overflow: visible;
        padding: 20px 16px;
    }

    .main_page_stat-card .main_page_stat-number {
        font-size: 30px;
    }

    .main_page_page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .main_page_toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .main_page_toolbar .main_page_search-wrap {
        min-width: unset;
    }
}

.bots-column-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

/* Тулбар внутри колонки */
.bots-column-header .bots-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Поиск внутри колонки */
.bots-column-header .bots-search-wrap {
    flex: 1;
    min-width: 0;
    /* Чтобы не вылезало за пределы */
}

/* Адаптив: на маленьких экранах кнопка переносится */
@media (max-width: 768px) {
    .bots-column-header .bots-toolbar {
        flex-direction: column;
    }

    .bots-column-header .bots-search-wrap {
        width: 100%;
    }

    .bots-btn-add {
        width: 100%;
        justify-content: center;
    }
}