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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #1a1a1a;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.2em;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

label {
    font-weight: 600;
    color: #555;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

select:hover {
    border-color: #999;
}

.view-buttons {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.view-btn:hover {
    background: #f0f0f0;
}

.view-btn.active {
    background: #2c5aa0;
    color: white;
    border-color: #2c5aa0;
}

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

.metric {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.metric-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.metric-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #2c5aa0;
}

.chart {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 500px;
}

.stats-view {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.stats-section h3 {
    color: #2c5aa0;
    margin-bottom: 5px;
}

.stats-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

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

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f8f8;
    font-weight: 600;
    color: #555;
}

tr:hover {
    background: #f8f8f8;
}

.distribution-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.small-chart {
    height: 300px;
}

.data-section {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

details summary {
    cursor: pointer;
    font-weight: 600;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 5px;
}

details[open] summary {
    margin-bottom: 15px;
}

#rawDataTable {
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .distribution-charts {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}