:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --text-muted: #8b8d97;
    --accent: #3b82f6;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
}

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

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

header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

#map {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1rem;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item .primary {
    font-weight: 500;
}

.list-item .secondary {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.charging { color: var(--green); }
.driving { color: var(--accent); }
.asleep { color: var(--text-muted); }

.detail-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.close-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.25rem;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.card.clickable { cursor: pointer; transition: border-color 0.15s; }
.card.clickable:hover { border-color: var(--text-muted); }

footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    main { padding: 1rem; }
    .card-value { font-size: 1.5rem; }
}
