:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --accent: #0066FF;
    --accent-light: #3385FF;
    --accent-bg: #e6f0ff;
    --accent-border: #99c2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --pink: #ec4899;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Questrial', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 24px 32px;
    font-size: 15px;
}

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

/* Site Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.site-header .logo {
    height: 36px;
    width: auto;
}

.site-header .header-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.site-header .header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.site-header .header-nav a:hover {
    color: var(--accent);
}

/* Report Badge */
.report-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
}

.report-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

/* Report Title Box */
.report-title-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0;
    padding: 24px 32px;
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
    border: 1px solid #cce0ff;
    border-left: 4px solid #0066FF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,102,255,0.08);
}

.report-title {
    margin: 0;
    font-family: 'DM Serif Display', serif;
    font-size: 38px;
    letter-spacing: -0.5px;
    color: #1e293b;
}

.report-logo {
    height: 48px;
}

/* Page Meta */
.page-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.page-meta svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
}

.page-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

@media (max-width: 1000px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.kpi-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
}

.kpi-card.highlight {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 1px var(--accent-light);
}

.kpi-card.success {
    border-color: var(--success);
    background: linear-gradient(135deg, #ffffff, #ecfdf5);
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.kpi-sublabel {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Summary Card */
.summary-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 16px;
}

.summary-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.summary-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Two Column Cards */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

@media (max-width: 800px) {
    .two-col-grid { grid-template-columns: 1fr; }
}

.driver-card, .challenge-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.driver-card { border-left: 4px solid var(--success); }
.challenge-card { border-left: 4px solid var(--danger); }

.card-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon.green { background: var(--success-light); color: var(--success); }
.card-icon.red { background: var(--danger-light); color: var(--danger); }
.card-icon svg { width: 20px; height: 20px; }

.card-header-row h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.bullet-list { list-style: none; }

.bullet-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.driver-card .bullet-list li::before { background: var(--success); }
.challenge-card .bullet-list li::before { background: var(--danger); }

/* Insights Card */
.insights-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
}

.insights-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.insights-header svg { width: 20px; height: 20px; color: var(--accent); }
.insights-header h3 { font-size: 15px; font-weight: 600; color: var(--accent); }

.insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

.insight-box {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
}

.insight-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: linear-gradient(135deg, #e6f0ff 0%, #f8fafc 100%);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #99c2ff;
    margin-bottom: 16px;
    overflow-x: auto;
}

.nav-tab {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Questrial', sans-serif;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: var(--bg-primary);
    white-space: nowrap;
}

.nav-tab:hover { color: var(--accent); background: var(--bg-primary); border-color: var(--accent); }
.nav-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Chart Section */
.chart-section {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.chart-title-bar {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title-bar h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-body {
    display: grid;
    grid-template-columns: 380px 1fr;
}

@media (max-width: 900px) {
    .chart-body { grid-template-columns: 1fr; }
}

.chart-insights-panel {
    padding: 28px;
    border-right: 1px solid var(--border);
    background: var(--bg-primary);
}

@media (max-width: 900px) {
    .chart-insights-panel { border-right: none; border-bottom: 1px solid var(--border); }
}

.chart-insights-panel h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 20px;
}

.insight-text { margin-bottom: 16px; }
.insight-text p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.insight-text strong { color: var(--text-primary); font-weight: 600; }

.chart-canvas-area { padding: 28px; }
.chart-wrapper { position: relative; width: 100%; height: 320px; }

.chart-legend {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

.chart-source {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    font-size: 13px;
}

.chart-body .chart-source { grid-column: 1 / -1; }
.chart-source .source-text { color: #94a3b8; }

.get-data {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.get-data:hover { color: var(--accent-light); }
.get-data svg { width: 14px; height: 14px; }

/* Chart Panel States */
.chart-panel { display: none; }
.chart-panel.active { display: block; }

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-secondary); }

/* Navigation Cards */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

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

.nav-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    gap: 16px;
}

.nav-card:hover {
    border-color: var(--accent-border);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.08);
}

.nav-card .num {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.4;
}

.nav-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.nav-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Disclaimer */
.disclaimer {
    margin-top: 0;
    padding: 16px 20px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

.disclaimer strong {
    color: #78350f;
}

/* Report Footer */
.report-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links { display: flex; gap: 24px; }

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

/* Alert Box */
.alert-box {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert-box.warning {
    background: linear-gradient(90deg, #fef3c7, #fef9c3);
    border-left: 4px solid #f59e0b;
}

.alert-box.info {
    background: linear-gradient(90deg, #e6f0ff, #f0f7ff);
    border-left: 4px solid #0066FF;
}

.alert-box.success {
    background: linear-gradient(90deg, #d1fae5, #ecfdf5);
    border-left: 4px solid #10b981;
}

.alert-box h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.alert-box p { font-size: 13px; line-height: 1.6; }

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 16px;
        font-size: 14px;
    }

    .report-title-box {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
        text-align: center;
    }

    .report-title {
        font-size: 26px;
        order: 2;
    }

    .report-logo {
        height: 40px;
        order: 1;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .kpi-card {
        padding: 16px 12px;
    }

    .kpi-value {
        font-size: 22px !important;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tab {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
    }

    .chart-body {
        grid-template-columns: 1fr;
    }

    .chart-insights-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav-grid {
        grid-template-columns: 1fr !important;
    }

    .two-col-grid {
        grid-template-columns: 1fr !important;
    }

    .insights-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .report-title {
        font-size: 22px;
    }

    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .kpi-value {
        font-size: 20px !important;
    }
}
