:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #e6ebff;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --dark: #1a1a2e;
    --gray-900: #0f172a;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --white: #ffffff;
    --header-height: 73px; /* Высота header из includes/header.php */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-700);
    line-height: 1.6;
    pointer-events: auto; /* Разрешаем клики */
}

/* ===== КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ HEADER ===== */
/* Полностью переопределяем header для страницы аудита */
.header {
    position: fixed !important; /* Меняем на fixed вместо sticky */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important; /* Максимальный z-index */
    background: var(--white) !important;
    pointer-events: auto !important;
    width: 100% !important;
}

/* Все элементы header ОБЯЗАТЕЛЬНО кликабельны */
.header,
.header *,
.header a,
.header .container,
.header .header-content,
.header .nav,
.header .nav-link,
.header .btn,
.header .logo {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: inherit !important;
}

/* Убираем любые overlay которые могут блокировать */
.header::before,
.header::after {
    display: none !important;
}

/* Контейнер аудита - учитываем FIXED header */
.audit-container {
    display: flex;
    min-height: 100vh;
    margin-top: var(--header-height); /* Отступ для fixed header */
    position: relative;
    z-index: 1; /* Намного ниже чем header (9999) */
}

/* Sidebar Navigation - ИСПРАВЛЕНО для fixed header */
.audit-sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    left: 0;
    top: var(--header-height); /* Начинается после fixed header */
    bottom: 0;
    overflow-y: auto;
    z-index: 100; /* НАМНОГО меньше чем у header (9999) */
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

/* Скроллбар для sidebar */
.audit-sidebar::-webkit-scrollbar {
    width: 6px;
}

.audit-sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.audit-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.audit-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.3s;
}

.sidebar-logo:hover {
    color: var(--primary);
}

.sidebar-logo i {
    color: var(--primary);
    font-size: 24px;
}

.site-info {
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 8px;
}

.site-domain {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-all;
}

.site-date {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 0 20px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger);
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    position: sticky;
    bottom: 0;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

/* Main Content - ИСПРАВЛЕНО */
.audit-main {
    margin-left: 280px;
    flex: 1;
    padding: 40px;
    min-height: calc(100vh - var(--header-height));
}

.audit-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 48px;
    border-radius: 16px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.audit-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.audit-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.audit-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.audit-meta {
    display: flex;
    gap: 32px;
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.audit-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-primary { background: var(--primary-light); color: var(--primary); }
.icon-danger { background: #fee2e2; color: var(--danger); }
.icon-warning { background: #fef3c7; color: #d97706; }
.icon-success { background: #d1fae5; color: #059669; }

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 8px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.change-positive { color: var(--success); }
.change-negative { color: var(--danger); }

/* Section */
.audit-section {
    margin-bottom: 40px;
    scroll-margin-top: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--primary);
}

.section-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* Card */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-200);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

/* Company Info */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: 12px;
    transition: all 0.3s;
}

.info-item:hover {
    background: var(--primary-light);
}

.info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.info-content h4 {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-content p {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
    word-break: break-word;
}

/* Issues */
.issues-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.issue-summary-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}

.issue-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.summary-high { background: #fee2e2; }
.summary-medium { background: #fef3c7; }
.summary-low { background: #d1fae5; }

.summary-count {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}

.count-high { color: var(--danger); }
.count-medium { color: #d97706; }
.count-low { color: #059669; }

.summary-label {
    font-size: 14px;
    font-weight: 600;
}

.label-high { color: #991b1b; }
.label-medium { color: #92400e; }
.label-low { color: #065f46; }

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.issue-item {
    padding: 20px;
    background: var(--gray-100);
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.2s;
}

.issue-item:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateX(4px);
}

.issue-high { border-left-color: var(--danger); }
.issue-medium { border-left-color: #d97706; }
.issue-low { border-left-color: #059669; }

.issue-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.issue-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
    flex: 1;
}

.issue-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.issue-desc {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.issue-page {
    font-size: 12px;
    color: var(--gray-500);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Keywords */
.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.keywords-card {
    background: var(--gray-100);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
}

.keywords-card:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.keywords-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyword-count {
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
}

.keyword-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--white);
    border-radius: 8px;
    transition: all 0.2s;
}

.keyword-item:hover {
    background: var(--primary-light);
}

.keyword-text {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.keyword-freq {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-100);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--gray-100);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.url-cell {
    max-width: 400px;
    word-break: break-all;
    color: var(--primary);
}

/* Version Switcher */
.version-switcher {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.version-switcher-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-switcher-header i {
    color: var(--primary);
}

.version-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.version-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.3s ease;
}

.version-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.version-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

.version-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.version-date i {
    color: var(--primary);
    font-size: 12px;
}

.version-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--gray-500);
}

.version-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.version-stats i {
    font-size: 10px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1001;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

/* Overlay для мобильного меню */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .audit-sidebar {
        width: 260px;
    }
    
    .audit-main {
        margin-left: 260px;
    }
    
    .stats-grid,
    .info-grid,
    .keywords-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .audit-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 1002;
    }
    
    .audit-sidebar.open {
        transform: translateX(0);
    }
    
    .audit-main {
        margin-left: 0;
        padding: 20px;
    }
    
    .audit-header {
        padding: 32px 24px;
    }
    
    .audit-title {
        font-size: 28px;
    }
    
    .audit-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .stats-grid,
    .info-grid,
    .keywords-grid,
    .issues-summary {
        grid-template-columns: 1fr;
    }
    
    .version-switcher {
        padding: 12px 16px;
    }
    
    .version-item {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .audit-main {
        padding: 16px;
    }
    
    .audit-header {
        padding: 24px 20px;
    }
    
    .audit-title {
        font-size: 24px;
    }
    
    .card {
        padding: 20px;
    }
    
    .stat-card {
        padding: 20px;
    }
}

/* Печать */
@media print {
    .audit-sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay {
        display: none !important;
    }
    
    .audit-main {
        margin-left: 0 !important;
    }
    
    .audit-container {
        margin-top: 0 !important;
    }
}


/* ===== KEYWORDS SECTION ===== */
.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.keywords-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
}

.keywords-card .card-header {
    padding: 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.keywords-card .card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.keyword-count {
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.keyword-list {
    padding: 20px;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.keyword-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.keyword-text {
    font-weight: 500;
    color: var(--gray-700);
}

.keyword-freq {
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* ===== ISSUES SECTION - УЛУЧШЕННАЯ ВЕРСИЯ ===== */

/* Сводка проблем */
.issues-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
}

.issue-summary-card {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.issue-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.summary-high {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.summary-medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.summary-low {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.summary-count {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
}

.count-high {
    color: #dc2626;
}

.count-medium {
    color: #d97706;
}

.count-low {
    color: #059669;
}

.summary-label {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-high {
    color: #991b1b;
}

.label-medium {
    color: #92400e;
}

.label-low {
    color: #065f46;
}

.summary-desc {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.4;
}

/* Группированные проблемы */
.issue-group-card {
    margin-bottom: 20px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
}

.issue-group-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.15);
}

.issue-group-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    cursor: pointer;
    background: var(--white);
    transition: background 0.3s ease;
}

.issue-group-header:hover {
    background: var(--gray-50);
}

.issue-group-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.issue-high {
    background: linear-gradient(135deg, #ef476f 0%, #dc2626 100%);
    color: var(--white);
}

.issue-medium {
    background: linear-gradient(135deg, #ffd166 0%, #d97706 100%);
    color: var(--white);
}

.issue-low {
    background: linear-gradient(135deg, #06d6a0 0%, #059669 100%);
    color: var(--white);
}

.issue-group-info {
    flex: 1;
    min-width: 0;
}

.issue-group-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.issue-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-high {
    background: #fee2e2;
    color: #991b1b;
}

.badge-medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-low {
    background: #d1fae5;
    color: #065f46;
}

.issue-group-meta {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--gray-600);
    flex-wrap: wrap;
}

.issue-group-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.issue-group-meta i {
    color: var(--primary);
}

.issue-group-meta strong {
    color: var(--dark);
    font-weight: 600;
}

.issue-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 18px;
    color: var(--gray-600);
}

.issue-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

/* Детали проблемы */
.issue-details {
    padding: 0 24px 24px;
    border-top: 2px solid var(--gray-100);
    background: var(--gray-50);
}

.issue-explanation,
.issue-solution {
    margin: 20px 0;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid;
}

.issue-explanation {
    background: #e6f7ff;
    border-left-color: #1890ff;
}

.issue-solution {
    background: #f6ffed;
    border-left-color: #52c41a;
}

.issue-explanation h4,
.issue-solution h4,
.issue-pages-list h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.issue-explanation h4 i {
    color: #1890ff;
}

.issue-solution h4 i {
    color: #52c41a;
}

.issue-explanation p,
.issue-solution p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-700);
    white-space: pre-line;
}

.issue-pages-list {
    margin-top: 24px;
}

.issue-pages-list h4 i {
    color: var(--primary);
}

.issue-pages-list ul {
    list-style: none;
    padding: 0;
    margin-top: 16px;
}

.issue-pages-list li {
    padding: 16px;
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.issue-pages-list li:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateX(4px);
}

.issue-pages-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.issue-pages-list a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.issue-pages-list a i {
    font-size: 12px;
    opacity: 0.7;
}

.page-url {
    font-size: 12px;
    color: var(--gray-500);
    word-break: break-all;
    padding-left: 22px;
}

.more-pages {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    padding: 12px;
    background: var(--gray-100);
}

/* ===== RECOMMENDATIONS SECTION ===== */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.recommendation-item {
    display: flex;
    gap: 20px;
    padding: 24px;
    border-radius: 12px;
    border-left: 5px solid;
    transition: all 0.3s ease;
    background: var(--white);
}

.recommendation-item:hover {
    transform: translateX(6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.priority-high {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #dc2626;
}

.priority-medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #d97706;
}

.priority-low {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #2563eb;
}

.recommendation-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.priority-high .recommendation-icon {
    background: linear-gradient(135deg, #ef476f 0%, #dc2626 100%);
    color: var(--white);
}

.priority-medium .recommendation-icon {
    background: linear-gradient(135deg, #ffd166 0%, #d97706 100%);
    color: var(--white);
}

.priority-low .recommendation-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.recommendation-desc {
    font-size: 15px;
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 16px;
}

.recommendation-action {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 71, 111, 0.3);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===== TABLE IMPROVEMENTS ===== */
.images-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.images-with-alt {
    color: var(--success);
    font-weight: 700;
}

.images-total {
    color: var(--gray-600);
    font-weight: 600;
}

.url-cell a {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.url-cell a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.url-cell i {
    font-size: 11px;
    opacity: 0.7;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .keywords-grid {
        grid-template-columns: 1fr;
    }
    
    .issues-summary {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .issue-group-header {
        flex-direction: column;
        padding: 20px;
    }
    
    .issue-group-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .issue-details {
        padding: 0 20px 20px;
    }
    
    .recommendation-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .recommendation-action {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .issue-group-header {
        padding: 16px;
    }
    
    .issue-group-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .issue-group-title {
        font-size: 16px;
    }
    
    .issue-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .recommendation-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .recommendation-title {
        font-size: 18px;
    }
}


/* ===== AUTH PROMPT ===== */
.auth-prompt {
    padding: 24px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin: 20px;
    text-align: center;
    color: var(--white);
}

.auth-prompt-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.auth-prompt-content h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--white);
}

.auth-prompt-content p {
    font-size: 14px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.auth-prompt .btn {
    background: var(--white);
    color: var(--primary);
    font-weight: 600;
}

.auth-prompt .btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* ===== MOBILE MENU ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
    z-index: 9998; /* Ниже header (9999) но выше всего остального */
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .audit-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .audit-sidebar.open {
        transform: translateX(0);
    }
    
    .audit-main {
        margin-left: 0;
        padding: 24px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .audit-header {
        padding: 32px 24px;
    }
    
    .audit-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .audit-container {
        padding-top: calc(var(--header-height) + 70px); /* Учитываем кнопку меню */
    }
    
    .audit-main {
        padding: 20px 16px;
    }
    
    .audit-header {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .audit-title {
        font-size: 24px;
    }
    
    .audit-subtitle {
        font-size: 14px;
    }
    
    .audit-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 48px;
        height: 48px;
        font-size: 20px;
        top: calc(var(--header-height) + 16px);
        right: 16px;
    }
    
    .audit-main {
        padding: 16px 12px;
    }
    
    .audit-header {
        padding: 20px 16px;
    }
    
    .audit-title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 18px;
    }
}


 
