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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    color: #e6edf3;
    min-height: 100vh;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #58a6ff, #3fb950);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.header p {
    color: #8b949e;
}

.auto-refresh {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(56, 139, 253, 0.1);
    border: 1px solid rgba(56, 139, 253, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #58a6ff;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #8b949e;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(88, 166, 255, 0.2);
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #8b949e;
    font-style: italic;
}

/* Metrics */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #21262d;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #30363d;
    transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: #58a6ff;
}

.metric-card h3 {
    font-size: 0.85rem;
    color: #8b949e;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e6edf3;
}

/* Charts */
.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: #21262d;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #30363d;
}

.chart-container h3 {
    font-size: 1rem;
    color: #e6edf3;
    margin-bottom: 15px;
}

.chart-header {
    margin-bottom: 15px;
}

.chart-header select {
    width: 100%;
    padding: 10px;
    background: #0d1117;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.chart-header select:focus {
    outline: none;
    border-color: #58a6ff;
}

canvas {
    max-height: 280px;
}

/* Table */
.table-section {
    background: #21262d;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #30363d;
    margin-bottom: 30px;
}

.table-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #e6edf3;
}

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

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}

th {
    color: #8b949e;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

.positive {
    color: #3fb950;
}

.negative {
    color: #f85149;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #8b949e;
    font-size: 0.85rem;
}

.footer a {
    color: #58a6ff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

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

    .header h1 {
        font-size: 1.8rem;
    }

    .metric-card p {
        font-size: 1.4rem;
    }

    th, td {
        padding: 8px;
        font-size: 0.85rem;
    }
}
