/* Стили для страницы пользователей */

.content-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
}

/* Панель фильтров */
.filters-panel {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
    transition: all 0.3s ease;
}

/* Свернутые фильтры */
.filters-panel.collapsed .filters-section {
    display: none;
}

.filters-panel.collapsed .filters-divider {
    display: none;
}

.filters-panel.collapsed .filters-panel-header {
    display: none;
}

.filters-panel.collapsed {
    padding: 12px 15px;
}

/* Кнопка сворачивания фильтров */
.filters-toggle-mobile {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(135deg, #000 0%, #333 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters-toggle-mobile:hover {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.filters-toggle-mobile:active {
    transform: translateY(0);
}

/* Панель режима редактирования */
.edit-mode-panel {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #fff;
    padding: 12px 20px;
    border-bottom: 2px solid #1565C0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.edit-mode-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.edit-mode-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-mode-info strong {
    font-size: 14px;
}

.edit-mode-info span {
    font-size: 12px;
    opacity: 0.9;
}

/* Панель скрытых элементов */
.hidden-items-panel {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 15px;
    display: none;
}

body.edit-mode .hidden-items-panel {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.hidden-items-panel h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hidden-items-panel h4::before {
    content: '👁‍🗨';
    font-size: 16px;
}

.hidden-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hidden-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.hidden-item-badge:hover {
    background: #e3f2fd;
    border-color: #2196F3;
    border-style: solid;
    color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.hidden-item-badge::before {
    content: '👁';
    font-size: 16px;
}

.edit-mode-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel {
    padding: 6px 16px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255,255,255,0.3);
}

.btn-reset-all {
    padding: 6px 16px;
    background: #ff9800;
    color: #fff;
    border: 1px solid #f57c00;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-reset-all:hover {
    background: #fb8c00;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.filters-panel-header {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.badge-clear-filters,
.badge-settings {
    padding: 5px 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.badge-clear-filters:hover,
.badge-settings:hover {
    background: #333;
    transform: translateY(-1px);
}

.filters-section {
    margin-bottom: 10px;
}

.filters-section:last-child {
    margin-bottom: 0;
}

.filters-divider {
    height: 1px;
    background: #ddd;
    margin: 10px 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 1400px) {
    .filters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filter-group input[type="number"] {
    appearance: textfield;
}

.filter-group input[type="number"]::-webkit-outer-spin-button,
.filter-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #000;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}


.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.per-page-selector label {
    font-weight: 500;
    margin: 0;
}

.per-page-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s;
}

.per-page-selector select:hover {
    border-color: #999;
}

.per-page-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.selected-counter {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.selected-counter span {
    color: #2196F3;
    font-weight: 700;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    position: relative;
    width: 100%;
}

body.edit-mode .table-container {
    overflow-x: auto;
    overflow-y: visible;
}

/* Улучшенная адаптивность для мобильных устройств */
@media (max-width: 768px) {
    /* Убираем любые ограничения высоты - пусть страница скроллится целиком */
    .table-container {
        max-height: none !important;
        min-height: auto;
        height: auto;
        overflow-x: scroll !important;
        overflow-y: visible !important;
        position: relative;
    }
    
    .table-container::after {
        content: '← Прокрутите →';
        position: sticky;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 6px 12px;
        border-radius: 4px 4px 0 0;
        font-size: 11px;
        text-align: center;
        pointer-events: none;
        z-index: 20;
        opacity: 0.8;
        white-space: nowrap;
        display: block;
        width: fit-content;
        margin: 0 auto;
        transition: opacity 0.3s ease;
    }
    
    /* Скрываем индикатор после прокрутки */
    .table-container.scrolled::after {
        opacity: 0;
    }
    
    .users-table {
        min-width: 1200px; /* Минимальная ширина для горизонтального скролла */
    }
    
    /* Улучшаем горизонтальный скроллбар таблицы на мобильных */
    .table-container::-webkit-scrollbar {
        height: 10px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    /* Убираем overflow: hidden с родительских контейнеров */
    .content-card {
        overflow: visible !important;
    }
}

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    position: relative;
    table-layout: fixed;
}

.users-table thead th {
    padding: 10px 12px;
    text-align: left;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #eee;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 15;
}

.users-table thead th:last-child {
    border-right: none;
}

/* Сортируемые столбцы */
.users-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

/* Убираем старый символ сортировки из admin.css */
.users-table thead th.sortable::after {
    content: none !important;
}

/* Стили для кнопки полноэкранного режима */
.btn-fullscreen {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-fullscreen:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Стили для кнопки экспорта в Excel */
.btn-export-excel {
    background: #28a745 !important;
    border: 1px solid #28a745 !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.btn-export-excel:hover {
    background: #218838;
    border-color: #1e7e34;
}

.btn-export-excel:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

/* Полноэкранное модальное окно */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.fullscreen-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-content {
    width: 95vw;
    height: 95vh;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.fullscreen-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.btn-close-fullscreen {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-fullscreen:hover {
    background: #e8e8e8;
    color: #333;
}

.fullscreen-table-container {
    flex: 1;
    overflow: auto;
    padding: 20px 30px;
}

.fullscreen-table {
    width: 100%;
    font-size: 13px;
}

.fullscreen-table th,
.fullscreen-table td {
    padding: 12px 8px;
    white-space: nowrap;
    min-width: 120px;
}

.fullscreen-table th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fullscreen-table tbody tr:hover {
    background: #f8f9fa;
}

/* Адаптивные стили для полноэкранного режима */
@media (max-width: 1200px) {
    .fullscreen-content {
        width: 98vw;
        height: 98vh;
    }
    
    .fullscreen-table-container {
        padding: 15px 20px;
    }
    
    .fullscreen-table {
        font-size: 12px;
    }
    
    .fullscreen-table th,
    .fullscreen-table td {
        padding: 8px 6px;
        min-width: 100px;
    }
}


.users-table thead th.sortable:hover {
    background: linear-gradient(180deg, #f8f8f8 0%, #ebebeb 100%) !important;
}

.users-table thead th .th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.users-table thead th .th-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-table thead th .sort-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    transition: all 0.2s ease;
    opacity: 0.4;
}

.users-table thead th.sortable:hover .sort-icon {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.03);
}

.users-table thead th .sort-icon.sort-asc,
.users-table thead th .sort-icon.sort-desc {
    opacity: 1;
    background: rgba(33, 150, 243, 0.1);
}

/* Стрелки сортировки */
.users-table thead th .sort-icon svg {
    transition: all 0.2s ease;
}

.users-table thead th .sort-icon.sort-none .sort-arrow-up,
.users-table thead th .sort-icon.sort-none .sort-arrow-down {
    fill: #999;
    opacity: 0.5;
}

.users-table thead th.sortable:hover .sort-icon.sort-none .sort-arrow-up,
.users-table thead th.sortable:hover .sort-icon.sort-none .sort-arrow-down {
    opacity: 0.8;
}

.users-table thead th .sort-icon.sort-asc .sort-arrow-up {
    fill: #2196F3;
    opacity: 1;
}

.users-table thead th .sort-icon.sort-asc .sort-arrow-down {
    fill: #ddd;
    opacity: 0.4;
}

.users-table thead th .sort-icon.sort-desc .sort-arrow-up {
    fill: #ddd;
    opacity: 0.4;
}

.users-table thead th .sort-icon.sort-desc .sort-arrow-down {
    fill: #2196F3;
    opacity: 1;
}

/* Анимация при клике */
.users-table thead th.sortable:active .sort-icon {
    transform: scale(0.9);
}

/* Центрируем заголовки и убираем многоточие для чекбоксов и нумерации */
.users-table thead th:nth-child(1),
.users-table thead th:nth-child(2) {
    text-overflow: clip;
    overflow: visible;
    text-align: center;
}

.users-table tbody td:nth-child(1),
.users-table tbody td:nth-child(2) {
    text-align: center;
}

/* Скроллируемые ячейки */
.scrollable-cell {
    max-height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.scrollable-cell::-webkit-scrollbar {
    width: 6px;
}

.scrollable-cell::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.scrollable-cell::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.scrollable-cell::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Стили для операций */
.operation-item {
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #e0e0e0;
    background: #fafafa;
    font-size: 0.8125rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.operation-item:last-child {
    margin-bottom: 0;
}

.op-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.op-sale {
    color: #28a745;
}

.op-return {
    color: #dc3545;
}

/* Контейнер товаров в чеке */
.op-items {
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Отдельный товар */
.op-item {
    padding: 6px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.op-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.op-product {
    margin-bottom: 3px;
    font-size: 0.875rem;
    font-weight: 500;
}

.op-detail {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 2px;
}

/* Сумма отдельного товара */
.op-item-amount {
    font-size: 0.75rem;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

.op-item-amount strong {
    color: #000;
    font-weight: 600;
}

/* Итого по чеку */
.op-total {
    font-weight: 600;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 2px solid #e0e0e0;
    font-size: 0.875rem;
}

.op-total strong {
    font-size: 0.9375rem;
}

.op-bonuses {
    font-size: 0.75rem;
    margin-top: 6px;
    display: flex;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px dashed #e0e0e0;
}

/* Элемент движения баллов в таблице */
.bonus-movement-item {
    padding: 6px 8px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.bonus-movement-item:last-child {
    margin-bottom: 0;
}

.bonus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-weight: 600;
}

.bonus-amount {
    font-size: 1rem;
    margin-bottom: 2px;
}

.bonus-detail {
    font-size: 0.7rem;
    color: #666;
}

/* Модальное окно - группы товаров */
.product-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.group-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.group-count {
    font-size: 1rem;
    font-weight: bold;
}

/* Модальное окно - история операций */
.operations-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.operations-list::-webkit-scrollbar {
    width: 8px;
}

.operations-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.operations-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.operations-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.operation-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border-left: 4px solid #e0e0e0;
}

.operation-card .op-sale {
    border-left-color: #28a745;
}

.operation-card .op-return {
    border-left-color: #dc3545;
}

.operation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.operation-date {
    font-size: 0.75rem;
    color: #666;
}

.operation-product {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #000;
}

.operation-detail {
    font-size: 0.8125rem;
    color: #666;
    margin-bottom: 3px;
}

.operation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.operation-bonuses {
    display: flex;
    gap: 8px;
    font-size: 0.8125rem;
}

/* Карточка движения баллов в модальном окне */
.bonus-movement-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border-left: 4px solid #e0e0e0;
}

.bonus-amount-large {
    margin: 8px 0;
}

.users-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #f5f5f5;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

/* Убираем многоточие для чекбоксов и нумерации */
.users-table tbody td:nth-child(1),
.users-table tbody td:nth-child(2) {
    text-overflow: clip;
    overflow: visible;
}

/* Кастомный тултип */
.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    max-width: 400px;
    word-wrap: break-word;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-tooltip.show {
    opacity: 1;
}

.users-table tbody td:last-child {
    border-right: none;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.users-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.users-table tbody tr:hover {
    background: #f9f9f9;
}

/* Выделение строки при клике (темное) */
.users-table tbody tr.row-selected {
    background: #e0e0e0 !important;
}

/* Выделение строки при выборе чекбокса (голубое) */
.users-table tbody tr.row-checked {
    background: #e3f2fd !important;
}

/* Приоритет голубого над темным */
.users-table tbody tr.row-checked.row-selected {
    background: #e3f2fd !important;
}

.row-number {
    text-align: center;
    font-weight: 600;
    color: #666;
}

.row-checkbox {
    text-align: center;
}

.row-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.text-center {
    text-align: center;
}

/* Лоадер */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

/* Анимации появления */
.users-table tbody tr {
    opacity: 0;
    animation: fadeInRow 0.3s ease-out forwards;
}

.users-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.users-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.users-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.users-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.users-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.users-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.users-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.users-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.users-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.users-table tbody tr:nth-child(10) { animation-delay: 0.5s; }
.users-table tbody tr:nth-child(n+11) { animation-delay: 0.55s; }

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

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 5px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    min-width: 35px;
    text-align: center;
}

.page-btn:hover {
    background: #f5f5f5;
}

.page-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Кнопка "Подробнее" */
.btn-detail {
    padding: 4px 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-detail:hover {
    background: #333;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-body {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #666;
    text-transform: uppercase;
}

.modal-data {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px;
    font-size: 14px;
}

.modal-data-label {
    font-weight: 600;
    color: #666;
}

.modal-data-value {
    color: #333;
    word-wrap: break-word;
}

/* Стили для Select2 - подгоняем под обычные инпуты */
.select2-container {
    font-size: 13px;
}

.select2-container--default .select2-selection--single {
    height: 32px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    color: #333 !important;
    font-size: 13px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 30px !important;
    right: 6px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #000 !important;
    box-shadow: none !important;
}

.select2-dropdown {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.select2-search--dropdown {
    padding: 8px !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #000 !important;
    outline: none !important;
}

.select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.select2-results__option--highlighted {
    background-color: #f5f5f5 !important;
    color: #333 !important;
}

.select2-results__option--selected {
    background-color: #e8f4fd !important;
    color: #333 !important;
    font-weight: 500 !important;
}

/* Исправление: при наведении на выбранный элемент */
.select2-results__option--highlighted.select2-results__option--selected {
    background-color: #d0e9f8 !important;
    color: #333 !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e8f4fd !important;
    color: #333 !important;
}

.select2-container--default .select2-results__option[aria-selected=true]:hover {
    background-color: #d0e9f8 !important;
}

/* Стили для множественного выбора */
.select2-container--default .select2-selection--multiple {
    min-height: 32px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #fff !important;
    padding: 2px 6px !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #000 !important;
    box-shadow: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

/* Более специфичные селекторы для переопределения стандартных стилей Select2 */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #000 !important;
    border: 1px solid #000 !important;
    border-radius: 3px !important;
    color: #fff !important;
    font-size: 12px !important;
    padding: 2px 24px 2px 8px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
}

/* Максимальная специфичность для крестика удаления */
.select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    color: #fff !important;
    font-size: 18px !important;
    font-weight: bold !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    left: auto !important;
    border-right: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover {
    color: #ff4444 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 2px !important;
}

/* Дополнительные правила для полного переопределения стандартных стилей Select2 */
.filters-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default.select2-container--focus .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default.select2-container--open .select2-selection--multiple .select2-selection__choice__remove {
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    border: none !important;
    border-right: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.filters-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default.select2-container--focus .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default.select2-container--open .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ff4444 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 2px !important;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin: 0 !important;
    padding: 4px 6px !important;
    font-size: 13px !important;
    min-width: 100px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #999 !important;
    padding: 4px 6px !important;
}

/* Настройки столбцов */
.column-settings-info {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.info-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.info-list {
    margin: 0;
    padding-left: 20px;
}

.info-list li {
    margin-bottom: 6px;
}

.info-list strong {
    color: #000;
}

.columns-list {
    max-height: 400px;
    overflow-y: auto;
}

.column-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.column-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.column-item:hover {
    background: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.column-item.pinned {
    background: #e3f2fd;
    border-color: #2196F3;
    border-width: 2px;
}

.column-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.column-name-input {
    border: 1px solid #ddd;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.column-name-input:focus {
    outline: none;
    border-color: #2196F3;
    background: #fff;
}

.column-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-width-control {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.column-width-control label {
    color: #666;
    font-weight: 500;
}

.column-width-input {
    width: 60px;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.column-width-input:focus {
    outline: none;
    border-color: #2196F3;
}

.column-width-control span {
    color: #999;
}

.column-drag-handle {
    cursor: grab;
    color: #999;
    font-size: 18px;
    user-select: none;
    padding: 0 4px;
}

.column-drag-handle:active {
    cursor: grabbing;
}

.column-key {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.column-pin {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
}

.column-pin:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.column-pin.active {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}

.column-pin.active:hover {
    background: #1976D2;
}

.filter-visible-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    user-select: none;
}

.filter-visible-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-visible-toggle:hover {
    color: #333;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.btn-save,
.btn-reset {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-save {
    background: #000;
    color: #fff;
}

.btn-save:hover {
    background: #333;
}

/* Режим редактирования */
body.edit-mode .users-table thead th {
    cursor: move;
    user-select: none;
    position: relative;
}

/* Отключаем сортировку в режиме редактирования */
body.edit-mode .users-table thead th.sortable {
    cursor: move;
}

body.edit-mode .users-table thead th.sortable:hover {
    background: #e3f2fd !important;
}

/* Хендл для перетаскивания столбца */
.column-drag-handle {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    cursor: grab;
    padding: 4px;
    z-index: 5;
    transition: all 0.2s;
    user-select: none;
}

.column-drag-handle:hover {
    color: #2196F3;
    transform: translateY(-50%) scale(1.2);
}

.column-drag-handle:active {
    cursor: grabbing;
}

.sortable-drag .column-drag-handle {
    cursor: grabbing;
}

body.edit-mode .users-table thead th {
    padding-left: 28px !important;
}

body.edit-mode .users-table thead th:hover {
    background: #e3f2fd !important;
}

.column-controls {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    display: none;
    flex-direction: row;
    gap: 4px;
    background: #fff;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99999;
    border: 2px solid #2196F3;
    white-space: nowrap;
}

.column-controls::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #2196F3;
}

/* Ресайзер столбца */
.column-resizer {
    position: absolute;
    right: -4px;
    top: 0;
    bottom: 0;
    width: 12px;
    cursor: col-resize;
    background: transparent;
    z-index: 50;
}

.column-resizer:hover {
    background: rgba(33, 150, 243, 0.5);
}

body.edit-mode .users-table thead th {
    position: relative;
}

.column-resizer::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background: #2196F3;
    opacity: 0;
    transition: opacity 0.2s;
}

.column-resizer:hover::after {
    opacity: 1;
}

body.edit-mode .users-table thead th:hover .column-controls {
    display: flex;
}

.column-control-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 36px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.column-control-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.column-control-btn.active {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}

body.edit-mode .filter-group {
    position: relative;
    cursor: move;
    padding: 8px;
    border: 1px dashed transparent;
    border-radius: 4px;
    transition: all 0.2s;
}

body.edit-mode .filter-group::before {
    content: '☰';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

body.edit-mode .filter-group:hover {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.05);
}

.filter-edit-controls {
    position: absolute;
    right: 4px;
    top: 4px;
    display: none;
    flex-direction: row;
    gap: 4px;
    background: #fff;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
}

body.edit-mode .filter-group:hover .filter-edit-controls {
    display: flex;
}

.sortable-ghost {
    opacity: 0.4;
    background: #e3f2fd !important;
    border: 2px dashed #2196F3 !important;
}

/* Дополнительные стили для inline редактирования */
.column-name-editable {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: text;
    outline: none;
    min-width: 40px;
}

body.edit-mode .column-name-editable:hover {
    background: rgba(33, 150, 243, 0.1);
}

.column-name-editable.editing {
    background: #fff;
    border: 2px solid #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
    padding: 2px 6px;
}

.column-name-editable[contenteditable="true"]:focus {
    outline: none;
}

body.edit-mode .filter-group label {
    cursor: text;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

body.edit-mode .filter-group:hover label {
    background: rgba(255,255,255,0.8);
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-reset {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.btn-reset:hover {
    background: #f5f5f5;
}

.sortable-ghost {
    opacity: 0.4;
    background: #e3f2fd;
}

/* Закрепленные столбцы */
.users-table thead th.pinned-column {
    position: sticky !important;
    background: #e3f2fd !important;
    font-weight: 600;
    z-index: 25 !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.users-table tbody td.pinned-column {
    position: sticky !important;
    background: #f0f8ff !important;
    z-index: 10 !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.users-table tbody tr:hover td.pinned-column {
    background: #e1f0ff !important;
}

.users-table tbody tr.row-selected td.pinned-column {
    background: #d0e8ff !important;
}

.users-table tbody tr.row-checked td.pinned-column {
    background: #c8e4ff !important;
}

/* Кнопки создания */
.btn-create-mailing,
.btn-create-quiz {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 15px;
}

.btn-create-mailing {
    background: #28a745;
}

.btn-create-mailing:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-create-quiz {
    background: #007bff;
}

.btn-create-quiz:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-create-mailing:active,
.btn-create-quiz:active {
    transform: translateY(0);
}

/* Модальное окно рассылки */
.mailing-modal-content {
    max-width: 900px;
    width: 95%;
}

/* Модальное окно квиза */
.quiz-modal-content {
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
}

.quiz-modal-content .modal-body {
    max-height: 78vh;
    overflow-y: auto;
    padding: 1rem;
}

/* Секции формы */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    font-weight: 500;
}

.collapsible-section {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.editor-contenteditable.small {
    height: 120px;
    min-height: 120px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-add-question {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-question:hover {
    background: #0056b3;
}

/* Список вопросов */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    position: relative;
}

.question-card.dragging {
    opacity: 0.5;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.question-drag-handle {
    cursor: grab;
    color: #999;
    font-size: 20px;
}

.question-drag-handle:active {
    cursor: grabbing;
}

.question-number {
    font-weight: 700;
    color: #007bff;
    font-size: 14px;
}

.question-controls {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

.btn-remove-question {
    width: 28px;
    height: 28px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}

.btn-remove-question:hover {
    background: #c82333;
}

.question-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-type-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.buttons-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.button-row {
    display: flex;
    gap: 6px;
}

.button-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.btn-remove-button {
    width: 32px;
    height: 32px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-add-button {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-add-button:hover {
    background: #218838;
}

/* Telegram кнопки в превью */
.telegram-buttons {
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.telegram-button {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #0088cc;
    cursor: default;
    transition: all 0.2s;
}

.telegram-button:hover {
    background: #f8f9fa;
}

/* Layout редактора квиза */
.quiz-editor-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

.questions-editor-col {
    min-width: 0;
}

.quiz-preview-col {
    position: relative;
}

.preview-sticky {
    position: sticky;
    top: 20px;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.telegram-preview.quiz-preview {
    height: auto;
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
}

.quiz-preview .telegram-message {
    margin-bottom: 15px;
}

.quiz-preview .telegram-message:last-child {
    margin-bottom: 0;
}

/* Компактные карточки вопросов */
.question-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    position: relative;
}

.question-card .editor-contenteditable {
    height: 80px;
    font-size: 13px;
}

.question-card .editor-toolbar {
    padding: 6px;
}

.question-card .editor-btn {
    width: 28px;
    height: 28px;
}

@media (max-width: 992px) {
    .quiz-editor-layout {
        grid-template-columns: 1fr;
    }
    
    .preview-sticky {
        position: static;
    }
    
    .telegram-preview.quiz-preview {
        max-height: 300px;
    }
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.recipients-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.recipients-info span {
    font-size: 14px;
    color: #495057;
}

.recipients-info strong {
    color: #007bff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Двухколоночная форма */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-col {
    min-width: 0;
}

/* Предпросмотр Telegram */
.telegram-preview {
    background: linear-gradient(180deg, #0088cc 0%, #006699 100%);
    border-radius: 8px;
    padding: 20px;
    height: 368px;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.telegram-preview::-webkit-scrollbar {
    width: 8px;
}

.telegram-preview::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.telegram-preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.telegram-preview::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.telegram-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.telegram-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #0088cc;
    flex-shrink: 0;
}

.telegram-bubble {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    position: relative;
    flex: 1;
    word-break: break-word;
    overflow: hidden;
}

.telegram-media {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0;
}

.telegram-document {
    padding: 10px 14px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px 12px 0 0;
}

.telegram-document-icon {
    width: 40px;
    height: 40px;
    background: #0088cc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.telegram-document-info {
    flex: 1;
}

.telegram-document-name {
    font-weight: 600;
    font-size: 14px;
    color: #000;
}

.telegram-content {
    padding: 10px 14px;
}

.telegram-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #fff transparent transparent;
}

.telegram-sender {
    font-weight: 600;
    font-size: 14px;
    color: #0088cc;
    margin-bottom: 4px;
}

.telegram-text {
    font-size: 15px;
    line-height: 1.4;
    color: #000;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-height: 240px;
    overflow-y: auto;
}

.telegram-text::-webkit-scrollbar {
    width: 6px;
}

.telegram-text::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.telegram-text::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.telegram-text::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.telegram-text b,
.telegram-text strong {
    font-weight: 700;
}

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

.telegram-text code {
    background: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #333;
}

.telegram-text s,
.telegram-text strike {
    text-decoration: line-through;
}

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

.telegram-text a {
    color: #0088cc;
    text-decoration: none;
}

.telegram-text a:hover {
    text-decoration: underline;
}

.telegram-text pre {
    background: #f0f0f0;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.telegram-time {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

.form-hint code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
}

/* Счетчик символов */
.char-counter {
    text-align: right;
    font-size: 13px;
    color: #666;
    margin-top: -10px;
    margin-bottom: 15px;
    font-weight: 500;
}

.char-counter #charCount {
    font-weight: 700;
}

.char-counter.warning #charCount {
    color: #ffc107;
}

.char-counter.danger #charCount {
    color: #dc3545;
}

/* Панель инструментов редактора */
.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
}

.editor-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
}

.editor-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

.editor-btn:active,
.editor-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

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

.editor-contenteditable {
    border-radius: 0 0 4px 4px !important;
    border-top: none !important;
    height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.editor-contenteditable:empty:before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

.editor-contenteditable:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.editor-contenteditable::-webkit-scrollbar {
    width: 8px;
}

.editor-contenteditable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.editor-contenteditable::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.editor-contenteditable::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Форматирование внутри редактора */
.editor-contenteditable b,
.editor-contenteditable strong {
    font-weight: 700;
}

.editor-contenteditable i,
.editor-contenteditable em {
    font-style: italic;
}

.editor-contenteditable code {
    background: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #333;
}

/* Responsive для фильтров и интерфейса */
@media (max-width: 768px) {
    /* Фильтры в одну колонку */
    .filters-grid {
        grid-template-columns: 1fr !important;
    }
    
    .filters-panel {
        padding: 10px;
        /* Убираем фиксированную высоту - пусть фильтры растягиваются естественно */
        max-height: none;
        overflow-y: visible;
        overflow-x: hidden;
    }
    
    /* Делаем кнопки управления более заметными */
    .filters-panel-header {
        margin-bottom: 10px;
    }
    
    /* Панель управления таблицей */
    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 10px;
    }
    
    .header-left,
    .header-right {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .header-right {
        align-items: flex-start;
    }
    
    .selected-counter {
        font-size: 13px;
    }
    
    /* Пагинация */
    .pagination-wrapper {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
    }
    
    .pagination-pages {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-btn {
        min-width: 32px;
        padding: 4px 8px;
        font-size: 13px;
    }
    
    /* Уменьшаем кнопки на мобильных */
    .btn-create-mailing,
    .btn-create-quiz,
    .btn-fullscreen,
    .btn-export-excel {
        font-size: 12px;
        padding: 6px 10px;
        width: 100%;
        justify-content: center;
    }
    
    /* Скрываем иконки на мобильных для экономии места */
    .btn-create-mailing i,
    .btn-create-quiz i,
    .btn-fullscreen i,
    .btn-export-excel i {
        display: none;
    }
    
    /* Модальные окна на полный экран на мобильных */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-body {
        max-height: calc(100vh - 60px);
        padding: 15px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    /* Формы на мобильных */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .mailing-modal-content {
        max-width: 100%;
    }
    
    .quiz-modal-content {
        max-width: 100%;
        max-height: 100vh;
    }
    
    /* Уменьшаем шрифты таблицы */
    .users-table {
        font-size: 11px;
    }
    
    .users-table thead th,
    .users-table tbody td {
        padding: 6px 8px;
    }
    
    /* Панель заголовка страницы */
    .page-header {
        padding: 15px 10px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    /* Контейнер контента */
    .content-card {
        margin: 10px;
        overflow-y: visible;
    }
    
    /* Убираем фиксированные высоты которые мешают скроллу */
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden;
    }
    
    .main-content {
        height: auto;
        min-height: 100vh;
        overflow-y: visible !important;
        overflow-x: hidden;
    }
    
    .content-wrapper {
        height: auto;
        overflow: visible !important;
        padding-bottom: 30px; /* Добавляем отступ снизу для удобства */
    }
    
    /* Мобильные специфичные стили для кнопки фильтров */
    .filters-toggle-mobile {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) and (min-width: 769px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .users-table {
        font-size: 12px;
    }
    
    .users-table thead th,
    .users-table tbody td {
        padding: 6px 8px;
    }
}
