/* Sistema Franco Cecchi — estilos. Mismos colores y tipografías que el diseño aprobado (verde #15803D, Inter, Space Grotesk). */
:root {
  --fondo: #F4F5F7; --blanco: #FFFFFF; --tinta: #111827; --tinta2: #374151; --suave: #4B5563;
  --linea: #E3E6EB; --linea2: #C9CFDA; --verde: #15803D; --verde-fondo: #E3F1E7; --verde-tinta: #14532D;
  --alerta: #9A3412; --tibio-fondo: #FDECD8; --tibio-tinta: #7C2D12; --frio-fondo: #EEF0F3; --azul: #1E3A8A;
  --titulos: "Space Grotesk", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 20px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
#app { height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; padding-top: env(safe-area-inset-top); }
.centro { margin: auto; padding: 24px; text-align: center; color: var(--suave); }

/* Botones y campos */
.btn { min-height: 48px; padding: 0 18px; border: 1px solid var(--verde); border-radius: 12px; background: var(--verde); color: #FFFFFF; font-weight: 600; }
.btn[disabled] { opacity: .55; }
.btn.claro { background: var(--blanco); color: var(--tinta); border-color: var(--linea2); font-weight: 500; }
.btn-texto { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--verde); font-weight: 600; border-radius: 10px; }
.btn-icono { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--tinta2); }
.campo input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--linea2); border-radius: 12px; background: var(--blanco); font-size: 16px; }
.campo input:focus { outline: 2px solid var(--verde); outline-offset: 0; border-color: var(--verde); }
.tilde { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.tilde input { width: 22px; height: 22px; accent-color: var(--verde); }
.error { padding: 10px 12px; border-radius: 10px; background: var(--tibio-fondo); color: var(--tibio-tinta); font-size: 14px; }
.aviso { padding: 10px 12px; border-radius: 10px; background: var(--verde-fondo); color: var(--verde-tinta); font-size: 14px; }
.nota { font-size: 13px; line-height: 18px; color: var(--suave); }

/* Inicio de sesión */
.login { flex: 1; overflow: auto; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.login .marca { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login .marca img { width: 52px; height: 52px; border-radius: 12px; }
.login h1 { font-family: var(--titulos); font-size: 26px; line-height: 30px; font-weight: 700; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login .fila { display: flex; gap: 8px; }
.login .fila .campo { flex: 1; min-width: 0; }
.login .fila .btn { align-self: flex-end; }
.login .pie { display: flex; justify-content: space-between; }

/* Encabezado de pantalla */
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 20px 12px 4px 20px; }
.cabecera h1 { font-family: var(--titulos); font-size: 28px; line-height: 32px; font-weight: 700; }
.cabecera .sub { font-size: 14px; font-weight: 600; color: var(--alerta); }
.cabecera .sub.calmo { color: var(--suave); font-weight: 500; }
.franja { margin: 8px 16px 0; padding: 8px 12px; border-radius: 10px; background: var(--tibio-fondo); color: var(--tibio-tinta); font-size: 13px; line-height: 18px; }

/* Filtros */
.chips { display: flex; gap: 8px; padding: 8px 20px 12px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 44px; padding: 0 16px; border: 1px solid var(--linea2); border-radius: 22px; background: var(--blanco); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.activo { background: var(--tinta); border-color: var(--tinta); color: #FFFFFF; font-weight: 600; }

/* Chats */
.asistente { display: flex; gap: 12px; align-items: flex-start; margin: 0 16px; padding: 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 16px; flex-shrink: 0; }
.circulo { flex-shrink: 0; width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--verde-fondo); color: var(--verde-tinta); font-weight: 600; }
.circulo.verde { background: var(--verde); color: #FFFFFF; }
.cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.linea1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nombre { font-weight: 600; }
.hora { flex-shrink: 0; font-size: 12px; line-height: 18px; color: var(--suave); }
.texto { font-size: 14px; color: var(--tinta2); }
.texto.corto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pie-chat { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--suave); }
.contador { flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--verde); color: #FFFFFF; font-size: 12px; line-height: 22px; font-weight: 600; text-align: center; }
.con-contador { display: flex; gap: 8px; align-items: flex-end; }
.con-contador .texto { flex: 1; }
.etiqueta { padding: 0 8px; border-radius: 6px; font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.etiqueta.caliente { background: var(--alerta); color: #FFFFFF; }
.etiqueta.tibio { background: var(--tibio-fondo); color: var(--tibio-tinta); }
.etiqueta.frio { background: var(--frio-fondo); color: var(--tinta2); }
.etiqueta.verde { background: var(--verde-fondo); color: var(--verde-tinta); }
.estado-alerta { font-weight: 600; color: var(--alerta); }
.estado-azul { font-weight: 600; color: var(--azul); }
.titulo-seccion { padding: 16px 20px 6px; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); }
.lista { flex: 1; min-height: 0; overflow: auto; background: var(--blanco); border-top: 1px solid var(--linea); -webkit-overflow-scrolling: touch; }
.item { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--linea); }
.vacio { padding: 32px 24px; text-align: center; color: var(--suave); }

/* Autos */
.buscador { padding: 8px 16px 12px; flex-shrink: 0; }
.buscador input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--linea2); border-radius: 12px; background: var(--blanco); font-size: 16px; }
.buscador input:focus { outline: 2px solid var(--verde); outline-offset: 0; border-color: var(--verde); }
.auto { width: 100%; border: 0; border-bottom: 1px solid var(--linea); background: var(--blanco); text-align: left; display: flex; gap: 12px; padding: 12px 16px; align-items: center; }
.foto-chica { flex-shrink: 0; width: 84px; height: 63px; border-radius: 10px; background: var(--frio-fondo); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--suave); }
.auto .titulo { font-weight: 600; }
.auto .datos { font-size: 13px; line-height: 18px; color: var(--suave); }
.auto .precio { font-weight: 600; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Ficha del auto */
.ficha { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.barra { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px; flex-shrink: 0; }
.barra h1 { font-family: var(--titulos); font-size: 20px; line-height: 26px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fotos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 8px; scrollbar-width: none; }
.fotos::-webkit-scrollbar { display: none; }
.fotos img { flex-shrink: 0; width: 86%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; scroll-snap-align: center; background: var(--frio-fondo); }
.bloque { margin: 12px 16px 0; padding: 16px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 16px; display: flex; flex-direction: column; gap: 12px; }
.bloque h2 { font-family: var(--titulos); font-size: 18px; line-height: 24px; font-weight: 700; }
.precio-grande { font-family: var(--titulos); font-size: 26px; line-height: 30px; font-weight: 700; }
.pares { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.pares div { display: flex; flex-direction: column; }
.pares small { font-size: 12px; line-height: 18px; color: var(--suave); }
.pares b { font-weight: 600; }
.bloque-campos { display: flex; flex-direction: column; gap: 12px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dos .chip { width: 100%; }
.cuota { padding: 14px; border: 1px solid var(--linea); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.cuota.no { background: var(--fondo); }
.cuota .grande { font-family: var(--titulos); font-size: 18px; line-height: 24px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cuota ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 18px; color: var(--tibio-tinta); }
.sobra { font-weight: 600; color: var(--verde-tinta); }
.falta { font-weight: 600; color: var(--alerta); }

/* Navegación */
.nav { display: flex; background: var(--blanco); border-top: 1px solid var(--linea); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); flex-shrink: 0; }
.nav button { flex: 1; min-height: 52px; border: 0; background: transparent; color: var(--suave); font-size: 12px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 12px; }
.nav button.activo { color: var(--verde); font-weight: 600; }
