
.card, .stat-card, .board-item, .user-item, .search-result-item, .tab-button, .radio-item label, .alert {
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: none !important;
    transition: none !important;
    border-radius: 12px !important;
}

.card:hover, .stat-card:hover, .board-item:hover, .user-item:hover, .search-result-item:hover {
    background: #f8fafc !important;
    border-color: #6c5ce7 !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn, .btn-primary, .btn-success, .btn-warning, .btn-info, .btn-secondary, .btn-danger {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    letter-spacing: 0.01em !important;
    box-shadow: none !important;
    padding: 0.65rem 1.3rem !important;
    transition: background 0.15s, color 0.15s, border 0.15s !important;
    outline: none !important;
    border-width: 1.5px !important;
    border-style: solid !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.btn-primary {
    background: #6c5ce7 !important;
    color: #fff !important;
    border-color: #6c5ce7 !important;
}

.btn-primary:hover, .btn-primary:focus {
    background: #5847c3 !important;
    color: #fff !important;
    border-color: #5847c3 !important;
}

.btn-secondary {
    background: #fff !important;
    color: #6c5ce7 !important;
    border-color: #e2e8f0 !important;
}

.btn-secondary:hover, .btn-secondary:focus {
    background: #f4f6fb !important;
    color: #5847c3 !important;
    border-color: #cbd5e1 !important;
}

.btn-danger {
    background: #e74c3c !important;
    color: #fff !important;
    border-color: #e74c3c !important;
}

.btn-danger:hover, .btn-danger:focus {
    background: #c82333 !important;
    color: #fff !important;
    border-color: #c82333 !important;
}

.btn-info {
    background: #17a2b8 !important;
    color: #fff !important;
    border-color: #17a2b8 !important;
}

.btn-info:hover, .btn-info:focus {
    background: #138496 !important;
    color: #fff !important;
    border-color: #138496 !important;
}

.btn-success {
    background: #00ca72 !important;
    color: #fff !important;
    border-color: #00ca72 !important;
}

.btn-success:hover, .btn-success:focus {
    background: #00a95c !important;
    color: #fff !important;
    border-color: #00a95c !important;
}

.btn-warning {
    background: #ff7b00 !important;
    color: #fff !important;
    border-color: #ff7b00 !important;
}

.btn-warning:hover, .btn-warning:focus {
    background: #e86900 !important;
    color: #fff !important;
    border-color: #e86900 !important;
}

.btn:active, .btn-primary:active, .btn-success:active, .btn-warning:active, .btn-info:active, .btn-secondary:active, .btn-danger:active {
    filter: brightness(0.97) !important;
    opacity: 0.92 !important;
}

.btn:disabled, .btn[disabled] {
    opacity: 0.5 !important;
    background: #f1f5f9 !important;
    color: #b0b7c3 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-sm {
    font-size: 0.95rem !important;
    padding: 0.45rem 1rem !important;
    border-radius: 7px !important;
}

.btn-xs {
    font-size: 0.85rem !important;
    padding: 0.28rem 0.7rem !important;
    border-radius: 6px !important;
}

.board-action-btn, .board-action-btn:hover {
    background: transparent !important;
    color: #64748b !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
}

.tab-button, .tab-button.active {
    background: #f8fafc !important;
    color: #6c5ce7 !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: none !important;
    transition: none !important;
}

.radio-item input[type="radio"]:checked + label {
    background: #f8fafc !important;
    border-color: #6c5ce7 !important;
    color: #6c5ce7 !important;
    box-shadow: none !important;
    transition: none !important;
}

.alert, .alert-success, .alert-error, .alert-info {
    background: #f8fafc !important;
    color: #6c5ce7 !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: none !important;
    transition: none !important;
}

/* Убираем любые плавные эффекты для всех элементов */
* {
    transition: none !important;
}

/* Убираем любые градиенты */
.card, .stat-card, .btn, .btn-primary, .btn-success, .btn-warning, .btn-info, .btn-secondary, .btn-danger {
    background-image: none !important;
}

/* Убираем любые transform */
.card, .stat-card, .btn, .board-item, .user-item, .search-result-item, .board-action-btn, .tab-button, .alert {
    transform: none !important;
}

/* Акцент только цветом границы */
.board-item.selected, .user-item.selected {
    border-color: #6c5ce7 !important;
    background: #f8fafc !important;
}

/* Исправления для проблем с hover эффектами */

/* Предотвращаем горизонтальный скролл */
.board-list,
.user-list,
.search-results {
    overflow-x: hidden !important;
}

/* Исправления для board-item */
.board-item {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
}

.board-item:hover {
    transform: none !important; /* Убираем translateX */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.board-info {
    min-width: 0 !important;
    overflow: hidden !important;
}

.board-name,
.board-meta {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.board-actions {
    flex-shrink: 0 !important;
    z-index: 2 !important;
    position: relative !important;
}

.board-action-btn {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.board-action-btn:hover {
    transform: scale(1.05) !important; /* Легкое увеличение */
}

/* Исправления для user-item */
.user-item {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
}

.user-item:hover {
    transform: none !important; /* Убираем translateX */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--border-hover) !important;
}

.user-avatar {
    flex-shrink: 0 !important;
}

.user-info {
    min-width: 0 !important;
    overflow: hidden !important;
}

.user-name,
.user-email {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.user-type-badge {
    flex-shrink: 0 !important;
}

/* Исправления для search-result-item */
.search-result-item {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
}

.search-result-item:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Исправления для анимации */
.board-item::before,
.user-item::before {
    z-index: 1 !important;
}

/* Общие исправления для контейнеров */
.board-list,
.user-list,
.search-results {
    box-sizing: border-box !important;
}

/* Исправления для flex элементов */
.board-item > *,
.user-item > *,
.search-result-item > * {
    flex-shrink: 0;
}

.board-info,
.user-info {
    flex-shrink: 1 !important;
}

/* Предотвращаем переполнение текста */
.board-name,
.board-meta,
.user-name,
.user-email {
    max-width: 100%;
}

/* Исправления для иконок */
.board-action-btn i,
.user-type-badge {
    pointer-events: none;
}

/* Дополнительные исправления для стабильности */
.board-item,
.user-item,
.search-result-item {
    contain: layout style;
}

/* Исправления для карточек пользователей в поиске */
.search-result-item .user-avatar {
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
}

.search-result-item .user-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.search-result-item .user-name,
.search-result-item .user-email {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Исправления для выборочного управления пользователями */
#users-list-container .user-item {
    position: relative !important;
}

#users-list-container .user-item input[type="checkbox"] {
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
}

/* Исправления для массовых операций */
#bulk-boards-selection .board-item {
    padding: 0.5rem !important;
}

#bulk-boards-selection .board-item input[type="checkbox"] {
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
}

/* Исправления для табов */
.tab-group {
    overflow: hidden !important;
}

.tab-button {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Исправления для статистики */
.stat-card {
    min-width: 200px !important;
    max-width: 260px !important;
    padding: 2rem 1.2rem !important;
    border-radius: 12px !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(108,92,231,0.07) !important;
    background: linear-gradient(135deg, #f8fafc 60%, #eceffd 100%) !important;
    border: 1.2px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-height: 52px !important;
    transition: box-shadow 0.18s, background 0.18s, border 0.18s !important;
    cursor: default !important;
}

.stat-card:hover {
    background: linear-gradient(135deg, #f4f6fb 60%, #e2e8f0 100%) !important;
    box-shadow: 0 4px 16px rgba(108,92,231,0.13) !important;
    border-color: #bcbcf7 !important;
    transform: translateY(-2px) scale(1.03);
}

.stat-number {
    font-size: 1.18rem !important;
    font-weight: 700 !important;
    color: #6c5ce7 !important;
    margin-bottom: 0.13rem !important;
    line-height: 1.18 !important;
    letter-spacing: 0 !important;
    background: linear-gradient(90deg, #6c5ce7 60%, #0073ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    border: none !important;
    padding: 0 !important;
}

.stat-label {
    font-size: 0.74rem !important;
    color: #a0aec0 !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: none !important;
    line-height: 1.3 !important;
}

.stats-grid {
    gap: 0.7rem !important;
    margin-bottom: 0.7rem !important;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
}

/* Исправления для форм */
.form-control {
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Исправления для кнопок */
.btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.action-group {
    justify-content: flex-start !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
    margin-top: 1.2rem !important;
    margin-bottom: 0.6rem !important;
}

/* Исправления для алертов */
.alert {
    max-width: 400px !important;
    word-wrap: break-word !important;
}

/* Исправления для мобильных устройств */
@media (max-width: 768px) {
    .board-item,
    .user-item,
    .search-result-item {
        padding: 0.5rem !important;
    }
    
    .board-name,
    .user-name {
        font-size: 0.8rem !important;
    }
    
    .board-meta,
    .user-email {
        font-size: 0.7rem !important;
    }
    
    .board-action-btn {
        width: 24px !important;
        height: 24px !important;
    }
    
    .user-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
    }
}

/* Исправления для высоких разрешений */
@media (min-width: 1920px) {
    .board-list,
    .user-list,
    .search-results {
        max-height: 400px !important;
    }
}

/* Исправления для темной темы */
@media (prefers-color-scheme: dark) {
    .board-item:hover,
    .user-item:hover,
    .search-result-item:hover {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
    }
}

/* --- Баланс структуры и сплочённости --- */

.main-grid {
    align-items: stretch !important;
    min-height: 420px !important;
    background: #f8fafc !important;
    border-radius: 18px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 2px 12px rgba(108,92,231,0.04) !important;
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: 1.2fr 2.2fr 1.2fr !important;
    column-gap: 2.5rem !important;
}

.main-grid > .card {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(108,92,231,0.06) !important;
    border: 1.5px solid #e2e8f0 !important;
    min-height: 100% !important;
    margin-bottom: 0 !important;
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.main-grid > .card .card-header,
.main-grid > .card .card-body {
    background: inherit !important;
}

/* Вертикальные разделители — светлые и тонкие */
.main-grid > .card:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2.5rem;
    right: -0.75rem;
    width: 1px;
    height: calc(100% - 5rem);
    background: linear-gradient(180deg, #eceffd 0%, #f4f6fb 100%);
    border-radius: 1px;
    z-index: 1;
}

/* Скругления только у внешних карточек чуть больше */
.main-grid > .card:first-child {
    border-radius: 14px 0 0 14px !important;
    min-width: 400px !important;
    max-width: 480px !important;
}
.main-grid > .card:last-child {
    border-radius: 0 14px 14px 0 !important;
}

@media (max-width: 900px) {
    .main-grid {
        border-radius: 12px !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0.5rem !important;
    }
    .main-grid > .card {
        border-radius: 10px !important;
    }
    .main-grid > .card:first-child {
        min-width: unset !important;
        max-width: unset !important;
    }
}

/* --- Конец баланса структуры и сплочённости --- */

.secondary-grid > .card {
    min-height: 280px !important;
    max-height: 500px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* --- Исправления для блоков "Массовые операции" и "Поиск пользователей" --- */

/* Массовые операции: не обрезать, высота по контенту */
.secondary-grid > .card:first-child, .secondary-grid > .card:first-child .card-body {
    min-height: unset !important;
    max-height: unset !important;
    height: auto !important;
    overflow-y: visible !important;
}

/* Поиск пользователей: делаем шире и увеличиваем высоту списка */
.main-grid > .card:last-child {
    min-width: 400px !important;
    max-width: 480px !important;
}

.main-grid > .card:last-child .search-results {
    max-height: 500px !important;
}

/* Исправление: Экспорт и импорт — убираем ограничения по высоте и overflow */
.secondary-grid > .card:nth-child(2), .secondary-grid > .card:nth-child(2) .card-body {
    min-height: unset !important;
    max-height: unset !important;
    height: auto !important;
    overflow: visible !important;
}

/* --- Структурированный и сплочённый дизайн --- */

/* Единый стиль карточек */
.card, .stat-card {
    background: #fff !important;
    border-radius: 16px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(108,92,231,0.04) !important;
    margin-bottom: 1.25rem !important;
    padding: 0 !important;
}

.card-header {
    background: #f8fafc !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem 1.5rem 0.75rem 1.5rem !important;
    margin-bottom: 0 !important;
}

.card-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #6c5ce7 !important;
    letter-spacing: -0.01em !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.card-subtitle {
    color: #64748b !important;
    font-size: 0.92rem !important;
    margin-bottom: 0.25rem !important;
}

.card-body {
    padding: 1.25rem 1.5rem 1.5rem 1.5rem !important;
}

/* Вертикальные разделители между колонками */
.main-grid {
    column-gap: 2rem !important;
    position: relative;
}
.main-grid > .card:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2rem;
    right: -1rem;
    width: 2px;
    height: calc(100% - 4rem);
    background: linear-gradient(180deg, #e2e8f0 0%, #f4f6fb 100%);
    border-radius: 2px;
    z-index: 1;
}

.secondary-grid {
    column-gap: 2rem !important;
    position: relative;
}
.secondary-grid > .card:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2rem;
    right: -1rem;
    width: 2px;
    height: calc(100% - 4rem);
    background: linear-gradient(180deg, #e2e8f0 0%, #f4f6fb 100%);
    border-radius: 2px;
    z-index: 1;
}

/* Плотная сетка, меньше внешних отступов */
.main-grid > .card, .secondary-grid > .card {
    margin-bottom: 0 !important;
}

/* Усиливаем визуальные связи между модулями */
.card, .stat-card, .card-header, .card-title, .action-group {
    box-shadow: none !important;
}

/* Единый hover для карточек */
.card:hover, .stat-card:hover {
    border-color: #6c5ce7 !important;
    background: #f8fafc !important;
}

/* Убираем лишние внешние отступы у .section-divider */
.section-divider {
    margin: 1.5rem 0 !important;
}

/* --- Конец структурных правок --- */

.container {
    max-width: 1700px !important;
}

.board-list {
    max-height: 420px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 4px !important;
}

/* Стилизация скроллбара для .board-list */
.board-list::-webkit-scrollbar {
    width: 8px;
    background: #f8fafc;
}
.board-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 6px;
} 