/* Celular primero: una columna, botones grandes, colores por estado.
   Paleta de la maqueta: fondo cálido, tinta oscura, acento naranja. Sólo fuentes del sistema. */
:root {
  --fondo: #f6f4ef; --caja: #fff; --tinta: #14171c; --suave: #6b7078; --linea: #e8e4dc; --hueso: #f1ede5;
  --acento: #e8590c; --acento-2: #c2410c; --acento-f: #ffe7d6;
  --verde: #0f7a5a; --verde-f: #e3f4ec;
  --ambar: #a16207; --ambar-f: #fef3c7;
  --rojo: #b42318; --rojo-f: #fde2e0;
  --azul: #2b5fb3; --azul-f: #e8eefc;
  --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
b { font-weight: 700; }

/* Cabecera y barra de abajo */
#cabecera { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 6px 0 14px; background: rgba(246, 244, 239, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linea); }
#cabecera h1 { flex: 1; min-width: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cabecera button { flex: none; width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent; font-size: 22px; cursor: pointer; }
#cabecera .atras { margin-left: -10px; font-size: 34px; line-height: 1; }
#cabecera button:active { background: var(--hueso); }
#cabecera .usuario { width: 40px; height: 40px; margin: 0 4px; border-radius: 20px; background: var(--acento-f); color: var(--acento-2); font-size: 17px; font-weight: 800; }
#cabecera .usuario.esperando { box-shadow: 0 0 0 3px var(--amarillo-f, #fdf0c4); }
.acceso { max-width: 440px; margin: 24px auto 0; }
.acceso .caja h2 { margin-bottom: 8px; font-size: 22px; font-weight: 800; }
.acceso .caja p { margin-bottom: 12px; }
.logo { flex: none; display: grid; place-items: center; width: 32px; height: 32px; }
.logo svg { width: 28px; height: 28px; }

#vista { max-width: 560px; margin: 0 auto; padding: 14px 14px 104px; }

#barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; background: var(--caja); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom, 0); }
#barra button { flex: 1; max-width: 150px; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--suave); cursor: pointer; }
#barra button svg { width: 44px; height: 28px; padding: 3px 0; border-radius: 14px; }
#barra button.activo { color: var(--acento-2); }
#barra button.activo svg { background: var(--acento-f); }
#barra .globo { position: absolute; top: 5px; left: calc(50% + 9px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--rojo); color: #fff; font-size: 12px; line-height: 20px; }

/* Carteles y textos sueltos */
.cartel { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 6px 8px 6px 12px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; font-size: 14px; }
.cartel > span { flex: 1; min-width: 0; }
.cartel.seguir { background: var(--azul-f); border-color: #c5d4f5; }
.link { flex: none; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--acento-2); font-weight: 700; text-decoration: underline; cursor: pointer; }
.cartel.seguir .link { color: var(--azul); }
.suave { color: var(--suave); font-size: 14px; }
.nota { margin-top: 10px; font-size: 13px; }
small.suave { display: block; margin-top: 6px; font-size: 13px; }
.vacio { padding: 22px 8px; text-align: center; color: var(--suave); }
.neg { color: var(--rojo); }
.fuerte { font-weight: 800 !important; }

h2.titulo { margin: 20px 2px 8px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--suave); }

/* Números grandes */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kpi { min-width: 0; padding: 12px 14px; border: 1px solid var(--linea); border-radius: var(--r); background: var(--caja); }
.kpi span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--suave); }
.kpi b { display: block; margin-top: 4px; font-size: 21px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi.negativo b { color: var(--rojo); }
.kpi.heroe { grid-column: 1 / -1; padding: 16px; background: var(--tinta); border-color: var(--tinta); color: #fff; }
.kpi.heroe span { color: #aeb4bd; }
.kpi.heroe b { font-size: 32px; }
.kpi.heroe.negativo b { color: #ff8a7a; }

.contadores { display: flex; gap: 8px; margin-bottom: 6px; }
.contador { flex: 1; padding: 10px 6px; border-radius: 14px; text-align: center; }
.contador b { display: block; font-size: 28px; line-height: 1; font-weight: 800; }
.contador span { font-size: 13px; font-weight: 600; }
.alquilado { background: var(--acento-f); color: var(--acento-2); }
.disponible { background: var(--verde-f); color: var(--verde); }
.service { background: var(--ambar-f); color: var(--ambar); }

.mes { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mes b { font-size: 18px; text-transform: capitalize; }
.mes button { width: 52px; height: 48px; border: 1px solid var(--linea); border-radius: 12px; background: var(--caja); font-size: 24px; line-height: 1; cursor: pointer; }

.segmento { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 14px; background: #ebe7de; }
.segmento button { flex: 1; min-width: 0; min-height: 44px; padding: 4px 6px; border: 0; border-radius: 10px; background: none; font-size: 14px; font-weight: 600; line-height: 1.15; color: var(--suave); cursor: pointer; }
.segmento button.activo { background: var(--tinta); color: #fff; }

/* Tarjetas tocables */
.tarjeta { display: block; width: 100%; min-height: 56px; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--linea); border-left: 5px solid #d8d2c6; border-radius: 14px; background: var(--caja); text-align: left; cursor: pointer; }
.tarjeta:active { background: #fbfaf7; }
.tarjeta.b-alquilado { border-left-color: var(--acento); }
.tarjeta.b-disponible { border-left-color: var(--verde); }
.tarjeta.b-service, .tarjeta.b-pronto { border-left-color: #d49a17; }
.tarjeta.b-reservado { border-left-color: var(--azul); }
.tarjeta.b-vencido { border-left-color: var(--rojo); }
.tarjeta.b-sin_fecha { border-left-color: #b9b3a7; }
.tarjeta .arriba { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tarjeta .arriba b { min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
.tarjeta .arriba > span { flex: none; font-size: 13px; color: var(--suave); white-space: nowrap; }
.tarjeta .arriba > .chip { color: inherit; }
.tarjeta .linea { display: block; margin-top: 3px; font-size: 15px; overflow-wrap: anywhere; }
.tarjeta .plata { font-weight: 700; color: var(--tinta) !important; font-size: 15px !important; }
.tarjeta .plata.neg { color: var(--rojo) !important; }
.tarjeta.auto { display: flex; align-items: center; gap: 12px; }
.tarjeta.auto .cuerpo { flex: 1; min-width: 0; }
.mini { flex: none; width: 84px; aspect-ratio: 16 / 11; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #fbeee2, #f1ebe1); }
.mini svg, .mini img, .foto-auto svg, .foto-auto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tarjeta .pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 13px; color: var(--suave); }
.tarjeta .pie > span { white-space: nowrap; }
.tarjeta .pie b { color: var(--tinta); }
.tarjeta .pie b.neg { color: var(--rojo); }
.medidor { display: block; height: 6px; margin: 9px 0 6px; border-radius: 9px; background: #eee9df; overflow: hidden; }
.medidor i { display: block; height: 100%; border-radius: 9px; background: var(--acento); }
.t-vencido { color: var(--rojo); } .t-pronto { color: var(--ambar); } .t-sin_fecha { color: var(--suave); } .t-ok { color: var(--verde); }

.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag { display: inline-block; margin: 5px 4px 0 0; padding: 2px 8px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tag.rojo { background: var(--rojo-f); color: var(--rojo); }
.tag.ambar { background: var(--ambar-f); color: var(--ambar); }
.tag.azul { background: var(--azul-f); color: var(--azul); }
.tag.naranja { background: var(--acento-f); color: var(--acento-2); }
.tag.gris { background: #efefef; color: var(--suave); }
.tag.verde { background: var(--verde-f); color: var(--verde); }

/* Botones */
.btn { display: block; width: 100%; min-height: 52px; margin-top: 10px; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--tinta); color: #fff; font-size: 17px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.btn:active { opacity: .85; }
.btn.acento { background: var(--acento-2); }
.btn.secundario { background: var(--caja); color: var(--tinta); border: 1px solid #d3cdc0; font-weight: 600; }
.btn.peligro { background: var(--caja); color: var(--rojo); border: 1px solid #f2c9c5; }
.btn.peligro.activo { background: var(--rojo-f); border-color: var(--rojo); }
a.btn { line-height: 26px; }

/* Cajas con filas */
.caja { margin-bottom: 12px; padding: 14px; border: 1px solid var(--linea); border-radius: var(--r); background: var(--caja); }
.caja h3 { margin-bottom: 8px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--suave); }
.ficha h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ficha p { margin-top: 6px; }
.foto-auto { position: relative; aspect-ratio: 16 / 9; margin-bottom: 12px; border: 1px solid var(--linea); border-radius: var(--r); overflow: hidden; background: linear-gradient(180deg, #fbeee2, #f1ebe1); }
.foto-auto .chip { position: absolute; top: 10px; left: 10px; }
.fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--linea); font-size: 15px; }
.fila:first-of-type { border-top: 0; }
.novedad { padding: 10px 0; border-top: 1px solid var(--linea); font-size: 15px; text-align: left; }
.novedad:first-child { border-top: 0; }
.fila span:first-child { min-width: 0; color: var(--suave); overflow-wrap: anywhere; }
.fila span:last-child { flex: 0 0 auto; max-width: 62%; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
button.fila { width: 100%; border-width: 1px 0 0; border-style: solid; border-color: var(--linea); background: none; text-align: left; cursor: pointer; }
button.fila:first-of-type { border-top-width: 0; }
.cat { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 15px; }
.cat > span:first-child { flex: none; width: 96px; overflow-wrap: anywhere; }
.cat .medidor { flex: 1; margin: 0; }
.cat b { flex: none; min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }

/* Calendario y gráficos */
.cal-fila { margin-bottom: 8px; }
.cal-nombre { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; }
.cal-pista { position: relative; height: 26px; border-radius: 6px; background: var(--hueso); }
.cal-barra { position: absolute; top: 3px; bottom: 3px; padding: 0 5px; border-radius: 5px; overflow: hidden; color: #fff; font-size: 11px; line-height: 20px; white-space: nowrap; }
.cal-barra.turo { background: var(--acento-2); }
.cal-barra.directo { background: var(--azul); }
.cal-barra.reservado { opacity: .55; }
.cal-hoy { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--tinta); }
.cal-dias { position: relative; height: 16px; font-size: 11px; color: var(--suave); }
.cal-dias span { position: absolute; transform: translateX(-50%); }
.leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--suave); }
.leyenda i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.leyenda .turo { background: var(--acento); } .leyenda .directo { background: var(--azul); } .leyenda .gris { background: #c9c2b5; }
.leyenda .reservado { background: var(--acento); opacity: .5; } .leyenda .hoy { width: 3px; background: var(--tinta); } .leyenda .tinta { background: var(--tinta); }
.grafico { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }

/* Formularios */
.campo { display: block; margin-top: 12px; }
.campo > span { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--suave); }
.campo input, .campo select, .campo textarea { width: 100%; min-width: 0; min-height: 50px; padding: 10px 12px; border: 1px solid #d3cdc0; border-radius: 12px; background: #fff; font-size: 17px; }
.campo input[type="file"] { padding: 12px; font-size: 14px; }
.campo textarea { min-height: 90px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--acento); outline-offset: 0; border-color: var(--acento); }
.campo.grande input { font-size: 24px; font-weight: 700; }
.campo small { display: block; margin-top: 4px; font-size: 13px; color: var(--suave); }
.dos { display: flex; gap: 10px; }
.dos > * { flex: 1; min-width: 0; }
.errores { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--rojo-f); color: var(--rojo); font-weight: 600; }
.errores p + p { margin-top: 4px; }

.grupo { margin-top: 16px; }
.grupo > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--suave); }
.grupo .caja .campo:first-child { margin-top: 0; }
.opciones { display: flex; gap: 6px; }
.opciones button { flex: 1; min-width: 0; min-height: 52px; padding: 4px 2px; border: 1px solid #d3cdc0; border-radius: 12px; background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.opciones button.activo { border-color: var(--tinta); background: var(--tinta); color: #fff; }
.tildes button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-bottom: 6px; padding: 8px 12px; border: 1px solid #d3cdc0; border-radius: 12px; background: #fff; font-size: 16px; text-align: left; cursor: pointer; }
.tildes button i { flex: none; width: 26px; height: 26px; border: 2px solid #d3cdc0; border-radius: 8px; font-style: normal; font-weight: 700; text-align: center; line-height: 22px; color: transparent; }
.tildes button.activo { border-color: var(--verde); background: var(--verde-f); }
.tildes button.activo i { border-color: var(--verde); background: var(--verde); color: #fff; }

/* Fotos */
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dosfotos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.foto { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 2px dashed #b9b3a7; border-radius: 12px; background: #fff; cursor: pointer; }
.dosfotos .foto { aspect-ratio: 4 / 3; }
.foto.lista { border: 2px solid var(--verde); }
.foto.falta { background: #faf8f3; cursor: default; }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto .mas { font-size: 34px; color: #b9b3a7; padding-bottom: 18px; }
.foto .sin { padding-bottom: 18px; font-size: 13px; color: var(--suave); }
.foto .pie { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; background: rgba(20, 23, 28, .74); color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }
.par.marcado { border-color: var(--rojo); }
.foto-grande { display: block; width: 100%; margin-top: 12px; border-radius: 12px; background: var(--hueso); }
.danio { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--linea); }
.danio:first-child { border-top: 0; }
.danio img, .danio .sinfoto { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--hueso); }
.danio div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.danio button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--hueso); font-size: 18px; cursor: pointer; }
.guardado { margin: 6px 0 2px; font-size: 13px; color: var(--verde); font-weight: 600; }

/* Hoja que sube desde abajo (reemplaza a los cartelitos del navegador) */
#hoja { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hoja-fondo { position: absolute; inset: 0; background: rgba(20, 23, 28, .5); }
.hoja-caja { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 18px 16px 22px; border-radius: 20px 20px 0 0; background: var(--fondo); }
.hoja-caja h2 { padding-right: 48px; font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.hoja-caja h2.titulo { padding-right: 0; font-size: 13px; font-weight: 700; }
.hoja-caja > p { margin-top: 8px; }
.hoja-caja .cerrar { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #e7e2d8; font-size: 20px; cursor: pointer; }

/* Cartel "¿Ya le ganamos al auto?" al lado de la foto */
.recupero h3 { margin-bottom: 4px; }
.recupero-pct { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.recupero-pct b { font-size: 56px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.recupero-pct span { font-size: 15px; font-weight: 600; color: var(--suave); }
.recupero-barra { height: 14px; margin: 10px 0 12px; border-radius: 7px; background: var(--linea); overflow: hidden; }
.recupero-barra i { display: block; height: 100%; border-radius: 7px; background: var(--acento); }
.recupero-titular { margin-bottom: 8px; font-size: 19px; font-weight: 800; }
.recupero.ganando .recupero-pct b, .recupero.empatado .recupero-pct b, .recupero.ganando .recupero-titular, .recupero.empatado .recupero-titular { color: var(--verde); }
.recupero.ganando .recupero-barra i, .recupero.empatado .recupero-barra i { background: var(--verde); }
.recupero-filas > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--linea); font-size: 16px; }
.recupero-filas b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recupero-filas .total b { font-size: 24px; }
.recupero .nota { margin-top: 8px; font-size: 13px; }

#aviso { pointer-events: none; position: fixed; left: 50%; bottom: 82px; z-index: 30; transform: translateX(-50%); width: max-content; max-width: 90vw; padding: 12px 18px; border-radius: 22px; background: var(--tinta); color: #fff; font-weight: 600; text-align: center; }

/* Pantallas anchas: se aprovecha el lugar, pero el celular manda */
/* Clientes (proyectos de sistemas) */
.atajos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-bottom: 6px; }
.atajos .btn:first-child { grid-column: 1 / -1; }
.chip.cl-prospecto { background: #efefef; color: var(--suave); }
.chip.cl-propuesta { background: var(--azul-f); color: var(--azul); }
.chip.cl-desarrollo { background: var(--acento-f); color: var(--acento-2); }
.chip.cl-entregado, .chip.cl-mantenimiento { background: var(--verde-f); color: var(--verde); }
.chip.cl-perdido { background: var(--rojo-f); color: var(--rojo); }
.tarjeta.b-cl-propuesta { border-left-color: var(--azul); }
.tarjeta.b-cl-desarrollo { border-left-color: var(--acento); }
.tarjeta.b-cl-entregado, .tarjeta.b-cl-mantenimiento { border-left-color: var(--verde); }
.tarjeta.b-cl-perdido { border-left-color: #b9b3a7; opacity: .75; }
.tarjeta .linea { display: block; margin-top: 3px; }
.estados { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chip-estado { min-height: 44px; padding: 6px 12px; border: 1px solid #d3cdc0; border-radius: 99px; background: var(--caja); font-size: 14px; font-weight: 600; color: var(--suave); cursor: pointer; }
.chip-estado.activo { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.tareas .tarea { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--linea); }
.tareas .tarea > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tareas .tarea.hecha > span { color: var(--suave); text-decoration: line-through; }
.tilde { flex: none; width: 44px; height: 44px; border: 2px solid #cfc9bd; border-radius: 12px; background: var(--caja); color: var(--verde); font-size: 20px; font-weight: 800; cursor: pointer; }
.tarea.hecha .tilde { background: var(--verde-f); border-color: var(--verde); }
.tareas .quitar { flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--suave); font-size: 16px; cursor: pointer; }
.nueva-tarea { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.nueva-tarea input { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border: 1px solid #d3cdc0; border-radius: 12px; font: inherit; background: var(--caja); }
.nueva-tarea .btn { width: auto; margin: 0; min-height: 48px; padding: 0 16px; font-size: 15px; }
.notas { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Menú "Más" */
.menu { padding: 0 14px; }
.item-menu { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 8px 0; border: 0; border-top: 1px solid var(--linea); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.item-menu:first-child { border-top: 0; }
.item-menu small { display: block; margin-top: 2px; font-size: 13px; color: var(--suave); }
.item-menu > span:last-child { font-size: 22px; color: var(--suave); }

@media (min-width: 900px) {
  #vista { max-width: 1080px; padding-top: 22px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .kpi.heroe { grid-column: auto; }
  .kpi.heroe b { font-size: 26px; }
  .rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 12px; align-items: start; }
  .rejilla.ancha { grid-template-columns: 1.3fr 1fr; }
  .segmento, .mes, .contadores { max-width: 560px; }
  #vista > .btn { max-width: 360px; }
  #vista > .caja, #vista > .foto-auto { max-width: 720px; }
  .auto-arriba { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto 1fr; gap: 0 12px; align-items: start; }
  .auto-arriba .recupero { grid-column: 2; grid-row: 1 / span 2; }
  .auto-arriba .recupero-pct b { font-size: 72px; }
  .hoja-caja { border-radius: 20px; margin-bottom: 5vh; }
}

/* Nuestros gastos: lista por día, saldos y quedar a mano */
.resumen-gastos { margin-bottom: 12px; padding: 16px; border-radius: var(--r); background: var(--tinta); color: #fff; }
.resumen-gastos > span { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #aeb4bd; }
.resumen-gastos > b { display: block; margin-top: 2px; font-size: 34px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.resumen-gastos .partes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
.resumen-gastos .partes span { display: block; font-size: 12px; color: #aeb4bd; overflow-wrap: anywhere; }
.resumen-gastos .partes b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.segmento .punto { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 4px; background: var(--acento); vertical-align: middle; }
h3.dia { margin: 16px 2px 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--suave); }
.lista-gastos { padding: 4px 14px; }
.gasto-fila { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 0; border: 0; border-top: 1px solid var(--linea); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.gasto-fila:first-child { border-top: 0; }
.gasto-fila .ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--acento-f); font-size: 21px; }
.gasto-fila.reembolso .ico { background: var(--verde-f); color: var(--verde); font-weight: 800; }
.gasto-fila .txt { flex: 1; min-width: 0; }
.gasto-fila .txt b { display: block; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.gasto-fila .txt small { display: block; margin-top: 2px; font-size: 13px; color: var(--suave); overflow-wrap: anywhere; }
.gasto-fila .monto { flex: none; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.saldos .saldo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--linea); }
.saldos .saldo:first-of-type { border-top: 0; }
.saldos .nombre { font-weight: 700; overflow-wrap: anywhere; }
.saldos .barra { position: relative; height: 10px; border-radius: 5px; background: var(--linea); }
.saldos .barra::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #c9c2b5; }
.saldos .barra i { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.saldos .barra i.pos { left: 50%; background: var(--verde); }
.saldos .barra i.neg { right: 50%; background: var(--rojo); }
.saldos b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.saldos b.pos { color: var(--verde); }
.saldos b.neg { color: var(--rojo); }
.a-mano .quien-debe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 18px; }
.a-mano .flecha { color: var(--suave); }
.a-mano .monto { margin-left: auto; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.a-mano.listo { background: var(--verde-f); border-color: transparent; color: var(--verde); }
.chips { margin: 0 0 14px; padding: 0; border: 0; }
.chips legend { margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--suave); }
.chips label { display: inline-block; margin: 0 6px 6px 0; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid #d3cdc0; border-radius: 22px; background: var(--caja); font-weight: 600; cursor: pointer; }
.chips input:checked + span { border-color: var(--tinta); background: var(--tinta); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--acento); outline-offset: 2px; }
.campo input.grande { min-height: 60px; font-size: 28px; font-weight: 800; }

/* Leer fotos con IA */
.boton-ia { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; cursor: pointer; }
.boton-ia.leyendo { opacity: .7; pointer-events: none; }
.boton-ia.leyendo span::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.nota-ia { margin: 0 2px 12px; font-size: 13px; }
.ticket-mini { display: block; max-width: 120px; max-height: 160px; margin: 0 0 12px; border-radius: 10px; border: 1px solid var(--linea); object-fit: cover; }
.ticket-mini[hidden] { display: none; }

/* Revisión automática de fotos */
.ia-comparar { border-color: #f2d6b8; background: #fffaf4; }
.ia-sugerencia { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--rojo-f); color: var(--rojo); font-weight: 700; }
.ia-nota { margin: 8px 0 0; font-size: 13px; }
