/**
 * RAFA30229 Fleet Monitor — theme.css
 * ---------------------------------------------------
 * Sistema de diseño central. TODAS las páginas de la plataforma
 * deben usar estas variables en vez de escribir colores "a mano".
 * Cambiar un color aquí lo cambia en toda la plataforma.
 */

:root {
  /* Paleta oficial (seccion 47 del plan) */
  --bg:            #080C12;
  --panel:         #101722;
  --surface:       #151D29;
  --border:        #263241;
  --text:          #F8FAFC;
  --text-muted:    #94A3B8;

  --green:         #22C55E;
  --blue:          #38BDF8;
  --yellow:        #F59E0B;
  --red:           #EF4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --font-main: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
}

a { color: var(--blue); text-decoration: none; }

/* ---------- Tarjetas / paneles ---------- */
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.surface {
  background: var(--surface);
  border-radius: var(--radius-md);
}

/* ---------- Formularios ---------- */
label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
}

/* ---------- Botones ---------- */
button, .btn {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { opacity: 0.9; }

.btn-primary { background: var(--blue); color: var(--bg); }
.btn-success { background: var(--green); color: var(--bg); }
.btn-danger  { background: var(--red);   color: var(--text); }
.btn-ghost   { background: var(--surface); color: var(--text); border: 1px solid var(--border) !important; }

/* ---------- Badges de estado ---------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-green  { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge-blue   { background: rgba(56,189,248,0.15); color: var(--blue); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); }
.badge-muted  { background: rgba(148,163,184,0.15); color: var(--text-muted); }

/* ---------- Mensajes de estado ---------- */
.msg { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.msg-success { background: rgba(34,197,94,0.12); border: 1px solid var(--green); color: var(--green); }
.msg-error   { background: rgba(239,68,68,0.12); border: 1px solid var(--red);   color: var(--red); }

/* ---------- Utilidades ---------- */
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ---------- Layout con navegacion (nav.js) ---------- */
body.fleet-app {
  padding-left: 240px; /* deja espacio para el sidebar en desktop */
}

.fleet-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  z-index: 100;
}
.fleet-sidebar-brand {
  padding: 0 20px 20px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.fleet-sidebar-brand span { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.fleet-sidebar-items { flex: 1; overflow-y: auto; }
.fleet-sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.fleet-sidebar-item:hover { background: var(--surface); color: var(--text); }
.fleet-sidebar-item.active { background: var(--surface); color: var(--blue); border-right: 2px solid var(--blue); }
.fleet-nav-icon { font-size: 15px; }
.fleet-sidebar-user { padding: 16px 20px 0; border-top: 1px solid var(--border); margin-top: 12px; }
.fleet-sidebar-user-name { font-size: 13px; font-weight: 600; }
.fleet-sidebar-user-role { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.fleet-logout-btn { width: 100%; font-size: 12px; padding: 8px; }

.fleet-bottomnav { display: none; }

/* ---------- Responsive: en pantallas chicas, sidebar se oculta y aparece bottom nav ---------- */
@media (max-width: 768px) {
  body.fleet-app { padding-left: 0; padding-bottom: 64px; }
  .fleet-sidebar { display: none; }
  .fleet-bottomnav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--panel);
    border-top: 1px solid var(--border);
    z-index: 100;
  }
  .fleet-bottomnav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 10px;
  }
  .fleet-bottomnav-item.active { color: var(--blue); }
}