/* ── VeeXMan — app.css ──────────────────────────────────────────────────── */
:root {
    --bs-body-bg: #0f0f13;
    --bs-body-color: #e8e8f0;
    --card-bg: #1a1a24;
    --card-border: #2a2a38;
    --bottom-nav-h: 64px;
    --accent: #4f8ef7;
    --accent-hover: #3a7ae8;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
}

/* ── Vehicle cards ───────────────────────────────────────────────────────── */
.vehicle-card {
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border-left: 4px solid var(--accent);
}
.vehicle-card:active { transform: scale(.97); }
.vehicle-emoji { font-size: 2.2rem; line-height: 1; }
.vehicle-name  { font-weight: 700; font-size: 1.05rem; }
.vehicle-plate {
    font-size: .75rem;
    background: #252530;
    border-radius: 6px;
    padding: 1px 7px;
    font-family: monospace;
    letter-spacing: .05em;
}

/* ── Stat badges ─────────────────────────────────────────────────────────── */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #252530;
    border-radius: 50px;
    padding: 3px 10px;
    font-size: .78rem;
}
.stat-pill .label { color: #888; }
.stat-pill .value { font-weight: 600; }

/* ── Delta indicator ─────────────────────────────────────────────────────── */
.delta-up   { color: var(--red);    font-size: .8rem; }
.delta-down { color: var(--green);  font-size: .8rem; }
.delta-flat { color: #888;          font-size: .8rem; }

/* ── Traffic-light badges (reminders) ────────────────────────────────────── */
.badge-ok      { background: var(--green)  !important; color: #000; }
.badge-warn    { background: var(--yellow) !important; color: #000; }
.badge-danger  { background: var(--red)    !important; color: #fff; }

/* ── Bottom navigation bar ───────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: #14141e;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #666;
    font-size: .65rem;
    transition: color .15s;
    flex: 1;
    padding: 6px 0;
    text-decoration: none;
}
.bottom-nav a .bi { font-size: 1.35rem; }
.bottom-nav a.active,
.bottom-nav a:hover { color: var(--accent); }
.bottom-nav .badge-dot {
    position: relative;
}
.bottom-nav .badge-dot::after {
    content: '';
    position: absolute;
    top: -2px; right: -4px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid #14141e;
}

/* ── Top header ──────────────────────────────────────────────────────────── */
.app-header {
    background: #14141e;
    border-bottom: 1px solid var(--card-border);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 999;
}
.app-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select {
    background: #1e1e2a;
    border-color: var(--card-border);
    color: var(--bs-body-color);
}
.form-control:focus, .form-select:focus {
    background: #1e1e2a;
    border-color: var(--accent);
    color: var(--bs-body-color);
    box-shadow: 0 0 0 .2rem rgba(79, 142, 247, .25);
}
.form-control::placeholder { color: #3a3a4a; font-style: italic; }
.form-control.is-suggested { border-color: rgba(13,202,240,.3); color: #6a8fa8; font-style: italic; }
.form-label { font-size: .88rem; color: #aaa; margin-bottom: 4px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ── Tablas de historial ─────────────────────────────────────────────────── */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--card-border);
    font-size: .88rem;
}
.table thead th { color: #888; font-weight: 500; border-bottom-width: 1px; }

/* ── FAB (Floating Action Button) ────────────────────────────────────────── */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom));
    right: 20px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(79,142,247,.45);
    z-index: 999;
    line-height: 1;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.fab:hover, .fab:focus { color: #fff; transform: scale(1.08); }

/* ── Drag-and-drop sort handle ───────────────────────────────────────────── */
.sortable-ghost { opacity: .35; }
.drag-handle {
    cursor: grab;
    color: #444;
    padding: 0 6px;
    font-size: 1.1rem;
}
.drag-handle:active { cursor: grabbing; }

/* ── Consumo gauge (simple number) ──────────────────────────────────────── */
.consumption-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
}
.consumption-unit { font-size: .85rem; color: #888; }

/* ── Loader ──────────────────────────────────────────────────────────────── */
.spinner-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

/* ── Language switcher ───────────────────────────────────────────────────── */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
}
.lang-switcher a {
    color: #666;
    text-decoration: none;
    padding: 1px 4px;
    border-radius: 4px;
    transition: color .15s;
}
.lang-switcher a:hover { color: #ccc; }
.lang-switcher a.lang-active { color: #a5b4fc; }
.lang-switcher span { color: #444; }

/* ── Unit switcher (header) ──────────────────────────────────────────────── */
.unit-switcher { gap: 3px; }
.unit-btn {
    font-size: .68rem;
    padding: 2px 8px;
    border-radius: 50px;
    color: #666;
    text-decoration: none;
    background: #252530;
    transition: background .15s, color .15s;
    white-space: nowrap;
    line-height: 1.6;
}
.unit-btn.active { background: var(--accent); color: #fff; }
.unit-btn:hover:not(.active) { background: #2a2a38; color: #ccc; }

/* ── Vehicle photo banner (garage card) ──────────────────────────────────── */
.vehicle-photo-banner {
    height: 150px;
    background-size: cover;
    background-position: center 30%;
    cursor: pointer;
    border-radius: calc(var(--bs-card-border-radius, .375rem) - 1px)
                   calc(var(--bs-card-border-radius, .375rem) - 1px)
                   0 0;
}

/* ── Vehicle photo preview (form) ────────────────────────────────────────── */
.vehicle-form-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

/* ── Last-N consumption highlight pill ───────────────────────────────────── */
.stat-pill--highlight {
    border: 1px solid rgba(79,142,247,.35);
    background: rgba(79,142,247,.08);
}
