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

:root {
    --primary: #1e3a5f;
    --primary-light: #2d5986;
    --accent: #b91c1c;
    --accent-bg: #fef2f2;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 40px 0 36px;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    color: rgba(255, 255, 255, 0.75);
    margin-top: 6px;
    font-size: 1rem;
}

.updated {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    margin-top: 12px;
}

/* Main */
main {
    flex: 1;
    padding: 36px 0 56px;
}

/* Section */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    max-width: 720px;
}

/* Week filter */
.week-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.week-filter label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.week-filter select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    cursor: pointer;
    min-width: 220px;
}

.week-filter select:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 1px;
}

.period-label {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: auto;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card--accent {
    background: var(--accent-bg);
    border-left: 4px solid var(--accent);
}

.card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.card--accent .card-value {
    color: var(--accent);
}

.card-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-hint {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    margin-top: 2px;
}

.card--warn {
    border-left: 4px solid #d97706;
    background: #fffbeb;
}

.card--warn .card-value {
    color: #b45309;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.step {
    text-align: center;
    padding: 20px 12px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.step strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text);
}

.step p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

.stats-block {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.stats-block h2 {
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: var(--primary);
    font-weight: 700;
}

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

.stats-table th,
.stats-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.stats-table th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-table td small {
    display: block;
    color: var(--text-light);
    font-size: 0.75rem;
    margin-top: 2px;
}

.stats-table td:last-child,
.stats-table th:last-child {
    text-align: right;
    font-weight: 600;
}

.stats-table tbody tr:hover {
    background: var(--border-light);
}

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

.no-data {
    color: var(--text-light);
    text-align: center;
    padding: 32px 16px;
    font-size: 0.9rem;
}

/* Recent table */
.table-wrap {
    overflow-x: auto;
}

.recent-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.recent-table th,
.recent-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.recent-table th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--border-light);
}

.recent-table td.center {
    text-align: center;
    font-weight: 700;
    color: var(--accent);
}

.recent-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.recent-table tbody tr:hover {
    background: #f0f4f8;
}

.recent-table a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.recent-table a:hover {
    text-decoration: underline;
}

/* Criteria accordion */
.criteria-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.criteria {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.criteria summary {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    transition: background 0.15s;
}

.criteria summary::-webkit-details-marker {
    display: none;
}

.criteria summary::after {
    content: "+";
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-light);
    transition: transform 0.2s;
}

.criteria[open] summary::after {
    content: "-";
}

.criteria summary:hover {
    background: var(--border-light);
}

.criteria-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.criteria p {
    padding: 0 20px 16px 60px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Download */
.download-section {
    text-align: center;
    padding: 32px 0 0;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 14px 36px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.btn:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.download-hint {
    color: var(--text-light);
    font-size: 0.82rem;
    margin-top: 10px;
}

/* Footer */
footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.55);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    header h1 {
        font-size: 1.4rem;
    }
}

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

    .steps {
        grid-template-columns: 1fr;
    }

    .criteria p {
        padding-left: 20px;
    }
}
