/* Operación: inicio, pedidos y producción */
.volver { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; color: var(--grafito-suave); font-weight: 500; text-decoration: none; margin-bottom: .5rem; }
.volver:hover { color: var(--grafito); }
.vacio { color: var(--grafito-suave); margin: .5rem 0 0; }
.vacio a { color: var(--tiza); font-weight: 500; text-underline-offset: 3px; }
.bienvenida { display: grid; gap: 1rem; justify-items: start; max-width: 52ch; }
.bienvenida p { margin: 0; font-size: 1.15rem; }
.bloque { margin-top: 2rem; }
.bloque > .btn { margin-top: .75rem; }
.bloque-alerta .subtitulo { color: var(--tiza-hondo); }
.cifra-titulo { font-weight: 500; color: var(--grafito-suave); margin-left: .35rem; }
.mini-tit { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.txt-alerta { color: var(--tiza-hondo); font-weight: 500; }

/* Línea de flujo: cada etapa es una parada sobre una costura */
.linea-flujo { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: relative; }
.linea-flujo::before { content: ""; position: absolute; left: 8%; right: 8%; top: 22px; border-top: 2px dashed var(--linea-fuerte); }
.linea-flujo a { position: relative; display: grid; justify-items: center; gap: .35rem; padding: 0 2px; text-decoration: none; color: var(--grafito-suave); min-height: var(--toque); }
.lf-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--papel); border: 1.5px solid var(--linea-fuerte); font-size: 1.1rem; font-weight: 500; }
.linea-flujo .con .lf-n { background: var(--grafito); color: var(--hoja); border-color: var(--grafito); }
.linea-flujo .con a { color: var(--grafito); }
.lf-et { font-size: .8rem; font-weight: 500; text-align: center; line-height: 1.15; }
.resumen-cola { margin: 1.25rem 0 0; font-size: 1.05rem; }

/* Lista de pedidos */
.lista-pedidos { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .6rem; }
.fila-pedido {
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center;
  padding: .9rem 1rem; text-decoration: none; color: inherit;
  background: var(--hoja); border: 1px solid var(--linea-fuerte); border-radius: var(--r);
}
.fila-pedido:hover { border-color: var(--grafito-suave); }
.fp-cliente { font-weight: 400; font-size: 1.1rem; }
.fp-detalle, .fp-entrega { color: var(--grafito-suave); font-size: .95rem; }
.fp-saldo { justify-self: end; font-size: .95rem; }
.fila-pedido .avance { grid-column: 1 / -1; margin: .35rem 0 .15rem; }

.estado-et { justify-self: end; font-size: .8rem; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--papel-hondo); color: var(--grafito); white-space: nowrap; }
.e-anticipo { background: var(--cuidado-velo); color: var(--cuidado); }
.e-corte, .e-confeccion, .e-estampado { background: var(--grafito); color: var(--hoja); }
.e-listo { background: var(--bien-velo); color: var(--bien); }
.e-entregado { background: var(--tiza-velo); color: var(--tiza-hondo); }
.e-cobrado { background: var(--papel-hondo); color: var(--grafito-suave); }
.e-cancelado { background: transparent; color: var(--grafito-suave); text-decoration: line-through; }

/* Barra de avance como costura: lo hecho en línea continua, lo pendiente punteado */
.avance { position: relative; height: 6px; border-top: 2px dashed var(--linea-fuerte); }
.avance span { position: absolute; left: 0; top: -2px; height: 2px; background: var(--grafito); transition: width .45s cubic-bezier(.16, 1, .3, 1); }
.avance-grande { height: 10px; border-top-width: 3px; margin: .5rem 0 1rem; }
.avance-grande span { top: -3px; height: 3px; background: var(--tiza); }

.filtros { display: flex; gap: .5rem; overflow-x: auto; padding: 0 1rem .25rem; margin: 0 -1rem; scrollbar-width: none; }
.filtros .chip { font-family: var(--texto); font-weight: 500; white-space: nowrap; }
.filtros .chip .num { margin-left: .25rem; opacity: .75; }

/* Detalle del pedido */
.pedido-cab .estado-grande { display: inline-block; margin: .75rem 0 0; padding: 6px 12px; border-radius: 8px; font-weight: 400; }
.costura { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.costura li { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: .4rem; position: relative; }
.costura li::before { content: ""; position: absolute; top: 8px; left: -50%; right: 50%; border-top: 2px dashed var(--linea-fuerte); }
.costura li:first-child::before { display: none; }
.costura li.hecho::before, .costura li.actual::before { border-top-style: solid; border-color: var(--grafito); }
.punto { position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--papel); border: 2px solid var(--linea-fuerte); }
.costura .hecho .punto { background: var(--grafito); border-color: var(--grafito); }
.costura .actual .punto { background: var(--tiza); border-color: var(--tiza); box-shadow: 0 0 0 4px var(--tiza-velo); }
.costura-et { font-size: .78rem; font-weight: 500; color: var(--grafito-suave); text-align: center; }
.costura .actual .costura-et { color: var(--tiza-hondo); }

.accion { margin-top: 1.5rem; padding: 1rem 1.1rem; background: var(--hoja); border: 1px solid var(--grafito); border-radius: var(--r); display: grid; gap: .75rem; }
.accion p { margin: 0; }
.form-pago { display: grid; gap: .6rem; }
.desplegable { margin-top: 1rem; }
.desplegable summary { cursor: pointer; font-weight: 500; color: var(--tiza); min-height: 44px; display: flex; align-items: center; }
.pagos { list-style: none; margin: 0; padding: 0; }
.pagos li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--linea); }
.tallas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; margin-top: .75rem; }
.tallas label { display: grid; gap: .2rem; text-align: center; font-weight: 500; }
.tallas input { text-align: center; padding: .5rem .2rem; font-family: var(--cifra); }
.tallas + .ayuda { margin-top: .5rem; }
.correcciones { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--linea); }
.btn-peligro { color: var(--tiza-hondo); border-color: var(--tiza-hondo); }
.btn-peligro:hover { background: var(--tiza-velo); }

/* Producción: para usarse con prisa en el taller */
#produccion-lista { display: grid; gap: 1rem; }
.trabajo { background: var(--hoja); border: 1px solid var(--linea-fuerte); border-radius: var(--r); padding: 1.1rem; }
.trabajo-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.trabajo-cliente { font-size: 1.3rem; font-weight: 400; }
.trabajo-tallas { margin: .6rem 0 0; font-weight: 500; }
.trabajo-cuenta { margin: .75rem 0 0; font-size: 1.1rem; }
.trabajo-cuenta strong { font-size: 2.5rem; letter-spacing: -0.03em; line-height: 1; }
.trabajo-botones { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: .5rem; }
.trabajo-botones .btn { min-height: 60px; font-size: 1.3rem; font-family: var(--cifra); }
.trabajo-botones .btn:last-child { grid-column: 1 / -1; font-family: var(--texto); font-size: 1.05rem; min-height: var(--toque); }

/* Más */
.menu-mas { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea); }
.menu-mas a { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem .25rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--linea); min-height: 64px; }
.menu-mas a:hover { background: var(--papel-hondo); }
.menu-mas strong { display: block; }
.menu-mas small { display: block; color: var(--grafito-suave); font-size: .95rem; }
.menu-mas .flecha { color: var(--grafito-suave); }
.proximamente { margin-top: 1.5rem; }

/* Navegación de 5 pestañas en celular */
.nav-item { font-size: .8rem; }

@media (min-width: 960px) {
  .nav { grid-template-columns: 1fr; }
  .nav-item { font-size: .875rem; }
  .pedido-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  #produccion-lista { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  .filtros { margin: 0; padding: 0 0 .25rem; }
  #inicio-contenido, #pedido-detalle { max-width: 900px; }
}

/* Evita que contenido ancho estire la columna principal */
.app { grid-template-columns: minmax(0, 1fr); }
.contenido { min-width: 0; }
.costura-et { font-size: .72rem; }
@media (min-width: 960px) { .app { grid-template-columns: var(--ancho-nav) minmax(0, 1fr); } .costura-et { font-size: .8rem; } }

/* Casa Hebra: cifras grandes delgadas */
.trabajo-cuenta strong { font-weight: 300; font-size: 3rem; }
.lf-n { font-weight: 400; }
.fp-cliente, .trabajo-cliente { font-weight: 500; }
.pedido-cab .estado-grande { font-weight: 500; letter-spacing: .02em; }

/* El atributo hidden siempre gana, aunque el elemento tenga display propio */
[hidden] { display: none !important; }

/* Navegación: las pestañas sin permiso desaparecen sin dejar huecos */
.nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }

/* Acceso por documento */
.acceso { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--papel); }
.acceso-caja { width: 100%; max-width: 380px; display: grid; justify-items: center; text-align: center; }
.acceso-logo { width: 88px; height: 88px; }
.acceso-marca { margin-top: 1.25rem; font-weight: 300; font-size: 1.9rem; letter-spacing: .28em; text-transform: uppercase; padding-left: .28em; }
.acceso-sub { margin: .35rem 0 0; color: var(--grafito-suave); letter-spacing: .04em; }
.acceso-form { width: 100%; margin-top: 2.25rem; display: grid; gap: 1rem; text-align: left; }
.acceso-form .campo { margin-top: 0; }
.acceso-form input { font-size: 1.4rem; font-weight: 300; letter-spacing: .06em; text-align: center; font-variant-numeric: tabular-nums; }
.acceso-form .btn { width: 100%; }
.acceso-error { margin: 0; min-height: 1.4em; color: var(--tiza-hondo); font-weight: 500; text-align: center; }
.acceso-error:empty { min-height: 0; }
.acceso-estado { margin-top: 2.25rem; color: var(--grafito-suave); }
.acceso-bloqueado { margin-top: 2.25rem; display: grid; gap: 1rem; justify-items: center; }
.acceso-bloqueado p { margin: 0; }

.sesion-actual { margin: 0 0 1rem; color: var(--grafito-suave); }
.sesion-actual strong { color: var(--grafito); font-weight: 500; }
.btn-salir { margin-top: 1.5rem; }

/* Personas y permisos */
.nueva-persona { margin-bottom: 2rem; }
.nueva-persona > summary { list-style: none; display: inline-flex; width: auto; }
.nueva-persona > summary::-webkit-details-marker { display: none; }
.nueva-persona[open] > summary { margin-bottom: 1rem; }
.form-persona { padding: 1.1rem; background: var(--hoja); border: 1px solid var(--linea-fuerte); border-radius: var(--r); }
.form-persona > .btn { width: 100%; margin-top: 1rem; }

.matriz { display: grid; gap: .6rem; margin-top: 1rem; }
.matriz-modulo { margin: 0; padding: .6rem .9rem .8rem; border: 1px solid var(--linea); border-radius: 10px; background: var(--papel); }
.matriz-modulo.activo { border-color: var(--grafito-suave); background: var(--hoja); }
.matriz-modulo legend { padding: 0 .4rem; font-weight: 500; }
.matriz-acciones { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.casilla { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; }
.casilla input { width: 22px; height: 22px; accent-color: var(--grafito); }

.lista-personas { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.persona { padding: 1rem 1.1rem; background: var(--hoja); border: 1px solid var(--linea-fuerte); border-radius: var(--r); }
.persona.inactiva { opacity: .7; }
.persona-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.persona-nombre { margin: 0; font-size: 1.15rem; font-weight: 500; }
.persona-nombre .estado-et { margin-left: .35rem; vertical-align: 2px; }
.persona-modulos { margin: .6rem 0 0; color: var(--grafito-suave); }
.persona .fila-botones { margin-top: .75rem; }
.persona .matriz + .btn { margin-top: 1rem; width: 100%; }

@media (min-width: 960px) {
  .nav { grid-auto-flow: row; grid-auto-columns: auto; }
  #vista-personas { max-width: 820px; }
}

/* Inventario */
.segmentos-2 { grid-template-columns: repeat(2, 1fr); }
#inv-filtros { margin-bottom: 1rem; }
.inv-lista { display: grid; gap: 1rem; }
.item { padding: 1rem 1.1rem; background: var(--hoja); border: 1px solid var(--linea-fuerte); border-radius: var(--r); }
.item-bajo { border-color: var(--tiza-hondo); }
.item-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.item-nombre { font-size: 1.2rem; font-weight: 500; }
.item-color { font-weight: 300; color: var(--grafito-suave); }
.item-cantidad { margin: .75rem 0 .5rem; }
.item-cantidad strong { font-size: 2.4rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
.item-cantidad span { color: var(--grafito-suave); margin-left: .25rem; }
.item-valor { margin: .5rem 0 0; font-size: .95rem; color: var(--grafito-suave); }
.item-acciones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.item-acciones .btn { min-height: 44px; padding: 0 .9rem; font-size: .95rem; }
.form-mov { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--linea-fuerte); display: grid; gap: .25rem; }
.form-mov .campo { margin-top: .5rem; }
.form-mov .btn { margin-top: .75rem; }

/* Existencia: lo que hay sobre una cinta, con la marca del mínimo */
.existencia { position: relative; height: 10px; border-radius: 999px; background: var(--papel-hondo); overflow: visible; }
.existencia-hay { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--grafito); transition: width .45s cubic-bezier(.16, 1, .3, 1); }
.existencia.bajo .existencia-hay { background: var(--tiza); }
.existencia-min { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--tiza-hondo); }

.movimientos { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--linea); }
.movimientos li { display: grid; grid-template-columns: 5rem 1fr auto; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--linea); }
.mov-cant { font-weight: 500; }
.mov-cant.entra { color: var(--bien); }
.mov-cant.sale { color: var(--tiza-hondo); }
.mov-texto small { display: block; color: var(--grafito-suave); font-size: .85rem; }
.mov-saldo { color: var(--grafito-suave); }

.material-vinculo { grid-column: 1 / -1; min-height: 44px; font-size: .95rem; padding: .4rem .6rem; }
.accion-aviso { border-color: var(--cuidado); background: var(--cuidado-velo); }

.lista-stock { list-style: none; margin: .75rem 0 0; padding: 0; border-top: 1px solid var(--linea); }
.lista-stock a { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem .25rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--linea); min-height: 48px; }
.lista-stock a:hover { background: var(--papel-hondo); }
.lista-stock .num { color: var(--tiza-hondo); font-weight: 500; }

@media (min-width: 960px) {
  .inv-lista { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
}
