:root {
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --text: #1a1f2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --accent: #4f46e5;
    --download: #10b981;
    --upload: #f59e0b;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --accent: #818cf8;
    --download: #34d399;
    --upload: #fbbf24;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), var(--download));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-toggle {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: transform 0.2s ease, background 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.08);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

.title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.card.download::before { background: var(--download); }
.card.upload::before { background: var(--upload); }

.card-icon {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
}

.card.download .card-icon { color: var(--download); }
.card.upload .card-icon { color: var(--upload); }

.card-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.card-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.card-total {
    font-size: 14px;
    color: var(--text-muted);
}

/* Chart */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.download-dot { background: var(--download); }
.upload-dot { background: var(--upload); }

#traffic-chart {
    width: 100%;
    height: 260px;
    display: block;
}

/* Status */
.status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 2s infinite;
}

.status-dot.online { background: #10b981; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 640px) {
    .header { padding: 16px 20px; }
    .logo-text { font-size: 20px; }
    .cards { grid-template-columns: 1fr; }
    .title { font-size: 24px; }
    .card-value { font-size: 28px; }
    .chart-header { flex-direction: column; align-items: flex-start; }
}
