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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.logs-link {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.logs-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.filters {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn .icon {
    font-size: 1.2rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.toggle-icon {
    font-size: 1.3rem;
}

.toggle-text {
    font-size: 1rem;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.error {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
    color: #991b1b;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.error-icon {
    font-size: 1.5rem;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.no-data-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

.no-data p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.table-container {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-table th {
    padding: 18px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background-color: #f1f5f9;
}

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

.stats-table td {
    padding: 18px;
    font-size: 0.95rem;
}

.stats-table td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    width: 60px;
}

.stats-table td:nth-child(2) {
    font-weight: 600;
    color: var(--text-primary);
}

.stats-table td:nth-child(3) {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.percent-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    max-width: 200px;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

@media (max-width: 768px) {
    header {
        padding-top: 50px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .logs-link {
        top: -40px;
        right: 0;
        left: 0;
        margin: 0 auto;
        width: fit-content;
    }

    .filters {
        flex-direction: column;
    }

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

    .toggle-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .toggle-text {
        font-size: 0.9rem;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    .stats-table {
        font-size: 0.85rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 12px 8px;
    }

    .progress-bar {
        max-width: 100px;
    }
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-table tbody tr {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.stats-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.stats-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.stats-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.stats-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.stats-table tbody tr:nth-child(5) { animation-delay: 0.5s; }
.stats-table tbody tr:nth-child(n+6) { animation-delay: 0.6s; }

/* Информационная панель */
.info-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.info-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-list li strong {
    color: var(--text-primary);
}

