/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0f1320;
    color: #e6e9f2;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: #6ea8ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top bar */
.topbar {
    background: #1a1f2e;
    border-bottom: 1px solid #232a3d;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e6e9f2;
    font-weight: 600;
    font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.4rem; color: #ffd84d; }
.navlinks { display: flex; gap: 1.25rem; }
.navlinks a { color: #b6bdd1; font-size: 0.95rem; }
.navlinks a:hover { color: #fff; }

.main { padding: 1.5rem 1rem 3rem; }

/* Hero / empty states */
.hero {
    background: #1a1f2e;
    border: 1px solid #232a3d;
    border-radius: 14px;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.hero h1 { margin: 0 0 0.5rem; font-size: 1.6rem; }
.hero .subtle { margin-bottom: 1.25rem; }
.subtle { color: #9aa3b8; font-size: 0.95rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #4f7cff; color: #fff; }
.btn-primary:hover { background: #3d6bee; color: #fff; }
.btn-secondary { background: #2a3148; color: #e6e9f2; border-color: #3a4262; }
.btn-secondary:hover { background: #353d57; color: #fff; }
.btn-link { background: transparent; color: #6ea8ff; padding: 0.7rem 0.6rem; }

/* Alerts */
.alert {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.alert-error {
    background: #3a1f24;
    border: 1px solid #6e2c34;
    color: #ffd0d6;
}

/* Page head */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0 0 0.15rem; font-size: 1.5rem; }

.head-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.vehicle-picker { display: inline-flex; }
.vehicle-select {
    background: #2a3148;
    color: #e6e9f2;
    border: 1px solid #3a4262;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    max-width: 220px;
}
.vehicle-select:hover { background: #353d57; }

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Cards */
.card {
    background: #1a1f2e;
    border: 1px solid #232a3d;
    border-radius: 14px;
    padding: 1.1rem 1.1rem 1.2rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}
.card-wide { grid-column: span 2; }
.card-battery { grid-column: span 2; }

.card-label {
    font-size: 0.78rem;
    color: #9aa3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}
.big-number {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
    color: #f3f5fb;
}
.big-text {
    font-size: 1.35rem;
    font-weight: 600;
    color: #f3f5fb;
    text-transform: capitalize;
}
.unit {
    font-size: 1rem;
    color: #9aa3b8;
    font-weight: 500;
    margin-left: 0.2rem;
}
.card-meta {
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 0.85rem;
    color: #9aa3b8;
}

/* Battery bar */
.battery-bar {
    margin-top: 0.7rem;
    height: 10px;
    background: #232a3d;
    border-radius: 6px;
    overflow: hidden;
}
.battery-bar-fill {
    height: 100%;
    width: 0%;
    background: #4ade80;
    transition: width 0.4s ease;
}
.battery-bar-fill.mid { background: #facc15; }
.battery-bar-fill.low { background: #f87171; }

/* Tires */
.tires {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.tire {
    background: #232a3d;
    border-radius: 10px;
    padding: 0.6rem 0.4rem;
    text-align: center;
}
.tire-label {
    display: block;
    font-size: 0.7rem;
    color: #9aa3b8;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}
.tire-val {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f3f5fb;
}

.updated { margin-top: 1.25rem; text-align: right; }

/* Footer */
.footer {
    padding: 1.5rem 0;
    border-top: 1px solid #232a3d;
    color: #6f7793;
    text-align: center;
}

/* Tablet */
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .card-wide, .card-battery { grid-column: span 2; }
}

/* Mobile */
@media (max-width: 600px) {
    .topbar-inner { padding: 0.6rem 0.9rem; }
    .brand-text { font-size: 0.95rem; }
    .navlinks { gap: 0.8rem; }
    .navlinks a { font-size: 0.9rem; }

    .main { padding: 1rem 0.75rem 2.5rem; }

    .hero { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.35rem; }

    .page-head { flex-direction: column; align-items: stretch; }
    .page-head .btn { align-self: flex-start; }
    .head-actions { flex-direction: column; align-items: stretch; }
    .vehicle-select { max-width: none; width: 100%; }

    .grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .card-wide, .card-battery { grid-column: span 1; }

    .big-number { font-size: 2rem; }
    .big-text { font-size: 1.2rem; }

    .tires { grid-template-columns: repeat(2, 1fr); }
}

/* Touch targets */
@media (hover: none) {
    .btn { padding: 0.85rem 1.3rem; }
}
