@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&display=swap");

/* Santifer: estilos de componentes. Todos los valores salen de tokens.css (var(--…)). */

body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 24px; background: var(--fondo); color: var(--tinta); -webkit-font-smoothing: antialiased; }
.sf-lienzo { padding: var(--espacio-4); display: flex; flex-wrap: wrap; gap: var(--espacio-3); align-items: flex-start; }
.sf-pila { display: flex; flex-direction: column; gap: var(--espacio-3); }
.sf-fila { display: flex; gap: var(--espacio-3); align-items: center; flex-wrap: wrap; }
.sf-cifra { font-variant-numeric: tabular-nums; }
.sf-codigo { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .02em; }
.sf-secundario { color: var(--tinta-suave); font-size: 14px; line-height: 20px; }
.sf-etiqueta { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--tinta); }
.sf-nota { font-size: 12px; line-height: 16px; color: var(--tinta-suave); }
.sf-icono { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:where(.sf-boton, .sf-campo__entrada, .sf-check input, .sf-resultado, .sf-tarjeta-ot, .sf-patron__punto):focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }

/* Botón de mostrador */
.sf-boton { display: inline-flex; align-items: center; justify-content: center; gap: var(--espacio-2); min-height: var(--control-lg); padding: 0 var(--espacio-6); box-sizing: border-box; border-radius: var(--radio-md); border: 1px solid var(--linea-fuerte); background: var(--superficie); color: var(--tinta); font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; }
.sf-boton:hover { background: var(--superficie-hundida); }
.sf-boton--primario { background: var(--primario); border-color: var(--primario); color: var(--sobre-primario); }
.sf-boton--primario:hover { background: var(--primario-hover); }
.sf-boton--peligro { border-color: var(--peligro); color: var(--peligro); }
.sf-boton--peligro.sf-boton--lleno { background: var(--peligro); color: var(--sobre-peligro); }
.sf-boton--md { min-height: var(--control-md); font-size: 15px; padding: 0 var(--espacio-4); }
.sf-boton--sm { min-height: var(--control-sm); font-size: 14px; padding: 0 var(--espacio-3); border-radius: var(--radio-sm); }
.sf-boton--ancho { width: 100%; }
.sf-boton[disabled] { background: var(--superficie-hundida); border-color: var(--linea); color: var(--tinta-tenue); cursor: not-allowed; }

/* Chip de estado: siempre con palabra, nunca solo color */
.sf-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--espacio-3); border-radius: var(--radio-pastilla); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; }
.sf-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.sf-chip--recibido { background: var(--estado-recibido-fondo); color: var(--estado-recibido); }
.sf-chip--diagnostico { background: var(--estado-diagnostico-fondo); color: var(--estado-diagnostico); }
.sf-chip--esperando-pieza { background: var(--estado-esperando-pieza-fondo); color: var(--estado-esperando-pieza); }
.sf-chip--reparacion { background: var(--estado-reparacion-fondo); color: var(--estado-reparacion); }
.sf-chip--taller-externo { background: var(--estado-taller-externo-fondo); color: var(--estado-taller-externo); }
.sf-chip--listo { background: var(--estado-listo-fondo); color: var(--estado-listo); }
.sf-chip--no-reparado { background: var(--estado-no-reparado-fondo); color: var(--estado-no-reparado); }
.sf-chip--entregado { background: var(--estado-entregado-fondo); color: var(--estado-entregado); }
.sf-chip--anulado { background: var(--estado-anulado-fondo); color: var(--estado-anulado); }
.sf-chip--abandonado { background: var(--estado-abandonado-fondo); color: var(--estado-abandonado); }

/* Semáforo de stock: la marca cambia de forma (llena, media, vacía) además de color */
.sf-stock { display: inline-flex; align-items: center; gap: var(--espacio-2); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tinta); }
.sf-stock__marca { width: 12px; height: 12px; border-radius: 50%; border: 2px solid; box-sizing: border-box; flex: none; }
.sf-stock--si .sf-stock__marca { border-color: var(--stock-si); background: var(--stock-si); }
.sf-stock--pedir .sf-stock__marca { border-color: var(--stock-pedir); background: linear-gradient(90deg, var(--stock-pedir) 50%, transparent 50%); }
.sf-stock--sin .sf-stock__marca { border-color: var(--stock-sin); }
.sf-stock__detalle { color: var(--tinta-suave); }

/* Campos de formulario */
.sf-campo { display: flex; flex-direction: column; gap: 6px; }
.sf-campo__entrada { min-height: var(--control-md); padding: 0 var(--espacio-3); border: 1px solid var(--linea-fuerte); border-radius: var(--radio-md); background: var(--superficie); color: var(--tinta); font: inherit; font-size: 16px; box-sizing: border-box; width: 100%; }
.sf-campo__entrada::placeholder { color: var(--tinta-suave); }
.sf-campo__entrada[aria-invalid="true"] { border-color: var(--peligro); }
.sf-campo__entrada.sf-codigo { font-family: var(--font-mono); font-size: 16px; }
.sf-campo__ayuda { display: flex; align-items: center; gap: var(--espacio-1); font-size: 13px; line-height: 18px; color: var(--tinta-suave); }
.sf-campo__ayuda .sf-icono { width: 16px; height: 16px; }
.sf-campo__ayuda--ok { color: var(--exito); }
.sf-campo__ayuda--error { color: var(--peligro); }
.sf-campo__grupo { display: flex; gap: var(--espacio-2); }
.sf-check { display: flex; gap: var(--espacio-3); align-items: flex-start; font-size: 15px; line-height: 22px; }
.sf-check input { width: 22px; height: 22px; accent-color: var(--primario); margin: 0; flex: none; }
.sf-formulario { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--espacio-5); padding: var(--espacio-4); box-sizing: border-box; }
.sf-encontrado { display: flex; gap: var(--espacio-2); align-items: center; padding: var(--espacio-2) var(--espacio-3); border-radius: var(--radio-md); background: var(--exito-suave); color: var(--tinta); font-size: 14px; }
.sf-encontrado .sf-icono { color: var(--exito); width: 18px; height: 18px; }

/* Buscador de modelo */
.sf-buscador { width: 100%; max-width: 440px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-lg); box-shadow: var(--sombra-flotante); overflow: hidden; }
.sf-buscador__barra { display: flex; align-items: center; gap: var(--espacio-2); padding: 0 var(--espacio-4); min-height: var(--control-lg); border-bottom: 1px solid var(--linea); color: var(--tinta-suave); }
.sf-buscador__barra input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 18px; color: var(--tinta); flex: 1; min-width: 0; }
.sf-resultado { display: flex; align-items: center; gap: var(--espacio-3); padding: var(--espacio-2) var(--espacio-4); min-height: 56px; box-sizing: border-box; color: var(--tinta); text-decoration: none; }
.sf-resultado[aria-selected="true"] { background: var(--acento-suave); }
.sf-resultado__foto { width: 40px; height: 40px; border-radius: var(--radio-sm); background: var(--superficie-hundida); color: var(--tinta-suave); display: grid; place-items: center; flex: none; }
.sf-resultado__nombre { font-weight: 600; }
.sf-resultado__nombre mark { background: transparent; color: inherit; text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sf-resultado__tipo { margin-left: auto; font-size: 13px; color: var(--tinta-suave); }
.sf-buscador__pie { padding: var(--espacio-2) var(--espacio-4); border-top: 1px solid var(--linea); font-size: 13px; color: var(--tinta-suave); }

/* Tarjeta de OT */
.sf-tarjeta-ot { display: flex; flex-direction: column; gap: 6px; width: 300px; padding: var(--espacio-4); box-sizing: border-box; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-lg); box-shadow: var(--sombra-tarjeta); color: var(--tinta); text-decoration: none; }
.sf-tarjeta-ot__cabecera { display: flex; justify-content: space-between; align-items: center; gap: var(--espacio-2); }
.sf-tarjeta-ot__numero { font-size: 18px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sf-tarjeta-ot__equipo { font-weight: 600; }
.sf-tarjeta-ot__averia { font-size: 14px; line-height: 20px; }
.sf-tarjeta-ot__pie { display: flex; justify-content: space-between; gap: var(--espacio-2); font-size: 13px; line-height: 18px; color: var(--tinta-suave); }
.sf-tarjeta-ot--atascada { border-color: var(--aviso); }
.sf-tarjeta-ot__alerta { display: flex; align-items: center; gap: var(--espacio-1); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--aviso); }
.sf-tarjeta-ot__alerta .sf-icono { width: 16px; height: 16px; }

/* Tabla de servicios */
.sf-servicios { width: 100%; max-width: 560px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-lg); overflow: hidden; }
.sf-servicios__cabecera { display: flex; align-items: center; gap: var(--espacio-3); padding: var(--espacio-4); }
.sf-servicios__grupo { padding: 6px var(--espacio-4); background: var(--superficie-hundida); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--tinta-suave); border-top: 1px solid var(--linea); }
.sf-servicios__fila { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--espacio-1) var(--espacio-3); align-items: center; padding: var(--espacio-3) var(--espacio-4); border-top: 1px solid var(--linea); }
.sf-servicios__fila input { width: 22px; height: 22px; accent-color: var(--primario); margin: 0; }
.sf-servicios__nombre { font-weight: 600; }
.sf-servicios__fila .sf-stock { grid-column: 2 / 4; }
.sf-servicios__precio { font-size: 20px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sf-servicios__presupuesto { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--tinta-suave); white-space: nowrap; }
.sf-servicios__accion { display: flex; align-items: center; justify-content: space-between; gap: var(--espacio-3); padding: var(--espacio-4); border-top: 1px solid var(--linea); }
.sf-nivel { display: inline-block; margin-left: var(--espacio-2); padding: 1px 8px; border-radius: var(--radio-pastilla); font-size: 12px; line-height: 18px; font-weight: 700; vertical-align: 1px; }
.sf-nivel--original { background: var(--primario); color: var(--sobre-primario); }
.sf-nivel--premium { background: var(--acento-suave); color: var(--acento); }
.sf-nivel--compatible { background: var(--superficie-hundida); color: var(--tinta); border: 1px solid var(--linea); }

/* Patrón de desbloqueo 3×3 */
.sf-patron { position: relative; width: 168px; height: 168px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; background: var(--superficie-hundida); border-radius: var(--radio-lg); }
.sf-patron__punto { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; background: var(--linea-fuerte); cursor: pointer; }
.sf-patron__punto--activo { background: var(--primario); box-shadow: 0 0 0 6px var(--acento-suave); }
.sf-patron svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sf-patron polyline { stroke: var(--primario); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* Firma */
.sf-firma { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: var(--espacio-2); }
.sf-firma__zona { position: relative; height: 160px; background: var(--superficie); border: 1px dashed var(--linea-fuerte); border-radius: var(--radio-lg); overflow: hidden; }
.sf-firma__zona svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-firma__zona path { stroke: var(--tinta); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sf-firma__linea { position: absolute; left: 24px; right: 24px; bottom: 40px; border-bottom: 1px solid var(--linea-fuerte); }
.sf-firma__guia { position: absolute; left: 24px; bottom: 14px; font-size: 13px; color: var(--tinta-suave); }

/* Captura de fotos */
.sf-fotos { display: flex; flex-direction: column; gap: var(--espacio-3); max-width: 340px; }
.sf-fotos__rejilla { display: grid; grid-template-columns: repeat(3, 96px); gap: var(--espacio-2); }
.sf-foto { position: relative; width: 96px; height: 96px; box-sizing: border-box; border-radius: var(--radio-md); background: var(--superficie-hundida); border: 1px solid var(--linea); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; color: var(--tinta-suave); overflow: hidden; }
.sf-foto--hecha { background: var(--primario); color: var(--sobre-primario); border-color: var(--primario); }
.sf-foto--hecha .sf-icono { width: 36px; height: 36px; stroke-width: 1.5; }
.sf-foto--vacia { border: 1px dashed var(--linea-fuerte); }
.sf-foto__rotulo { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: var(--radio-sm); background: var(--superficie); color: var(--tinta); font-size: 12px; line-height: 16px; font-weight: 600; }
.sf-aviso { display: flex; gap: var(--espacio-2); align-items: flex-start; padding: var(--espacio-2) var(--espacio-3); border-radius: var(--radio-md); background: var(--aviso-suave); color: var(--tinta); font-size: 14px; line-height: 20px; }
.sf-aviso .sf-icono { color: var(--aviso); width: 18px; height: 18px; margin-top: 1px; }

/* Bandeja «Hoy» */
.sf-hoy { width: 100%; max-width: 440px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-lg); overflow: hidden; }
.sf-hoy__cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--espacio-1) var(--espacio-3); padding: var(--espacio-4); background: var(--arena); color: var(--tinta); }
.sf-hoy__titulo { margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; }
.sf-hoy__fecha { font-size: 14px; }
.sf-hoy__grupo { display: flex; justify-content: space-between; align-items: center; padding: 6px var(--espacio-4); background: var(--superficie-hundida); border-top: 1px solid var(--linea); font-size: 13px; line-height: 18px; font-weight: 700; color: var(--tinta-suave); }
.sf-hoy__tarea { display: flex; align-items: center; gap: var(--espacio-3); padding: var(--espacio-3) var(--espacio-4); border-top: 1px solid var(--linea); }
.sf-hoy__tarea > .sf-icono { color: var(--tinta-suave); }
.sf-hoy__texto { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; }
.sf-hoy__texto strong { display: block; font-size: 15px; }
.sf-contador { min-width: 24px; height: 24px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radio-pastilla); background: var(--primario); color: var(--sobre-primario); font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; }

/* Resumen de caja */
.sf-caja { width: 100%; max-width: 380px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-lg); padding: var(--espacio-4); box-sizing: border-box; }
.sf-caja__titulo { margin: 0 0 var(--espacio-2); font-size: 20px; line-height: 26px; font-weight: 700; }
.sf-caja__fila { display: flex; justify-content: space-between; align-items: baseline; gap: var(--espacio-3); padding: var(--espacio-2) 0; border-bottom: 1px solid var(--linea); font-variant-numeric: tabular-nums; }
.sf-caja__fila--total { border-bottom: 0; padding-top: var(--espacio-3); font-size: 28px; line-height: 32px; font-weight: 700; }
.sf-caja__fila--total span:first-child { font-size: 16px; }
.sf-caja__descuadre { color: var(--peligro); font-weight: 700; }
.sf-caja__cuadra { color: var(--exito); font-weight: 700; }

/* Resguardo de 80 mm: papel blanco y tinta negra en cualquier tema */
.sf-ticket { width: 302px; box-sizing: border-box; padding: 16px 14px; background: #ffffff; color: #000000; font-family: var(--font-sans); font-size: 12px; line-height: 16px; box-shadow: var(--sombra-tarjeta); }
.sf-ticket__logo { display: block; width: 52px; height: 52px; margin: 0 auto 6px; filter: invert(1); }
.sf-ticket__centro { text-align: center; }
.sf-ticket__titulo { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sf-ticket__ot { font-size: 24px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sf-ticket hr { border: 0; border-top: 1px dashed #000000; margin: 8px 0; }
.sf-ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; }
.sf-ticket dt { font-weight: 700; }
.sf-ticket dd { margin: 0; }
.sf-ticket__firma { height: 40px; border-bottom: 1px solid #000000; margin-top: 8px; }
.sf-ticket__qr { display: flex; gap: 8px; align-items: center; }
.sf-ticket__qr svg { width: 64px; height: 64px; flex: none; }
.sf-ticket__qr rect { fill: #000000; }
.sf-ticket__legal { font-size: 10px; line-height: 13px; }
.sf-ticket__fiscal { margin-top: 8px; padding: 4px; border: 1px solid #000000; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Etiqueta de cajón (62 × 37 mm) */
.sf-etiqueta-cajon { width: 236px; height: 142px; box-sizing: border-box; padding: 10px 12px; background: #ffffff; color: #000000; border: 1px solid #000000; border-radius: 6px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto 1fr; gap: 2px 10px; font-family: var(--font-sans); }
.sf-etiqueta-cajon__cajon { grid-row: 1 / 3; font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.01em; }
.sf-etiqueta-cajon__pieza { font-size: 13px; line-height: 16px; font-weight: 700; }
.sf-etiqueta-cajon__modelo { font-size: 12px; line-height: 15px; }
.sf-etiqueta-cajon__barras { grid-column: 1 / 3; align-self: end; text-align: center; }
.sf-etiqueta-cajon__barras svg { display: block; width: 100%; height: 30px; }
.sf-etiqueta-cajon__barras rect { fill: #000000; }
.sf-etiqueta-cajon__codigo { font-family: var(--font-mono); font-size: 11px; line-height: 13px; }
