/* TallerStatus — estilos de la app del taller (rediseño). Los valores salen de tokens.css. */

:root {
  /* nombres cortos que usa el código de la app, apuntando a los tokens */
  --acento: var(--ts-blue-700);
  --verde: var(--ts-green-600);
  --verde-osc: var(--ts-green-700);
  --azul: var(--ts-blue-600);
  --rojo: var(--ts-red-700);
  --ambar: var(--ts-amber-700);
  --fondo: var(--ts-bg);
  --tarjeta: var(--ts-surface);
  --panel2: var(--ts-surface-muted);
  --barra: var(--ts-surface);
  --texto: var(--ts-text);
  --suave: var(--ts-text-muted);
  --linea: var(--ts-border);
}

* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--ts-bg); color: var(--ts-text); font-family: var(--ts-font-sans); line-height: var(--ts-line-normal); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; position: relative; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
svg.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
svg.ic { width: 1.5rem; height: 1.5rem; display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vista { display: none; }
.vista.activa { display: block; }

/* ---------- MARCA ---------- */
.marca { display: flex; align-items: center; gap: .65rem; color: #fff; }
.marca svg { width: 2.4rem; height: 2.7rem; flex: none; }
.marca-txt { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.marca-txt b { color: #3FD28A; font-weight: 800; }

/* ---------- MENÚ LATERAL (escritorio) ---------- */
#lateral { display: none; position: fixed; inset: 0 auto 0 0; width: var(--ts-sidebar-width); background: var(--ts-navy-950); color: #fff; padding: var(--ts-space-5) var(--ts-space-3) var(--ts-space-4); flex-direction: column; overflow-y: auto; z-index: 20; }
#lateral .marca { padding: 0 var(--ts-space-3); margin-bottom: var(--ts-space-6); }
#lateral nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-grupo { font-size: var(--ts-text-xs); font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: #7D93A8; padding: var(--ts-space-4) var(--ts-space-3) var(--ts-space-2); }
.nav-item { display: flex; align-items: center; gap: var(--ts-space-3); width: 100%; min-height: var(--ts-touch-target); padding: 0 var(--ts-space-3); border-radius: var(--ts-radius-md); color: #D5E1EC; font-size: var(--ts-text-sm); font-weight: 600; text-align: left; }
.nav-item svg.ic { width: 1.3rem; height: 1.3rem; }
.nav-item:hover { background: var(--ts-navy-800); color: #fff; }
.nav-item.on { background: var(--ts-green-700); color: #fff; }
.nav-item .pronto { margin-left: auto; font-size: .65rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .45rem; border-radius: var(--ts-radius-pill); background: rgba(255,255,255,.1); color: #9FB3C6; }
.nav-item.pronto-item { opacity: .6; cursor: default; }
.nav-item.pronto-item:hover { background: none; color: #D5E1EC; }
.nav-item.bloq { opacity: .45; }
.nav-usuario { display: flex; align-items: center; gap: var(--ts-space-3); padding: var(--ts-space-3); margin-top: var(--ts-space-4); border-top: 1px solid rgba(255,255,255,.1); }
.nav-usuario .avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--ts-blue-700); display: grid; place-items: center; font-weight: 800; flex: none; overflow: hidden; }
.nav-usuario .avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-usuario .quien { flex: 1; min-width: 0; line-height: 1.25; }
.nav-usuario .quien b { display: block; font-size: var(--ts-text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-usuario .quien small { color: #9FB3C6; font-size: var(--ts-text-xs); }
.nav-usuario button { width: 2.4rem; height: 2.4rem; min-height: 0; display: grid; place-items: center; border-radius: var(--ts-radius-md); color: #D5E1EC; }
.nav-usuario button:hover { background: var(--ts-navy-800); color: #fff; }

/* ---------- BARRA INFERIOR (celular y tableta) ---------- */
#navmov { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: var(--ts-surface); border-top: 1px solid var(--ts-border); box-shadow: 0 -4px 16px rgb(16 32 51 / 8%); padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 30; align-items: flex-end; justify-content: space-around; }
#navmov button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--ts-touch-target); padding: .2rem 0; font-size: .7rem; font-weight: 650; color: var(--ts-text-muted); }
#navmov button svg.ic { width: 1.45rem; height: 1.45rem; }
#navmov button.on { color: var(--ts-green-700); }
#navmov button.centro-nueva { flex: none; width: 3.4rem; height: 3.4rem; min-height: 0; margin: -1.2rem .4rem 0; border-radius: 50%; background: var(--ts-green-700); color: #fff; box-shadow: 0 6px 16px rgb(22 128 74 / 40%); }
#navmov button.centro-nueva svg.ic { width: 1.8rem; height: 1.8rem; stroke-width: 2.2; }
body.con-menu #navmov { display: flex; }
body[data-v=detalle] #navmov, body[data-v=nueva] #navmov { display: none; }

/* ---------- ESTRUCTURA ---------- */
main { padding-bottom: 6rem; }
body[data-v=detalle] main, body[data-v=nueva] main { padding-bottom: 2rem; }
@media (min-width: 1024px) {
  body.con-menu #lateral { display: flex; }
  body.con-menu main { margin-left: var(--ts-sidebar-width); padding-bottom: var(--ts-space-8); }
  body.con-menu #navmov { display: none; }
}

/* ---------- ENCABEZADO DE CADA PANTALLA ---------- */
.hero { position: relative; background: var(--ts-navy-900); color: #fff; text-align: center; padding: calc(.8rem + env(safe-area-inset-top)) 3.4rem .9rem; }
.hero h1 { font-size: 1.05rem; font-weight: 750; line-height: 1.25; margin: 0; }
.hero .sub { color: #B9C9D8; font-size: var(--ts-text-xs); margin-top: .1rem; }
.hero .atras { position: absolute; left: .4rem; top: calc(.45rem + env(safe-area-inset-top)); width: var(--ts-touch-target); height: var(--ts-touch-target); display: grid; place-items: center; color: #fff; border-radius: var(--ts-radius-md); }
.hero .atras svg.i { width: 1.5rem; height: 1.5rem; stroke-width: 2.4; }
.hero .acciones { position: absolute; right: .4rem; top: calc(.45rem + env(safe-area-inset-top)); display: flex; align-items: center; gap: var(--ts-space-2); }
.hero .acciones .solo-pc { display: none; }
.hero .acciones .campana { color: #fff; }
.hero .acciones .campana.off { color: #8FA6BA; }
.pill { display: inline-flex; align-items: center; margin-top: .5rem; padding: .25rem .8rem; border-radius: var(--ts-radius-pill); background: var(--ts-blue-100); color: var(--ts-blue-700); font-weight: 700; font-size: var(--ts-text-xs); }
.pill.pend { background: var(--ts-amber-100); color: var(--ts-amber-700); }
.pill.act { background: var(--ts-blue-100); color: var(--ts-blue-700); }
.pill.ok { background: var(--ts-green-100); color: var(--ts-green-700); }
.pill.mal { background: var(--ts-red-100); color: var(--ts-red-700); }
.contenido { padding: var(--ts-space-4); max-width: var(--ts-content-max); margin: 0 auto; }
.contenido.angosto { max-width: 42rem; }
.campana { color: var(--ts-green-700); width: var(--ts-touch-target); height: var(--ts-touch-target); display: grid; place-items: center; border-radius: var(--ts-radius-md); }
.campana svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.campana .tachado { display: none; }
.campana.off { color: var(--ts-text-muted); }
.campana.off .tachado { display: block; }

@media (min-width: 1024px) {
  .hero { background: none; color: var(--ts-text); text-align: left; padding: var(--ts-space-8) var(--ts-space-8) var(--ts-space-2); max-width: var(--ts-content-max); margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; column-gap: var(--ts-space-3); align-items: center; }
  .hero h1 { font-size: var(--ts-heading-lg); line-height: var(--ts-line-tight); grid-column: 2; }
  .hero .sub { color: var(--ts-text-muted); font-size: var(--ts-text-md); grid-column: 2; }
  .hero .atras { position: static; grid-row: 1 / 3; grid-column: 1; color: var(--ts-text); border: 1px solid var(--ts-border); background: var(--ts-surface); }
  .hero .atras.raiz { display: none; }
  .hero .pill { grid-column: 2; justify-self: start; }
  .hero .acciones { position: static; gap: var(--ts-space-3); grid-column: 3; grid-row: 1 / 3; }
  .hero .acciones .solo-pc { display: inline-flex; }
  .hero .acciones .campana { color: var(--ts-green-700); border: 1px solid var(--ts-border); background: var(--ts-surface); }
  .hero .acciones .campana.off { color: var(--ts-text-muted); }
  .contenido { padding: var(--ts-space-6) var(--ts-space-8); }
}

/* ---------- TARJETAS ---------- */
.card { background: var(--ts-surface); border: 1px solid var(--ts-border); border-radius: var(--ts-radius-lg); box-shadow: var(--ts-shadow-card); padding: var(--ts-space-5); margin-bottom: var(--ts-space-4); }
.card h3 { display: flex; align-items: center; gap: var(--ts-space-3); font-size: var(--ts-text-lg); font-weight: 750; color: var(--ts-text); margin-bottom: var(--ts-space-4); }
.card h3 svg.ic { width: 1.5rem; height: 1.5rem; color: var(--ts-blue-700); }
.card .cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--ts-space-2); }
.card .cab h3 { margin: 0; }
.enlace { color: var(--ts-blue-700); font-size: var(--ts-text-sm); font-weight: 700; padding: .35rem 0; min-height: var(--ts-touch-target); }
.enlace:hover { text-decoration: underline; }
.enlace:disabled, .btn-foto-insp:disabled { opacity: .45; }
.fila { display: flex; gap: .4rem; font-size: var(--ts-text-sm); margin-bottom: .4rem; }
.fila b { white-space: nowrap; }
.fila span { color: var(--ts-text-muted); word-break: break-word; }
.tarjetas-2 { display: grid; gap: var(--ts-space-4); align-items: start; }
.tarjetas-2 > .card { margin: 0; }
@media (min-width: 1024px) { .tarjetas-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- INICIO / RESUMEN ---------- */
.saludo-logo img { width: 4rem; height: 4rem; border-radius: var(--ts-radius-lg); object-fit: cover; background: #fff; border: 1px solid var(--ts-border); margin-bottom: var(--ts-space-3); }
.etapas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ts-space-3); margin-bottom: var(--ts-space-4); }
.etapa { position: relative; text-align: left; background: var(--ts-surface); border: 1px solid var(--ts-border); border-radius: var(--ts-radius-lg); box-shadow: var(--ts-shadow-card); padding: var(--ts-space-4); display: flex; flex-direction: column; gap: var(--ts-space-1); }
.etapa:hover { border-color: var(--ts-blue-600); }
.etapa .et-ico { width: 2.5rem; height: 2.5rem; border-radius: var(--ts-radius-md); display: grid; place-items: center; margin-bottom: var(--ts-space-2); }
.etapa .et-ico.pend { background: var(--ts-amber-100); color: var(--ts-amber-700); }
.etapa .et-ico.act { background: var(--ts-blue-100); color: var(--ts-blue-700); }
.etapa .et-ico.ok { background: var(--ts-green-100); color: var(--ts-green-700); }
.etapa p { color: var(--ts-text-muted); font-size: var(--ts-text-sm); font-weight: 600; }
.etapa strong { font-size: 2rem; line-height: 1; font-weight: 800; }
.etapa span { color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.dos-col { display: grid; gap: var(--ts-space-4); align-items: start; }
.dos-col > .card { margin: 0; }
@media (min-width: 1024px) {
  .etapas { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ts-space-4); margin-bottom: var(--ts-space-6); }
  .dos-col { grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr); gap: var(--ts-space-6); }
  .etapa strong { font-size: 2.25rem; }
}
.rec-fila { display: flex; align-items: center; gap: var(--ts-space-3); width: 100%; text-align: left; padding: var(--ts-space-3) 0; border-top: 1px solid var(--ts-border); min-height: var(--ts-touch-target); }
.rec-fila:first-of-type { border-top: 0; }
.rec-fila .datos { flex: 1; min-width: 0; line-height: 1.3; }
.rec-fila .datos b { display: block; font-size: var(--ts-text-md); }
.rec-fila .datos small { color: var(--ts-text-muted); font-size: var(--ts-text-sm); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-fila .flecha { color: var(--ts-text-muted); }
.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: var(--ts-radius-pill); padding: .15rem .65rem; font-size: var(--ts-text-xs); font-weight: 700; white-space: nowrap; }
.chip::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.chip.pend { color: var(--ts-amber-700); background: var(--ts-amber-100); }
.chip.act { color: var(--ts-blue-700); background: var(--ts-blue-100); }
.chip.ok { color: var(--ts-green-700); background: var(--ts-green-100); }
.uso h3 { margin-bottom: var(--ts-space-1); }
.uso .ayuda { margin: 0 0 var(--ts-space-4); }
.uso-fila { margin-bottom: var(--ts-space-4); }
.uso-fila:last-child { margin-bottom: 0; }
.uso-fila .top { display: flex; justify-content: space-between; gap: .5rem; font-size: var(--ts-text-sm); font-weight: 700; margin-bottom: .3rem; }
.uso-fila .top span { color: var(--ts-text-muted); font-weight: 600; font-size: var(--ts-text-xs); }
.uso-fila .top b { color: var(--ts-text); }
.uso-barra { height: .6rem; border-radius: var(--ts-radius-pill); background: var(--ts-surface-muted); overflow: hidden; }
.uso-barra i { display: block; height: 100%; border-radius: var(--ts-radius-pill); background: var(--ts-green-600); transition: width .5s var(--ts-ease); }

/* ---------- ÓRDENES (tablero por etapa) ---------- */
.barra-ord { display: flex; flex-direction: column; gap: var(--ts-space-3); margin-bottom: var(--ts-space-4); }
.seg-ord { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--ts-space-1); background: var(--ts-surface-muted); border-radius: var(--ts-radius-md); padding: var(--ts-space-1); }
.seg-ord button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: var(--ts-touch-target); padding: .2rem; border-radius: var(--ts-radius-sm); font-size: .7rem; font-weight: 700; color: var(--ts-text-muted); line-height: 1.15; text-align: center; }
.seg-ord button b { font-size: var(--ts-text-md); color: var(--ts-text); }
.seg-ord button.on { background: var(--ts-surface); color: var(--ts-green-700); box-shadow: var(--ts-shadow-card); }
.tablero { display: grid; gap: var(--ts-space-4); }
.tablero .col { display: none; }
.tablero[data-g=nuevas] .col[data-k=nuevas], .tablero[data-g=presupuesto] .col[data-k=presupuesto], .tablero[data-g=proceso] .col[data-k=proceso], .tablero[data-g=listas] .col[data-k=listas] { display: block; }
.col-cab { display: flex; align-items: center; justify-content: space-between; gap: var(--ts-space-2); margin-bottom: var(--ts-space-3); font-weight: 750; }
.col-cab .cuenta-col { min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem; border-radius: var(--ts-radius-pill); display: grid; place-items: center; font-size: var(--ts-text-xs); font-weight: 800; background: var(--ts-surface-muted); color: var(--ts-text); }
.oc { display: block; width: 100%; text-align: left; background: var(--ts-surface); border: 1px solid var(--ts-border); border-radius: var(--ts-radius-lg); box-shadow: var(--ts-shadow-card); padding: var(--ts-space-4); margin-bottom: var(--ts-space-3); }
.oc:hover { border-color: var(--ts-blue-600); }
.oc .fila-1 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--ts-space-1) var(--ts-space-2); }
.oc .placa { font-weight: 800; font-size: var(--ts-text-lg); letter-spacing: .02em; white-space: nowrap; }
.oc .cli { color: var(--ts-text-muted); font-size: var(--ts-text-sm); margin-top: .1rem; }
.oc .meta { color: var(--ts-text-muted); font-size: var(--ts-text-xs); margin-top: var(--ts-space-2); }
.vacio { text-align: center; color: var(--ts-text-muted); padding: var(--ts-space-8) var(--ts-space-4); font-size: var(--ts-text-sm); }
.vacio.caja { border: 1px dashed var(--ts-border); border-radius: var(--ts-radius-lg); padding: var(--ts-space-6) var(--ts-space-4); }
@media (min-width: 1024px) {
  .seg-ord { display: none; }
  .tablero { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
  .tablero .col { display: block !important; }
  .tablero .col { background: var(--ts-surface-muted); border-radius: var(--ts-radius-lg); padding: var(--ts-space-3); }
  .barra-ord { flex-direction: row; }
  .barra-ord input { max-width: 26rem; }
}

/* ---------- FORMULARIOS ---------- */
label { display: block; font-size: var(--ts-text-sm); font-weight: 700; margin-bottom: .3rem; color: var(--ts-text); }
input, select, textarea { width: 100%; min-height: var(--ts-touch-target); padding: .65rem .9rem; border: 1.5px solid var(--ts-border); border-radius: var(--ts-radius-md); background: var(--ts-surface); color: var(--ts-text); font: inherit; font-size: var(--ts-text-md); }
input::placeholder, textarea::placeholder { color: #8A98A6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ts-blue-600); box-shadow: 0 0 0 3px rgb(85 181 237 / 30%); }
input:disabled { background: var(--ts-surface-muted); color: var(--ts-text-muted); }
input[type=checkbox] { width: 1.3rem; min-height: 0; height: 1.3rem; accent-color: var(--ts-green-700); }
textarea { min-height: 5.5rem; resize: vertical; }
.campo { margin-bottom: var(--ts-space-4); }
.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ts-space-3); }
.btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: var(--ts-touch-target); padding: .7rem 1rem; border-radius: var(--ts-radius-md); font-weight: 700; font-size: var(--ts-text-md); color: #fff; background: var(--ts-green-700); margin-bottom: var(--ts-space-2); transition: background var(--ts-duration-fast) var(--ts-ease); }
.btn:hover { background: #12683C; }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ok { background: var(--ts-green-700); }
.btn.azul { background: var(--ts-blue-700); }
.btn.azul:hover { background: var(--ts-navy-800); }
.btn.wa { background: #1FA855; }
.btn.wa:hover { background: #178C46; }
.btn.gris { background: var(--ts-surface); color: var(--ts-text); border: 1px solid var(--ts-border); }
.btn.gris:hover { background: var(--ts-surface-muted); }
.btn.rojo { background: var(--ts-red-700); }
.btn.rojo:hover { background: #8F1B12; }
.btn.chico { padding: .5rem .9rem; font-size: var(--ts-text-sm); }
.btn.auto { width: auto; display: inline-flex; padding-left: var(--ts-space-5); padding-right: var(--ts-space-5); }
.btn svg.ic { width: 1.2rem; height: 1.2rem; }
.pestanas { display: flex; background: var(--ts-surface-muted); border-radius: var(--ts-radius-md); padding: var(--ts-space-1); margin-bottom: var(--ts-space-4); }
.pestanas button { flex: 1; min-height: var(--ts-touch-target); padding: .5rem; border-radius: var(--ts-radius-sm); font-weight: 700; color: var(--ts-text-muted); }
.pestanas button.on { background: var(--ts-surface); color: var(--ts-green-700); box-shadow: var(--ts-shadow-card); }
.nota { font-size: var(--ts-text-xs); color: var(--ts-text-muted); text-align: center; margin-top: .4rem; }
.banner { display: flex; align-items: center; gap: .7rem; background: var(--ts-amber-100); border: 1px solid #F0CF94; color: var(--ts-amber-700); border-radius: var(--ts-radius-md); padding: .75rem 1rem; margin-bottom: var(--ts-space-4); font-size: var(--ts-text-sm); font-weight: 700; }
.banner.urgente { background: var(--ts-red-100); border-color: #F2B8B2; color: var(--ts-red-700); }
.banner b { font-size: 1.4rem; line-height: 1; }
.ayuda { font-size: var(--ts-text-xs); color: var(--ts-text-muted); margin-top: .25rem; }
.paso-etq { font-size: var(--ts-text-xs); font-weight: 750; text-transform: uppercase; letter-spacing: .09em; color: var(--ts-blue-700); margin-bottom: var(--ts-space-2); }
.info-paso { background: var(--ts-blue-100); color: var(--ts-navy-800); border-radius: var(--ts-radius-md); padding: .75rem 1rem; font-size: var(--ts-text-sm); margin-bottom: var(--ts-space-3); }
.info-paso.ok { background: var(--ts-green-100); color: var(--ts-green-700); }
.info-paso.mal { background: var(--ts-red-100); color: var(--ts-red-700); }
.leyenda { font-size: var(--ts-text-xs); color: var(--ts-text-muted); margin: 0 0 var(--ts-space-3); }
.sec-form { font-size: var(--ts-text-xs); font-weight: 750; text-transform: uppercase; letter-spacing: .09em; color: var(--ts-blue-700); margin: var(--ts-space-5) 0 var(--ts-space-3); padding-top: var(--ts-space-4); border-top: 1px solid var(--ts-border); }
.sec-form:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- INSPECCIÓN, FOTOS, PRESUPUESTO, LISTAS ---------- */
.insp { padding: .6rem 0; border-bottom: 1px solid var(--ts-border); }
.insp:last-child { border-bottom: 0; }
.insp-fila { display: flex; justify-content: space-between; align-items: center; font-size: var(--ts-text-sm); font-weight: 650; }
.semaforo { display: flex; gap: .6rem; }
.dot { width: 2.2rem; height: 2.2rem; min-height: 0; border-radius: 50%; border: 3px solid transparent; opacity: .35; position: relative; }
.dot.verde { background: #2DB36A; }
.dot.amarillo { background: var(--ts-amber-500); }
.dot.rojo { background: #E5483B; }
.dot.on { opacity: 1; border-color: var(--ts-navy-900); }
.dot.on::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: #fff; opacity: .9; }
.insp-extra { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.insp-extra input { padding: .5rem .7rem; font-size: var(--ts-text-sm); }
.insp-extra button { flex: none; width: 2.75rem; height: 2.75rem; border-radius: var(--ts-radius-md); background: var(--ts-surface-muted); border: 1px solid var(--ts-border); }
.insp-extra img { width: 2.75rem; height: 2.75rem; border-radius: var(--ts-radius-sm); object-fit: cover; flex: none; }
.dot-mini { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.05rem; }
.logo-taller { width: 4.5rem; height: 4.5rem; border-radius: var(--ts-radius-lg); object-fit: cover; background: #fff; border: 1px solid var(--ts-border); margin: 0 auto .6rem; display: block; }
.miembro { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--ts-border); font-size: var(--ts-text-sm); word-break: break-all; }
.miembro:last-child { border-bottom: 0; }
.miembro small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.miembro button { color: var(--ts-red-700); font-size: var(--ts-text-sm); font-weight: 700; flex: none; min-height: var(--ts-touch-target); padding: 0 .5rem; }
.cliente { padding: .85rem 0; border-bottom: 1px solid var(--ts-border); cursor: pointer; }
.cliente:last-child { border-bottom: 0; }
.cliente:hover { background: var(--ts-bg); }
.cliente .fila-c { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.cliente b { font-size: var(--ts-text-md); }
.cliente small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-sm); margin-top: .1rem; }
.contador { flex: none; text-align: center; background: var(--ts-blue-100); color: var(--ts-blue-700); border-radius: var(--ts-radius-md); padding: .35rem .75rem; font-weight: 800; font-size: var(--ts-text-lg); line-height: 1.1; }
.contador small { font-weight: 700; font-size: .62rem; color: var(--ts-blue-700); margin: 0; }
.chico-cat { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 0; border-bottom: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.chico-cat small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.tira { display: flex; gap: .6rem; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: .5rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; }
.tira .foto { flex: none; width: 6.2rem; scroll-snap-align: start; }
.tira .foto div { width: 6.2rem; height: 6.2rem; border-radius: var(--ts-radius-md); overflow: hidden; background: var(--ts-surface-muted); cursor: zoom-in; }
.tira .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tira .foto small { display: block; text-align: center; font-size: var(--ts-text-xs); color: var(--ts-text-muted); margin-top: .15rem; }
.tira .agregar { flex: none; width: 6.2rem; height: 6.2rem; border: 2px dashed var(--ts-border); border-radius: var(--ts-radius-md); color: var(--ts-text-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: var(--ts-text-xs); gap: .2rem; }
.tira .agregar:hover { border-color: var(--ts-blue-600); color: var(--ts-blue-700); }
.tira .agregar svg.i { width: 1.8rem; height: 1.8rem; }
.item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.item small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
/* Respuesta del cliente a cada línea del presupuesto */
.aut-si, .aut-no { display: inline-block; margin-top: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: var(--ts-text-xs); font-weight: 800; letter-spacing: .02em; }
.aut-si { color: var(--ts-green-700); background: var(--ts-green-100); }
.aut-no { color: #fff; background: var(--ts-red-700); }
.item-no { background: var(--ts-red-100); margin: 0 calc(var(--ts-space-2) * -1); padding-left: var(--ts-space-2); padding-right: var(--ts-space-2); border-radius: var(--ts-radius-sm); }
.item-no > div:first-child { color: var(--ts-red-700); }
.item-no > div:last-child b { color: var(--ts-red-700); text-decoration: line-through; }
.item .quitar { color: var(--ts-red-700); padding: 0 .5rem; font-size: 1rem; min-height: var(--ts-touch-target); }
.total { display: flex; justify-content: space-between; align-items: center; margin-top: var(--ts-space-4); font-weight: 750; }
.total b { font-size: 1.5rem; color: var(--ts-navy-900); }
.detalle-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.detalle-grid > div { min-width: 0; }
.detalle-grid > div > .card:last-child { margin-bottom: var(--ts-space-4); }
@media (min-width: 1024px) {
  .detalle-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--ts-space-6); align-items: start; }
}

/* ---------- HOJAS, VISOR, AVISOS, DIÁLOGOS ---------- */
.hoja { display: none; position: fixed; inset: 0; background: rgb(11 20 34 / 55%); z-index: 50; align-items: flex-end; }
.hoja.on { display: flex; }
.hoja > div { background: var(--ts-surface); color: var(--ts-text); width: 100%; max-width: 32rem; margin: 0 auto; border-radius: var(--ts-radius-xl) var(--ts-radius-xl) 0 0; padding: var(--ts-space-5); padding-bottom: calc(var(--ts-space-5) + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; box-shadow: var(--ts-shadow-popover); }
.hoja h2 { font-size: var(--ts-heading-sm); margin-bottom: var(--ts-space-4); }
@media (min-width: 768px) {
  .hoja { align-items: center; }
  .hoja > div { border-radius: var(--ts-radius-xl); padding-bottom: var(--ts-space-5); max-height: 90vh; }
}
.visor { display: none; position: fixed; inset: 0; background: rgb(0 0 0 / 92%); z-index: 60; align-items: center; justify-content: center; }
.visor.on { display: flex; }
.visor img { max-width: 100%; max-height: 100%; }
#aviso { position: fixed; left: 1rem; right: 1rem; bottom: 5.5rem; max-width: 30rem; margin: 0 auto; padding: .9rem 1rem; border-radius: var(--ts-radius-md); z-index: 95; display: none; font-weight: 700; color: #fff; box-shadow: var(--ts-shadow-popover); }
#aviso.ok { background: var(--ts-green-700); display: block; }
#aviso.mal { background: var(--ts-red-700); display: block; }
@media (min-width: 1024px) { #aviso { bottom: 2rem; margin-left: auto; margin-right: 2rem; } }
.centro { text-align: center; padding: var(--ts-space-8) var(--ts-space-4); }
.dep { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.dep:last-child { border-bottom: 0; }
.dep small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.dep .est { font-size: var(--ts-text-xs); font-weight: 750; padding: .2rem .7rem; border-radius: var(--ts-radius-pill); white-space: nowrap; }
.est.pend { background: var(--ts-amber-100); color: var(--ts-amber-700); }
.est.apr { background: var(--ts-green-100); color: var(--ts-green-700); }
.est.rech { background: var(--ts-red-100); color: var(--ts-red-700); }
#dep-prev { display: none; width: 100%; max-height: 16rem; object-fit: contain; border-radius: var(--ts-radius-md); margin-bottom: var(--ts-space-3); background: var(--ts-surface-muted); }
.pago-texto { white-space: pre-wrap; }
#lg-canvas { display: block; width: 100%; max-width: 300px; aspect-ratio: 1; margin: 0 auto var(--ts-space-3); border-radius: var(--ts-radius-lg); border: 2px solid var(--ts-blue-600); touch-action: none; cursor: grab; background: #fff; }
.zoom { width: 100%; accent-color: var(--ts-green-700); margin-bottom: var(--ts-space-3); padding: 0; border: 0; background: none; min-height: 0; }
.dlg { display: none; position: fixed; inset: 0; background: rgb(11 20 34 / 60%); z-index: 90; align-items: center; justify-content: center; padding: 1.2rem; }
.dlg.on { display: flex; }
.dlg-caja { background: var(--ts-surface); border-radius: var(--ts-radius-xl); padding: var(--ts-space-6) var(--ts-space-5) var(--ts-space-5); width: 100%; max-width: 24rem; box-shadow: var(--ts-shadow-popover); animation: dlgIn .18s var(--ts-ease); }
.dlg-caja h3 { font-size: var(--ts-text-lg); font-weight: 800; color: var(--ts-text); margin-bottom: var(--ts-space-2); }
.dlg-caja p { color: var(--ts-text-muted); font-size: var(--ts-text-md); margin-bottom: var(--ts-space-5); }
.dlg-botones { display: flex; gap: var(--ts-space-3); }
.dlg-botones .btn { flex: 1; margin: 0; }
@keyframes dlgIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.instalar { position: fixed; left: .8rem; right: .8rem; bottom: calc(5.5rem + env(safe-area-inset-bottom)); max-width: 30rem; margin: 0 auto; z-index: 60; display: none; align-items: center; gap: .6rem; background: var(--ts-surface); border: 1px solid var(--ts-blue-600); border-radius: var(--ts-radius-lg); padding: .7rem .8rem; box-shadow: var(--ts-shadow-popover); }
.instalar b { flex: 1; font-size: var(--ts-text-sm); }
.instalar button { border-radius: var(--ts-radius-md); padding: .55rem .9rem; font-weight: 750; color: #fff; background: var(--ts-green-700); }
.instalar .x { background: none; color: var(--ts-text-muted); padding: .4rem .5rem; font-size: 1.1rem; }

/* hoja "Más" del celular */
.mas-lista { display: grid; gap: var(--ts-space-1); margin-bottom: var(--ts-space-3); }
.mas-lista .nav-item { color: var(--ts-text); border-radius: var(--ts-radius-md); }
.mas-lista .nav-item:hover { background: var(--ts-surface-muted); color: var(--ts-text); }
.mas-lista .nav-item svg.ic { color: var(--ts-blue-700); }
.mas-lista .nav-item .pronto { background: var(--ts-surface-muted); color: var(--ts-text-muted); }
.mas-lista .nav-item.on { background: var(--ts-green-100); color: var(--ts-green-700); }
.mas-quien { display: flex; align-items: center; gap: var(--ts-space-3); padding: 0 0 var(--ts-space-3); margin-bottom: var(--ts-space-3); border-bottom: 1px solid var(--ts-border); }
.mas-quien .avatar { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--ts-blue-700); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.mas-quien .avatar img { width: 100%; height: 100%; object-fit: cover; }
.mas-quien b { display: block; }
.mas-quien small { color: var(--ts-text-muted); }

/* ---------- ENTRADA (inicio de sesión, invitación, cuenta sin taller, acceso pausado) ---------- */
#v-auth, #v-invitacion, #v-unirme, #v-bloqueado { min-height: 100dvh; background: linear-gradient(180deg, rgb(7 17 30 / 50%), rgb(7 17 30 / 78%)), url('fondo-taller.svg') center bottom / cover no-repeat, var(--ts-navy-950); }
#v-auth .hero, #v-invitacion .hero, #v-unirme .hero, #v-bloqueado .hero { background: none; color: #fff; text-align: center; padding: calc(2rem + env(safe-area-inset-top)) var(--ts-space-5) var(--ts-space-5); }
#v-auth .hero h1, #v-invitacion .hero h1, #v-unirme .hero h1, #v-bloqueado .hero h1 { font-size: 1.6rem; font-weight: 800; }
#v-auth .hero .sub, #v-invitacion .hero .sub, #v-unirme .hero .sub { color: #B9C9D8; font-size: var(--ts-text-sm); }
.hero-marca { display: flex; flex-direction: column; align-items: center; gap: var(--ts-space-3); }
.hero-marca svg { width: 4.2rem; height: 4.7rem; }
.hero-marca .marca-txt { font-size: 1.8rem; }
.hero-puntos { display: none; }
#v-auth .contenido, #v-invitacion .contenido, #v-unirme .contenido, #v-bloqueado .contenido { max-width: 28rem; padding-top: 0; }
#v-auth .card, #v-invitacion .card, #v-unirme .card, #v-bloqueado .card { box-shadow: var(--ts-shadow-popover); border: 0; border-radius: var(--ts-radius-xl); padding: var(--ts-space-6) var(--ts-space-5); }
@media (min-width: 1024px) {
  #v-auth, #v-invitacion, #v-unirme, #v-bloqueado { display: none; }
  #v-auth.activa, #v-invitacion.activa, #v-unirme.activa, #v-bloqueado.activa { display: grid; grid-template-columns: 1fr minmax(24rem, 30rem); align-items: center; padding: 0 5vw; gap: 4vw; }
  #v-auth .hero, #v-invitacion .hero, #v-unirme .hero, #v-bloqueado .hero { text-align: left; padding: var(--ts-space-8) 0; display: block; max-width: none; margin: 0; }
  .hero-marca { align-items: flex-start; }
  .hero-marca svg { width: 5.5rem; height: 6.2rem; }
  .hero-marca .marca-txt { font-size: 2.6rem; }
  #v-auth .hero h1, #v-invitacion .hero h1 { font-size: 1.1rem; font-weight: 500; color: #B9C9D8; margin-top: var(--ts-space-2) !important; }
  .hero-puntos { display: grid; gap: var(--ts-space-4); margin-top: var(--ts-space-8); list-style: none; }
  .hero-puntos li { display: flex; align-items: center; gap: var(--ts-space-3); color: #E6EEF5; font-size: var(--ts-text-lg); font-weight: 600; }
  .hero-puntos svg.ic { width: 1.6rem; height: 1.6rem; color: #7FD6A4; background: rgb(255 255 255 / 8%); padding: .35rem; border-radius: var(--ts-radius-md); box-sizing: content-box; }
  #v-auth .contenido, #v-invitacion .contenido, #v-unirme .contenido, #v-bloqueado .contenido { width: 100%; padding: var(--ts-space-8) 0; }
}

/* ---------- CIFRAS (Mi Red) ---------- */
.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ts-space-3); }
.tarjetas-2 > .rejilla { grid-column: 1 / -1; }
.cuenta { background: var(--ts-surface); border: 1px solid var(--ts-border); border-radius: var(--ts-radius-lg); box-shadow: var(--ts-shadow-card); padding: var(--ts-space-4); text-align: center; display: flex; flex-direction: column; gap: .15rem; }
.cuenta b { font-size: var(--ts-heading-md); font-weight: 800; color: var(--ts-navy-900); }
.cuenta small { font-size: var(--ts-text-xs); color: var(--ts-text-muted); font-weight: 600; }

/* ---------- INICIO: ingresos del día ---------- */
.col-der { display: grid; gap: var(--ts-space-4); min-width: 0; }
.col-der > .card { margin: 0; }
.ing-cifra { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--ts-space-2) var(--ts-space-3); margin-bottom: var(--ts-space-3); }
.ing-cifra strong { font-size: 2rem; line-height: 1; font-weight: 800; color: var(--ts-navy-900); }
.delta { font-size: var(--ts-text-xs); font-weight: 750; padding: .15rem .6rem; border-radius: var(--ts-radius-pill); }
.delta.sube { background: var(--ts-green-100); color: var(--ts-green-700); }
.delta.baja { background: var(--ts-red-100); color: var(--ts-red-700); }
.delta.igual { background: var(--ts-surface-muted); color: var(--ts-text-muted); }
.grafico { width: 100%; height: auto; display: block; }
.grafico .barra { fill: var(--ts-blue-100); }
.grafico .barra.hoy { fill: var(--ts-green-600); }
.grafico .eje { stroke: var(--ts-border); stroke-width: 1; }
.grafico text { font-family: var(--ts-font-sans); fill: var(--ts-text-muted); font-size: 11px; text-anchor: middle; }
.grafico text.hoy { fill: var(--ts-green-700); font-weight: 700; }
.grafico text.valor { fill: var(--ts-text); font-size: 10px; font-weight: 700; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- EQUIPO ---------- */
.solo-movil { display: flex; }
@media (min-width: 1024px) { .solo-movil { display: none; } }
.eq-tabla { display: grid; }
.eq-fila { display: grid; gap: var(--ts-space-2) var(--ts-space-3); padding: var(--ts-space-4) 0; border-top: 1px solid var(--ts-border); grid-template-columns: 1fr auto; align-items: center; }
.eq-fila.cab { display: none; }
.eq-fila:first-child { border-top: 0; }
.eq-quien { display: flex; align-items: center; gap: var(--ts-space-3); min-width: 0; grid-column: 1; }
.eq-quien .avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--ts-blue-100); color: var(--ts-blue-700); display: grid; place-items: center; font-weight: 800; flex: none; }
.eq-quien b { display: block; line-height: 1.25; word-break: break-word; }
.eq-quien small { color: var(--ts-text-muted); font-size: var(--ts-text-sm); word-break: break-all; }
.eq-estado { grid-column: 2; grid-row: 1; justify-self: end; }
.eq-cargo { grid-column: 1 / -1; font-weight: 650; font-size: var(--ts-text-sm); }
.eq-mods { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--ts-space-1); }
.eq-acc { grid-column: 1 / -1; display: flex; gap: var(--ts-space-4); }
.eq-acc .quitar { color: var(--ts-red-700); }
.modchip { font-size: var(--ts-text-xs); font-weight: 650; padding: .1rem .55rem; border-radius: var(--ts-radius-pill); background: var(--ts-surface-muted); color: var(--ts-text); }
.modchip.base { background: var(--ts-blue-100); color: var(--ts-blue-700); }
.modchip.todos { background: var(--ts-green-100); color: var(--ts-green-700); }
@media (min-width: 1024px) {
  .eq-fila { grid-template-columns: minmax(10rem, 2fr) 7rem minmax(8rem, 2fr) 6.5rem 8.5rem; padding: var(--ts-space-3) 0; }
  .eq-fila.cab { display: grid; font-size: var(--ts-text-xs); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--ts-text-muted); padding: 0 0 var(--ts-space-3); }
  .eq-fila > * { grid-column: auto !important; grid-row: auto !important; justify-self: auto !important; }
  .eq-acc { justify-content: flex-end; }
}
.permiso { display: flex; gap: var(--ts-space-3); align-items: flex-start; padding: var(--ts-space-3); border: 1px solid var(--ts-border); border-radius: var(--ts-radius-md); margin-bottom: var(--ts-space-2); font-weight: 650; cursor: pointer; }
.permiso input { margin-top: .15rem; flex: none; }
.permiso span small { display: block; font-weight: 400; color: var(--ts-text-muted); font-size: var(--ts-text-sm); }
.permiso.fijo { background: var(--ts-surface-muted); cursor: default; }

/* ---------- PAGOS Y SUSCRIPCIÓN ---------- */
.plan-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ts-space-4); }
.plan-card .plan-etq { font-size: var(--ts-text-xs); font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--ts-blue-700); }
.plan-card .plan-nombre { font-size: var(--ts-heading-md); font-weight: 800; line-height: 1.2; }
.plan-card .plan-vence { color: var(--ts-text-muted); font-size: var(--ts-text-sm); margin-top: .1rem; }
.plan-precio { font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--ts-navy-900); }
.plan-precio small { font-size: var(--ts-text-md); font-weight: 600; color: var(--ts-text-muted); }
.plan-acciones { display: flex; flex-direction: column; align-items: stretch; gap: var(--ts-space-2); min-width: 12rem; }
.plan-acciones .btn { margin: 0; }
.pago-fila { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: var(--ts-space-3); align-items: center; padding: var(--ts-space-3) 0; border-top: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.pago-fila.cab { border-top: 0; padding-top: 0; font-size: var(--ts-text-xs); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--ts-text-muted); }
.pago-fila small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.pago-fila .est { font-size: var(--ts-text-xs); font-weight: 750; padding: .2rem .7rem; border-radius: var(--ts-radius-pill); white-space: nowrap; justify-self: end; }
.pago-fila.cab span:last-child { justify-self: end; }

/* ---------- MI RED: COMPARTE Y GANA ---------- */
.regalo-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ts-space-4); justify-items: center; text-align: center; background: linear-gradient(160deg, var(--ts-surface) 0%, var(--ts-green-100) 100%); }
.regalo-hero .regalo-img { width: 9rem; height: 9rem; }
.regalo-hero .regalo-img svg { width: 100%; height: 100%; }
.regalo-hero .cuerpo { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ts-space-3); width: 100%; min-width: 0; justify-items: center; }
.regalo-hero h2 { font-size: var(--ts-heading-md); font-weight: 800; line-height: 1.2; }
.regalo-hero p { color: var(--ts-text-muted); max-width: 34rem; font-size: var(--ts-text-sm); }
.regalo-hero .enlace-caja { display: flex; gap: var(--ts-space-2); width: 100%; max-width: 34rem; min-width: 0; }
.regalo-hero .enlace-caja .url { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 var(--ts-space-3); min-height: var(--ts-touch-target); background: var(--ts-surface); border: 1.5px solid var(--ts-border); border-radius: var(--ts-radius-md); font-size: var(--ts-text-sm); color: var(--ts-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.regalo-hero .enlace-caja .btn { width: auto; margin: 0; flex: none; }
.regalo-hero .codigo { font-weight: 800; letter-spacing: .12em; font-size: var(--ts-text-lg); color: var(--ts-green-700); }
.regalo-hero .btn.wa { max-width: 34rem; margin: 0; }
.stats-red { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ts-space-3); margin-bottom: var(--ts-space-4); }
.stats-red .cuenta b { font-size: 1.75rem; }
.stats-red .cuenta.verde b { color: var(--ts-green-700); }
@media (min-width: 1024px) {
  .stats-red { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .regalo-hero { grid-template-columns: auto minmax(0, 1fr); text-align: left; justify-items: start; align-items: center; column-gap: var(--ts-space-6); padding: var(--ts-space-6); }
  .regalo-hero .regalo-img { width: 11rem; height: 11rem; }
  .regalo-hero .cuerpo { justify-items: start; }
}
/* Vendedor: lista "Mis clientes" compacta, con scroll propio, estado y ícono de WhatsApp */
.cv-total { color: var(--ts-text-muted); font-weight: 600; font-size: var(--ts-text-sm); }
.cv-lista { max-height: 21rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--ts-border); border-radius: var(--ts-radius-md); padding: 0 var(--ts-space-3); scrollbar-width: thin; }
.cv-lista:focus-visible { outline: 2px solid var(--ts-green-600); outline-offset: 2px; }
.cli-vend { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--ts-space-2); align-items: center; padding: .55rem 0; border-top: 1px solid var(--ts-border); }
.cli-vend:first-child { border-top: 0; }
.cv-datos { min-width: 0; }
.cv-datos b { display: block; font-size: var(--ts-text-sm); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-datos small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); margin-top: .05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-vend .chip { font-size: .7rem; padding: .1rem .5rem; }
.cv-wa { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #1FA855; display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
.cv-wa:hover, .cv-wa:focus-visible { background: #178C46; }
.cv-wa svg { width: 1.3rem; height: 1.3rem; }
.cv-sin { width: 2.3rem; text-align: center; color: var(--ts-text-muted); }
.red-nivel { display: flex; justify-content: space-between; align-items: center; gap: var(--ts-space-3); padding: var(--ts-space-3) 0; border-top: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.red-nivel:first-of-type { border-top: 0; }
.red-nivel b { font-size: var(--ts-text-lg); }
.red-nivel small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.com-fila { display: flex; justify-content: space-between; gap: var(--ts-space-3); padding: var(--ts-space-3) 0; border-top: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.com-fila:first-child { border-top: 0; }
.com-fila small { display: block; color: var(--ts-text-muted); font-size: var(--ts-text-xs); }
.com-fila b { text-align: right; }

/* ---------- ESTADOS: cargando, vacío, error, sin conexión ---------- */
@keyframes brillo { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.esq { border-radius: var(--ts-radius-lg); background: linear-gradient(90deg, var(--ts-surface-muted) 25%, #F8FAFC 50%, var(--ts-surface-muted) 75%); background-size: 200% 100%; animation: brillo 1.4s linear infinite; margin-bottom: var(--ts-space-3); height: 5.5rem; }
.esq.fila { height: 3.2rem; border-radius: var(--ts-radius-md); }
.esq.alto { height: 9rem; }
@media (prefers-reduced-motion: reduce) { .esq { animation: none; } }
.estado { display: grid; justify-items: center; gap: var(--ts-space-2); text-align: center; padding: var(--ts-space-8) var(--ts-space-4); }
.estado .ico { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--ts-surface-muted); color: var(--ts-text-muted); display: grid; place-items: center; }
.estado .ico svg.ic { width: 1.6rem; height: 1.6rem; color: inherit; }
.estado.error .ico { background: var(--ts-red-100); color: var(--ts-red-700); }
.estado h4 { font-size: var(--ts-text-lg); font-weight: 750; }
.estado p { color: var(--ts-text-muted); font-size: var(--ts-text-sm); max-width: 28rem; }
.estado .btn { width: auto; margin: var(--ts-space-2) 0 0; padding-left: var(--ts-space-5); padding-right: var(--ts-space-5); }
#sin-red { display: none; position: sticky; top: 0; z-index: 100; background: var(--ts-amber-100); color: var(--ts-amber-700); border-bottom: 1px solid #F0CF94; text-align: center; padding: calc(.5rem + env(safe-area-inset-top)) var(--ts-space-4) .5rem; font-size: var(--ts-text-sm); font-weight: 700; }
body.sin-red #sin-red { display: block; }
@media (min-width: 1024px) { body.con-menu #sin-red { margin-left: var(--ts-sidebar-width); } }
.cargando-nota { color: var(--ts-text-muted); font-size: var(--ts-text-xs); }

/* ---------- FILTROS ---------- */
.chips-filtro { display: flex; gap: var(--ts-space-2); flex-wrap: wrap; }
.chip-btn { min-height: var(--ts-touch-target); padding: 0 var(--ts-space-3); border-radius: var(--ts-radius-pill); border: 1px solid var(--ts-border); background: var(--ts-surface); font-weight: 650; font-size: var(--ts-text-sm); color: var(--ts-text); }
.chip-btn:hover { border-color: var(--ts-blue-600); }
.chip-btn.on { background: var(--ts-green-100); color: var(--ts-green-700); border-color: var(--ts-green-600); }
.chip.mal { color: var(--ts-red-700); background: var(--ts-red-100); }
.oc .resp { display: flex; align-items: center; gap: .35rem; margin-top: var(--ts-space-2); font-size: var(--ts-text-xs); color: var(--ts-text-muted); }
.oc .resp svg.ic { width: .95rem; height: .95rem; }
.oc .resp.sin { color: var(--ts-amber-700); font-weight: 650; }

/* ---------- RECEPCIÓN GUIADA ---------- */
.pasos-nueva { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ts-space-2); margin-bottom: var(--ts-space-4); }
.paso-n { display: grid; justify-items: center; gap: .25rem; font-size: var(--ts-text-xs); font-weight: 650; color: var(--ts-text-muted); text-align: center; position: relative; }
.paso-n b { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--ts-surface-muted); color: var(--ts-text-muted); font-size: var(--ts-text-sm); }
.paso-n.on { color: var(--ts-text); }
.paso-n.on b { background: var(--ts-green-700); color: #fff; }
.paso-n.hecho b { background: var(--ts-green-100); color: var(--ts-green-700); }
.paso-n::after { content: ''; position: absolute; top: 1rem; left: calc(50% + 1.2rem); right: calc(-50% + 1.2rem); height: 2px; background: var(--ts-border); }
.paso-n:last-child::after { display: none; }
.paso-n.hecho::after { background: var(--ts-green-600); }
.n-cab { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ts-space-3); margin-bottom: var(--ts-space-3); }
.n-cab h3 { margin: 0; }
.borrador { font-size: var(--ts-text-xs); color: var(--ts-text-muted); }
.n-paso[hidden] { display: none; }
.n-resumen { display: grid; gap: 0; margin-bottom: var(--ts-space-4); border: 1px solid var(--ts-border); border-radius: var(--ts-radius-md); overflow: hidden; }
.n-resumen > div { display: flex; justify-content: space-between; gap: var(--ts-space-4); padding: var(--ts-space-3) var(--ts-space-4); border-top: 1px solid var(--ts-border); font-size: var(--ts-text-sm); }
.n-resumen > div:first-child { border-top: 0; }
.n-resumen dt { color: var(--ts-text-muted); flex: none; }
.n-resumen dd { font-weight: 650; text-align: right; word-break: break-word; }
/* Fotos de recepción: diagrama del vehículo con 4 cuadros (frente, izquierda, derecha, atrás) */
.fn-diagrama { display: grid; grid-template-columns: 1fr 1.05fr 1fr; gap: var(--ts-space-3) var(--ts-space-2); align-items: center; justify-items: center; max-width: 360px; margin: 0 auto var(--ts-space-3); }
.fn-celda { position: relative; width: 100%; max-width: 104px; aspect-ratio: 1; }
.c-frente { grid-column: 2; grid-row: 1; } .c-izq { grid-column: 1; grid-row: 2; } .c-der { grid-column: 3; grid-row: 2; } .c-atras { grid-column: 2; grid-row: 3; }
.fn-auto { grid-column: 2; grid-row: 2; width: 100%; max-width: 118px; height: auto; }
.fn-auto .carro { fill: #fff; stroke: var(--ts-navy-800); stroke-width: 3; }
.fn-auto .cristal { fill: #DCE6EF; stroke: var(--ts-navy-800); stroke-width: 2; }
.fn-auto .techo { fill: #F4F7FA; stroke: var(--ts-navy-800); stroke-width: 2; }
.fn-auto .linea { fill: none; stroke: var(--ts-navy-800); stroke-width: 2; stroke-linecap: round; }
.fn-auto .rueda { fill: var(--ts-navy-800); }
.fn { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: 0; margin: 0; border: 2px dashed var(--ts-border); border-radius: var(--ts-radius-md); background: #fff; color: var(--ts-text-muted); font: inherit; font-size: var(--ts-text-xs); font-weight: 600; cursor: pointer; position: relative; overflow: hidden; min-height: 0; }
.fn .ic { width: 1.6rem; height: 1.6rem; stroke: currentColor; }
.fn small { font-size: .68rem; font-weight: 500; opacity: .85; }
.fn.lleno { border: 2px solid var(--ts-green-600); }
.fn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fn-et { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(16, 32, 51, .75); color: #fff; font-size: .68rem; padding: .18rem 0; text-align: center; }
.fn-x { position: absolute; top: -9px; right: -9px; width: 28px; height: 28px; padding: 0; margin: 0; border: 2px solid #fff; border-radius: 50%; background: var(--ts-navy-900); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; min-height: 0; }
.fn-x[hidden] { display: none; }
.fn-cuenta { text-align: center; font-size: var(--ts-text-sm); color: var(--ts-text-muted); margin: 0 0 var(--ts-space-3); }

.n-botones { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ts-space-3); margin-top: var(--ts-space-2); }
.n-botones .btn { margin: 0; }
.n-botones .btn.solo { grid-column: 1 / -1; }
.aviso-borrador { display: flex; align-items: center; justify-content: space-between; gap: var(--ts-space-3); flex-wrap: wrap; }

/* ---------- VEHÍCULOS Y REPORTES ---------- */
.veh-lista { display: grid; gap: var(--ts-space-3); grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.veh-lista .oc { margin: 0; }
.rep-filtros { display: flex; gap: var(--ts-space-2); flex-wrap: wrap; margin-bottom: var(--ts-space-4); }
.rep-cifras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ts-space-3); margin-bottom: var(--ts-space-4); }
@media (min-width: 1024px) { .rep-cifras { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rep-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: var(--ts-space-6); align-items: start; } .rep-cols > .card { margin: 0; } }
.rep-cifras .cuenta b { font-size: 1.6rem; }
.rep-top { display: grid; gap: var(--ts-space-3); }
.rep-top .fila-top { display: grid; gap: .3rem; font-size: var(--ts-text-sm); }
.rep-top .fila-top .l { display: flex; justify-content: space-between; gap: var(--ts-space-3); }
.rep-top .fila-top small { color: var(--ts-text-muted); }
.rep-nota { color: var(--ts-text-muted); font-size: var(--ts-text-xs); margin-top: var(--ts-space-3); }
.rep-tabla summary { cursor: pointer; font-size: var(--ts-text-sm); font-weight: 650; color: var(--ts-blue-700); min-height: var(--ts-touch-target); display: flex; align-items: center; }
.rep-tabla table { width: 100%; border-collapse: collapse; font-size: var(--ts-text-sm); }
.rep-tabla th, .rep-tabla td { text-align: left; padding: .35rem 0; border-top: 1px solid var(--ts-border); }
.rep-tabla td:last-child, .rep-tabla th:last-child { text-align: right; }

/* ---------- AUTENTICACIÓN (según el diseño de referencia) ---------- */
.hero-lema { display: none; }
.hero-sub { color: #B9C9D8; font-size: var(--ts-text-sm); }
.con-icono { position: relative; }
.con-icono > svg.ic { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 1.2rem; height: 1.2rem; color: var(--ts-text-muted); pointer-events: none; }
.con-icono input { padding-left: 2.8rem; }
.con-icono .ojo { position: absolute; right: .2rem; top: 0; width: 2.75rem; height: 100%; display: grid; place-items: center; color: var(--ts-text-muted); }
.con-icono .ojo svg.ic { width: 1.2rem; height: 1.2rem; }
.auth-titulo { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.auth-sub { color: var(--ts-blue-700); font-size: var(--ts-text-sm); margin: .15rem 0 var(--ts-space-5); }
.auth-pie { text-align: center; font-size: var(--ts-text-sm); color: var(--ts-text-muted); margin-top: var(--ts-space-4); }
.auth-pie .enlace { display: block; margin: 0 auto; min-height: 0; padding: .2rem; color: var(--ts-green-700); font-weight: 750; }
@media (min-width: 1024px) {
  #v-auth .hero { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; align-self: stretch; min-height: 100dvh; position: relative; }
  .hero-marca svg { width: 5rem; height: 5.6rem; }
  #v-auth .hero-puntos li { font-size: var(--ts-text-lg); }
  #v-auth .hero-lema { display: block; position: absolute; left: 0; bottom: var(--ts-space-8); margin: 0; color: #E6EEF5; font-weight: 600; font-size: var(--ts-text-md); }
}

/* En las pantallas de entrada no hay menú: sin espacio extra debajo (evitaba una franja blanca y que la página bajara sola) */
body:not(.con-menu) main { padding-bottom: 0; }
body[data-v=auth], body[data-v=invitacion], body[data-v=unirme], body[data-v=bloqueado] { background: var(--ts-navy-950); }

/* Que nada ensanche la página en el celular (enlaces largos, tablas, etc.) */
#red-enlace-activo { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.tarjetas-2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .tarjetas-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contenido, .card { min-width: 0; }
main { overflow-x: clip; }
