/**
 * 📊 Стили для системы отчетов Zolla Roadmap
 * 
 * Красивые, современные стили в стиле проекта с анимациями и эффектами
 */

/* ==================== ОСНОВНЫЕ СТИЛИ ==================== */

.reports-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    backdrop-filter: blur(8px);
    z-index: 99999 !important; /* Максимальный z-index */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    pointer-events: none !important; /* Не блокируем клики когда скрыто */
}

.reports-modal.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important; /* Включаем клики когда видно */
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.reports-modal .modal-content {
    max-width: 1200px;
    width: 95vw;
    max-height: 85vh; /* Уменьшено для лучшей адаптивности */
    min-height: 500px; /* Минимальная высота */
    height: auto;
    background: linear-gradient(135deg, 
        rgba(13, 14, 17, 0.95) 0%, 
        rgba(26, 27, 32, 0.95) 100%);
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 212, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Обеспечиваем правильную структуру */
    backdrop-filter: blur(20px);
}

/* ==================== ЗАГОЛОВОК ==================== */

.reports-header {
    background: linear-gradient(90deg, 
        rgba(26, 27, 32, 0.9) 0%, 
        rgba(42, 45, 53, 0.9) 100%);
    border-bottom: 2px solid rgba(0, 212, 255, 0.4);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(15px);
}

.reports-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #e1e5eb;
    font-size: 24px;
    font-weight: 600;
}

.reports-icon {
    font-size: 28px;
    animation: reportsPulse 2s ease-in-out infinite;
}

@keyframes reportsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.btn-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e1e5eb;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-close:hover {
    background: rgba(255, 68, 68, 0.25);
    border-color: #ff4444;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.close-icon {
    font-size: 18px;
    font-weight: bold;
}

/* ==================== ТЕЛО ОТЧЕТОВ ==================== */

.reports-body {
    padding: 30px;
    flex: 1; /* Занимает оставшееся место в flex контейнере */
    overflow-y: auto;
    min-height: 0; /* Позволяет flex сжаться при необходимости */
}

/* ==================== ВЫБОР ТИПА ОТЧЕТОВ ==================== */

.reports-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.report-type-card {
    background: linear-gradient(135deg, #1a1b20 0%, #2a2d35 100%);
    border: 2px solid #3a3f4a;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.report-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.report-type-card:hover::before {
    left: 100%;
}

.report-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: #00d4ff;
}

.report-type-card.active {
    border-color: #00d4ff;
    background: linear-gradient(135deg, #003d4d 0%, #004d5c 100%);
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.system-card.active {
    border-color: #00d4ff;
    background: linear-gradient(135deg, #003d4d 0%, #004d5c 100%);
}

.data-card.active {
    border-color: #00cc88;
    background: linear-gradient(135deg, #003d2a 0%, #004d33 100%);
}

.card-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
    animation: cardIconFloat 3s ease-in-out infinite;
}

@keyframes cardIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.report-type-card h3 {
    color: #e1e5eb;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-align: center;
}

.report-type-card p {
    color: #b8bcc5;
    font-size: 14px;
    text-align: center;
    margin: 0 0 16px 0;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

/* ==================== СИСТЕМНЫЕ ОТЧЕТЫ ==================== */

.system-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.metric-card {
    background: linear-gradient(135deg, #1a1b20 0%, #2a2d35 100%);
    border: 1px solid #3a3f4a;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: metricCardSlideIn 0.6s ease-out;
}

@keyframes metricCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card:hover {
    border-color: #00d4ff77;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.performance-card:hover {
    border-color: #00d4ff77;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.fps-card:hover {
    border-color: #00cc8877;
    box-shadow: 0 0 15px rgba(0, 204, 136, 0.2);
}

.errors-card:hover {
    border-color: #ff444477;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

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

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

.metric-icon {
    font-size: 18px;
}

.metric-controls {
    display: flex;
    gap: 8px;
}

.metric-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.metric-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

/* ==================== ГРАФИКИ ==================== */

.metric-charts {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
}

.metric-charts canvas {
    width: 100%;
    height: 120px;
    border-radius: 6px;
}

/* ==================== СТАТИСТИКА ==================== */

.metric-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid #3a3f4a;
}

.stat-item label {
    color: #9ca3af;
    font-size: 12px;
}

.stat-value {
    color: #e1e5eb;
    font-weight: 600;
    font-size: 14px;
}

.stat-value.high {
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.stat-value.medium {
    color: #ffaa00;
}

.stat-value.low {
    color: #ff4444;
}

.fps-value.high {
    color: #00cc88;
}

.fps-value.medium {
    color: #ffaa00;
}

.fps-value.low {
    color: #ff4444;
}

/* ==================== ОШИБКИ ==================== */

.errors-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-errors {
    text-align: center;
    padding: 30px 20px;
    color: #9ca3af;
}

.no-errors-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.error-item {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    animation: errorSlideIn 0.4s ease-out;
}

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

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

.error-type {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 12px;
}

.error-time {
    color: #9ca3af;
    font-size: 11px;
}

.error-message {
    color: #e1e5eb;
    font-size: 13px;
    margin-bottom: 4px;
}

.error-source {
    color: #9ca3af;
    font-size: 11px;
    font-family: monospace;
}

/* ==================== CANVAS СТАТИСТИКА ==================== */

.canvas-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #9ca3af;
    font-size: 13px;
}

.virtualization-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-top: 8px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background: #00cc88;
    box-shadow: 0 0 12px rgba(0, 204, 136, 0.6);
    animation: indicatorPulse 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.virtualization-indicator span:last-child {
    color: #e1e5eb;
    font-size: 13px;
}

.virtualization-indicator.active span:last-child {
    color: #00cc88;
}

/* ==================== ОТЧЕТЫ ПО ДАННЫМ ==================== */

.data-metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.data-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 4px solid #00d4ff;
    transition: all 0.3s ease;
}

.overview-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.packages-overview {
    border-left-color: #00cc88;
}

.connections-overview {
    border-left-color: #ffaa00;
}

.overview-icon {
    font-size: 24px;
    opacity: 0.8;
}

.overview-number {
    font-size: 24px;
    font-weight: 700;
    color: #e1e5eb;
    margin-bottom: 4px;
}

.overview-label {
    color: #9ca3af;
    font-size: 12px;
}

.counter-animate {
    animation: counterBounce 0.5s ease-out;
}

@keyframes counterBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==================== ТОП БАЗ ДАННЫХ ==================== */

.top-databases-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding: 16px;
}

.top-db-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #00d4ff;
    transition: all 0.3s ease;
    animation: topDbSlideIn 0.5s ease-out;
}

@keyframes topDbSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.top-db-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(4px);
}

.db-rank {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.db-info {
    flex: 1;
}

.db-name {
    color: #e1e5eb;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.db-connections {
    color: #9ca3af;
    font-size: 12px;
}

.db-icon {
    font-size: 20px;
    opacity: 0.7;
}

/* ==================== ЗАГРУЗКА И ПУСТЫЕ СОСТОЯНИЯ ==================== */

.loading-placeholder,
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #9ca3af;
    text-align: center;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #3a3f4a;
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.no-data-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ==================== ФУТЕР ==================== */

.reports-footer {
    background: linear-gradient(90deg, #1a1b20 0%, #2a2d35 100%);
    border-top: 1px solid #3a3f4a;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0; /* Не сжимается при недостатке места */
    min-height: 70px; /* Минимальная высота footer */
}

.footer-info {
    color: #9ca3af;
    font-size: 12px;
}

.footer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px; /* Уменьшены отступы */
    border-radius: 8px;
    font-size: 13px; /* Уменьшен размер шрифта */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    min-width: 100px; /* Минимальная ширина */
    justify-content: center;
}

.btn-secondary {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0099cc, #007aa3);
    border-color: rgba(0, 212, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 212, 255, 0.3),
        0 0 15px rgba(0, 212, 255, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00b8e6, #0088bb);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
}

/* ==================== КНОПКА В МЕНЮ ==================== */

.reports-menu-item {
    position: relative;
    overflow: hidden;
}

.reports-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.reports-menu-item:hover::before {
    left: 100%;
}

.reports-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff5722);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ==================== АДАПТИВНОСТЬ ==================== */

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .reports-modal .modal-content {
        width: 98vw;
        max-height: 98vh;
        margin: 1vh 1vw;
    }
    
    .reports-footer {
        padding: 10px 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .footer-actions .btn {
        width: 100%;
        margin-bottom: 8px;
        padding: 10px 16px; /* Немного меньше отступы */
        font-size: 13px; /* Немного меньше шрифт */
    }
    
    .footer-info {
        font-size: 11px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .reports-modal .modal-content {
        width: 95vw;
        max-height: 95vh;
        margin: 10px;
    }
    
    .reports-type-selector {
        grid-template-columns: 1fr;
    }
    
    .system-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .data-overview {
        grid-template-columns: 1fr;
    }
    
    .reports-header {
        padding: 16px 20px;
    }
    
    .reports-body {
        padding: 20px;
    }
    
    .reports-footer {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .footer-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-actions .btn {
        min-width: 110px; /* Компактнее для планшетов */
        font-size: 13px;
        padding: 8px 14px; /* Немного меньше отступы */
    }
}

/* ==================== СКРОЛЛБАРЫ ==================== */

.reports-body::-webkit-scrollbar,
.errors-list::-webkit-scrollbar,
.top-databases-list::-webkit-scrollbar {
    width: 6px;
}

.reports-body::-webkit-scrollbar-track,
.errors-list::-webkit-scrollbar-track,
.top-databases-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.reports-body::-webkit-scrollbar-thumb,
.errors-list::-webkit-scrollbar-thumb,
.top-databases-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.reports-body::-webkit-scrollbar-thumb:hover,
.errors-list::-webkit-scrollbar-thumb:hover,
.top-databases-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* ==================== НОВЫЕ РАЗДЕЛЫ ОТЧЕТОВ ==================== */

/* Анализ дорожной карты */
.roadmap-analysis-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

.analysis-metric {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.analysis-metric:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

.analysis-metric .metric-label {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-metric .metric-value {
    color: #00d4ff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Статистика пользователей */
.user-statistics-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 16px;
}

.user-metric {
    background: rgba(255, 107, 107, 0.05);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.user-metric:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.user-metric .metric-label {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-metric .metric-value {
    color: #ff6b6b;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* ==================== СТИЛИ ДЛЯ ТОП СВЯЗАННЫХ БД (ОБНОВЛЕННЫЕ) ==================== */

.top-connection-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(0, 153, 204, 0.02));
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
}

.top-connection-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.08), transparent);
    transition: left 0.6s ease;
}

.top-connection-item:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(0, 153, 204, 0.08));
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 212, 255, 0.2),
        0 0 15px rgba(0, 212, 255, 0.1);
}

.top-connection-item:hover::before {
    left: 100%;
}

.connection-rank {
    font-weight: 700;
    color: #00d4ff;
    font-size: 20px;
    min-width: 30px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.connection-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 153, 204, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.connection-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.icon-fallback {
    font-size: 20px;
    color: #00d4ff;
}

.connection-info {
    flex: 1;
    min-width: 0; /* Для правильного переноса текста */
}

.connection-name {
    color: #e1e5eb;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connection-count {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

.connection-bar {
    width: 80px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.connection-progress {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    border-radius: 4px;
    transition: width 0.8s ease;
    position: relative;
}

.connection-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Особые стили для топ-1 элемента */
.top-connection-item.top-item {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 193, 7, 0.05));
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.2),
        0 0 20px rgba(255, 215, 0, 0.1);
}

.top-connection-item.top-item:hover {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.3),
        0 0 25px rgba(255, 215, 0, 0.2);
}

.connection-rank.rank-top {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
    font-weight: 800;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.connection-progress.progress-top {
    background: linear-gradient(90deg, #ffd700, #ffb700);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.connection-bar {
    position: relative;
}

.progress-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #e1e5eb;
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== КЛИКАБЕЛЬНЫЕ МЕТРИКИ ==================== */

.clickable-metric {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.clickable-metric:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.metric-hint {
    color: #9ca3af;
    font-size: 10px;
    text-align: center;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clickable-metric:hover .metric-hint {
    opacity: 1;
}

/* ==================== МОДАЛЬНОЕ ОКНО ПОЛЬЗОВАТЕЛЕЙ ==================== */

.users-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(12px);
    z-index: 100000 !important; /* Выше основного модального окна отчетов */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s ease !important;
    pointer-events: none !important;
}

.users-modal.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.users-modal-content {
    max-width: 700px;
    width: 90vw;
    max-height: 80vh;
    background: linear-gradient(135deg, #0d0e11 0%, #1a1b20 100%);
    border: 1px solid #ff6b6b33;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(255, 107, 107, 0.2);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.users-modal.visible .users-modal-content {
    transform: scale(1);
}

/* Header модального окна */
.users-modal-header {
    background: linear-gradient(90deg, #1a1b20 0%, #2a2d35 100%);
    border-bottom: 1px solid #ff6b6b33;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.users-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #e1e5eb;
    font-size: 22px;
    font-weight: 600;
}

.users-modal-icon {
    font-size: 26px;
    color: #ff6b6b;
}

.users-modal-close {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.users-modal-close:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.6);
    transform: rotate(90deg);
}

/* Body модального окна */
.users-modal-body {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    min-height: 0;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(255, 87, 34, 0.02));
    border: 1px solid rgba(255, 107, 107, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.user-item:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 87, 34, 0.05));
    border-color: rgba(255, 107, 107, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.2);
}

.user-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ff5722);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.user-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #1a1b20;
}

.user-status.active {
    background: #22c55e;
}

.user-status.inactive {
    background: #6b7280;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: #e1e5eb;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.user-role {
    color: #ff6b6b;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.user-login-date {
    color: #9ca3af;
    font-size: 11px;
}

.user-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.user-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.user-badge.inactive {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Footer модального окна */
.users-modal-footer {
    background: linear-gradient(90deg, #1a1b20 0%, #2a2d35 100%);
    border-top: 1px solid #ff6b6b33;
    padding: 16px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.users-footer-info {
    color: #9ca3af;
    font-size: 13px;
}

.users-footer-actions .btn {
    background: linear-gradient(135deg, #ff6b6b, #ff5722);
    color: white;
    border: 1px solid rgba(255, 107, 107, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.users-footer-actions .btn:hover {
    background: linear-gradient(135deg, #ff5722, #e64a19);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transform: translateY(-1px);
}

/* Сообщение об отсутствии пользователей */
.no-users-message {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.no-users-message .icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

/* Дополнительные стили для модального окна пользователей */
.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    text-shadow: none;
}

.user-login-date small {
    color: #9ca3af;
    font-size: 10px;
}

/* Стили для отладочных сообщений (убираем позже) */
.no-data-message {
    text-align: center;
    padding: 30px 20px;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.no-data-message .icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.6;
}

.no-data-message .subtitle {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* ==================== ДОПОЛНИТЕЛЬНАЯ АДАПТИВНОСТЬ ==================== */

/* Для больших экранов */
@media (min-width: 1400px) {
    .reports-modal .modal-content {
        max-width: 1400px;
    }
    
    .reports-footer {
        padding: 20px 40px;
    }
    
    .footer-actions .btn {
        padding: 10px 18px; /* Умеренные отступы для больших экранов */
        font-size: 14px; /* Нормальный размер шрифта */
        min-width: 120px; /* Умеренная минимальная ширина */
    }
    
    .btn-icon {
        font-size: 18px;
    }
}

/* Адаптация под ширину контента */
@media (max-width: 1024px) {
    .footer-actions {
        justify-content: center;
    }
    
    .footer-actions .btn {
        flex: 1;
        max-width: 200px;
    }
}
