/* Control de Flota — Custom Styles */

* { box-sizing: border-box; }

body {
    background-color: #0f172a;
    color: #f1f5f9;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Nav activo */
.nav-link { transition: color 0.15s, background 0.15s; }
.nav-link.active { color: #818cf8; background: rgba(99,102,241,0.12); }
.nav-link:not(.active):hover { color: #e2e8f0; background: rgba(255,255,255,0.05); }

/* Mobile menu */
#mobile-menu { transition: max-height 0.25s ease, opacity 0.25s ease; }
#mobile-menu.hidden { max-height: 0; opacity: 0; overflow: hidden; }
#mobile-menu.open { max-height: 400px; opacity: 1; }

/* Badges combustible */
.badge-diesel  { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.badge-gasolina{ background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.badge-hibrido { background: rgba(168,85,247,.12); color: #c084fc; border: 1px solid rgba(168,85,247,.3); }

/* Estado ITV / mantenimiento */
.badge-ok      { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.badge-warning { background: rgba(245,158,11,.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.badge-danger  { background: rgba(239,68,68,.12);   color: #f87171; border: 1px solid rgba(239,68,68,.3);  }
.badge-info    { background: rgba(99,102,241,.12);  color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }

/* Cards */
.card { background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem; }
.card-hover { transition: border-color 0.15s, box-shadow 0.15s; }
.card-hover:hover { border-color: #6366f1; box-shadow: 0 0 0 1px rgba(99,102,241,.3); }

/* Inputs */
.inp {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.inp:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.25); }
.inp::placeholder { color: #475569; }
select.inp option { background: #1e293b; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.15s; border: none; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-secondary { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
.btn-secondary:hover { background: #334155; color: #f1f5f9; }
.btn-danger { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: #ef4444; color: #fff; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.75rem; }
.btn-icon { padding: 0.4rem; }

/* Tabs */
.tab-btn { padding: 0.65rem 1rem; font-size: 0.875rem; font-weight: 500; border-bottom: 2px solid transparent; color: #64748b; cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap; }
.tab-btn.active { color: #818cf8; border-bottom-color: #6366f1; }
.tab-btn:hover:not(.active) { color: #cbd5e1; border-bottom-color: #475569; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Tabla */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tbl thead tr { border-bottom: 1px solid #334155; }
.tbl th { padding: 0.75rem 1rem; text-align: left; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.tbl td { padding: 0.75rem 1rem; color: #cbd5e1; border-bottom: 1px solid rgba(51,65,85,.5); }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* Alert cards */
.alert-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; border-radius: 0.625rem; border-width: 1px; }
.alert-danger  { background: rgba(239,68,68,.07); border-color: rgba(239,68,68,.25); }
.alert-warning { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.25); }
.alert-info    { background: rgba(99,102,241,.07); border-color: rgba(99,102,241,.25); }

/* KM badge */
.km-badge { font-size: 0.7rem; color: #64748b; }

/* Stat box */
.stat-box { background: #0f172a; border: 1px solid #334155; border-radius: 0.625rem; padding: 1rem; }

/* Page title */
.page-title { font-size: 1.375rem; font-weight: 700; color: #f1f5f9; }
.page-subtitle { font-size: 0.875rem; color: #64748b; margin-top: 0.25rem; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 2rem; color: #475569; gap: 0.75rem; }

/* Image placeholder */
.img-placeholder { background: #1e293b; border: 2px dashed #334155; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; color: #475569; }

/* Spinner */
.spinner { border: 2px solid #334155; border-top-color: #6366f1; border-radius: 50%; width: 1rem; height: 1rem; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal overlay */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: #1e293b; border: 1px solid #334155; border-radius: 1rem; width: 100%; max-width: 480px; padding: 1.5rem; }

/* Responsive helpers */
@media (max-width: 640px) {
    .hide-sm { display: none !important; }
    .page-title { font-size: 1.125rem; }
}
