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

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

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #d2d2d7;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1d1d1f;
}

.controls {
    display: flex;
    gap: 15px;
}

button, .export-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

#refreshBtn {
    background-color: #007aff;
    color: white;
}

#refreshBtn:hover {
    background-color: #0056b3;
}

.export-btn {
    background-color: #34c759;
    color: white;
}

.export-btn:hover {
    background-color: #28a745;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.last-update {
    display: flex;
    align-items: center;
    gap: 8px;
}

.last-update .label {
    font-weight: 500;
    color: #86868b;
}

.offline-warning {
    color: #ff9500;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hidden {
    display: none !important;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 5px;
}

.stat-unit {
    font-size: 14px;
    color: #86868b;
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.chart-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 70vh;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.chart-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d1d1f;
    flex-shrink: 0;
}

.chart-panel canvas {
    flex: 1;
    min-height: 0;
    max-height: 100%;
}

.data-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-table-container h3 {
    padding: 25px;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 1px solid #d2d2d7;
}

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

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

th {
    background-color: #f5f5f7;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 1px solid #d2d2d7;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f5f5f7;
}

tbody tr:hover {
    background-color: #f9f9f9;
}

.loading {
    text-align: center;
    color: #86868b;
    font-style: italic;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .status-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    .charts-container {
        gap: 20px;
    }

    .chart-panel {
        min-width: 0;
        height: 70vh;
        min-height: 280px;
    }
}
