/* ══════════════════════════════════════════════
   VARIABLES GLOBALES
   Como la paleta de colores de la heladería:
   cambias un color aquí y cambia en toda la app
══════════════════════════════════════════════ */
:root {
  --color-primario: #4f46e5;
  --color-primario-hover: #4338ca;
  --color-primario-suave: #ede9fe;
  --color-fondo: #f4f6fb;
  --color-superficie: #ffffff;
  --color-texto: #1e293b;
  --color-texto-suave: #64748b;
  --color-borde: #e2e8f0;
  --color-peligro: #ef4444;
  --radio-borde: 14px;
  --sombra: 0 2px 12px rgba(79,70,229,0.07), 0 1px 3px rgba(0,0,0,0.06);
  --sombra-elevada: 0 8px 24px rgba(79,70,229,0.13), 0 2px 6px rgba(0,0,0,0.07);
}

/* Desactivar pull-to-refresh nativo del navegador */
body { overscroll-behavior-y: contain; }

/* Indicador pull to refresh */
#pull-refresh-indicador {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-48px);
  background: var(--color-primario);
  color: #fff;
  padding: 0.45rem 1.2rem;
  border-radius: 0 0 20px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.15s, opacity 0.15s;
  opacity: 0;
  white-space: nowrap;
}
#pull-refresh-indicador.activo {
  transform: translateX(-50%) translateY(0);
  opacity: 1 !important;
  transition: transform 0.2s;
}

/* Modo oscuro */
body.oscuro {
  --color-fondo: #0f172a;
  --color-superficie: #1e293b;
  --color-texto: #f1f5f9;
  --color-texto-suave: #94a3b8;
  --color-borde: #334155;
  --color-primario-suave: #1e1b4b;
  --sombra: 0 2px 12px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --sombra-elevada: 0 8px 24px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
}
body.oscuro input,
body.oscuro select,
body.oscuro textarea {
  background: #0f172a;
  color: var(--color-texto);
  border-color: var(--color-borde);
}
body.oscuro .modal-contenido,
body.oscuro .modal-contenido-grande {
  background: #1e293b;
}

/* ══════════════════════════════════════════════
   RESET Y BASE
══════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--color-fondo);
  color: var(--color-texto);
  line-height: 1.6;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════
   CABECERA
══════════════════════════════════════════════ */
.app-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 55%, #7c3aed 100%);
  color: white;
  padding: 0.6rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
}

.header-centro {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-botones-der {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo {
  height: 64px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
}

.header-textos {
  display: flex;
  flex-direction: column;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.subtitulo {
  font-size: 0.75rem;
  opacity: 0.82;
  margin-top: 0.15rem;
}

@media (max-width: 480px) {
  .header-logo { height: 52px; }
  .app-header h1 { font-size: 1.1rem; }
  .app-header { padding: 0.6rem 0.75rem; }
}

/* ══════════════════════════════════════════════
   MENÚ PRINCIPAL (pantalla de inicio)
══════════════════════════════════════════════ */
#pantalla-inicio {
  padding: 1.25rem 0.9rem;
  max-width: 800px;
  margin: 0 auto;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.menu-tile {
  background: var(--tile-color, var(--color-primario));
  color: white;
  border: none;
  border-radius: 16px;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.menu-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.2);
}

.menu-tile:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.menu-tile-ancho {
  grid-column: 1 / -1;   /* Ocupa las dos columnas */
  flex-direction: row;
  justify-content: center;
  padding: 1rem 1.5rem;
  gap: 0.75rem;
}

.menu-tile-icono {
  font-size: 2.4rem;
  line-height: 1;
}

.menu-tile-ancho .menu-tile-icono {
  font-size: 2rem;
}

.menu-tile-nombre {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ══════════════════════════════════════════════
   BARRA DE SECCIÓN (aparece al abrir una sección)
══════════════════════════════════════════════ */
#barra-seccion {
  background: var(--color-superficie);
  border-bottom: 1px solid var(--color-borde);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.btn-volver {
  background: var(--color-fondo);
  border: 1.5px solid var(--color-borde);
  border-radius: 99px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-texto-suave);
  white-space: nowrap;
  transition: all 0.15s;
  min-height: 36px;
}

.btn-volver:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: var(--color-peligro);
}

#barra-seccion-titulo {
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-texto);
}

/* ══════════════════════════════════════════════
   CONTENIDO PRINCIPAL
══════════════════════════════════════════════ */
.app-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.25rem 0.9rem;
}

.seccion-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.seccion-cabecera h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-texto);
}

.botones-cabecera {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════
   TARJETAS DE INGREDIENTES
══════════════════════════════════════════════ */
.tarjeta-ingrediente {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: var(--sombra);
  transition: box-shadow 0.2s, transform 0.15s;
}

.tarjeta-ingrediente:hover {
  box-shadow: var(--sombra-elevada);
  transform: translateY(-1px);
}

.tarjeta-foto {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--color-fondo);
  flex-shrink: 0;
}

.tarjeta-foto-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--color-primario-suave);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.tarjeta-info {
  flex: 1;
  min-width: 0;
}

.tarjeta-nombre {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.tarjeta-detalle {
  font-size: 0.8rem;
  color: var(--color-texto-suave);
}

.tarjeta-acciones {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════ */
.btn-primario {
  background: var(--color-primario);
  color: white;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 40px;
  transition: background 0.18s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-primario:hover {
  background: var(--color-primario-hover);
  transform: translateY(-1px);
}

.btn-primario:active {
  transform: translateY(0);
}

.btn-secundario {
  background: var(--color-superficie);
  color: var(--color-texto-suave);
  border: 1.5px solid var(--color-borde);
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 40px;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-secundario:hover {
  background: var(--color-fondo);
  border-color: #cbd5e1;
  color: var(--color-texto);
}

.btn-icono {
  background: transparent;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 1rem;
  min-height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.btn-icono:hover {
  background: var(--color-fondo);
  border-color: #94a3b8;
}

.btn-icono.peligro:hover {
  background: #fef2f2;
  border-color: var(--color-peligro);
  color: var(--color-peligro);
}

/* ══════════════════════════════════════════════
   MODAL (la ficha que se abre)
══════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
  backdrop-filter: blur(2px);
}

@media (min-width: 600px) {
  .modal {
    align-items: center;
    padding: 1rem;
  }
}

.modal-contenido {
  background: var(--color-superficie);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem;
}

@media (min-width: 600px) {
  .modal-contenido {
    border-radius: var(--radio-borde);
  }
}

.modal-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-cabecera h3 {
  font-size: 1.1rem;
  font-weight: 800;
}

.btn-cerrar {
  background: var(--color-fondo);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--color-texto-suave);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-cerrar:hover {
  background: var(--color-borde);
}

.oculto {
  display: none !important;
}

/* ══════════════════════════════════════════════
   FORMULARIO
══════════════════════════════════════════════ */
.campo {
  margin-bottom: 1rem;
}

.campo label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.obligatorio {
  color: var(--color-peligro);
  margin-left: 2px;
}

.campo input[type="text"],
.campo input[type="date"],
.campo input[type="number"],
.campo input[type="month"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 10px;
  font-size: 1rem;          /* 16px — evita zoom en iOS */
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--color-superficie);
  color: var(--color-texto);
  min-height: 44px;
}

.campo input:focus {
  outline: none;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
  background: white;
}

.campo input[type="file"] {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.4rem 0;
}

.preview-foto {
  margin-top: 0.5rem;
}

.preview-foto img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--color-borde);
}

.modal-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ══════════════════════════════════════════════
   MENSAJES DE ESTADO
══════════════════════════════════════════════ */
.mensaje-carga {
  text-align: center;
  padding: 2.5rem;
  color: var(--color-texto-suave);
  font-size: 0.9rem;
}

.mensaje-vacio {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-texto-suave);
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════
   GRUPOS DE STOCK POR INGREDIENTE
══════════════════════════════════════════════ */
.stock-grupo {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  margin-bottom: 0.8rem;
  overflow: hidden;
  box-shadow: var(--sombra);
}
.stock-grupo-titulo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--color-fondo);
  border-bottom: 1px solid var(--color-borde);
  font-weight: 700;
  font-size: 0.95rem;
}
.stock-grupo-contador {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-texto-suave);
}
.lote-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  gap: 0.6rem;
  border-bottom: 1px solid var(--color-borde);
}
.lote-fila:last-child { border-bottom: none; }
.lote-fila-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.lote-fila-lote { font-weight: 600; font-size: 0.88rem; }
.lote-fila-cad, .lote-fila-entrada { font-size: 0.75rem; color: var(--color-texto-suave); }
.lote-agotado { opacity: 0.45; background: var(--color-fondo); }
.badge-lote-enuso {
  font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem;
  border-radius: 99px; background: #dcfce7; color: #166534; white-space: nowrap;
}
.badge-lote-pendiente {
  font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem;
  border-radius: 99px; background: #f1f5f9; color: #475569; white-space: nowrap;
}
.badge-lote-agotado {
  font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem;
  border-radius: 99px; background: #f1f5f9; color: #94a3b8; white-space: nowrap;
}
.btn-agotar {
  font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.65rem;
  border-radius: 6px; border: 1px solid #16a34a; background: #f0fdf4;
  color: #166534; cursor: pointer; white-space: nowrap;
}
.btn-agotar:hover { background: #dcfce7; }

/* ══════════════════════════════════════════════
   TARJETAS DE STOCK
══════════════════════════════════════════════ */
.tarjeta-stock {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: var(--sombra);
  transition: box-shadow 0.2s;
}

.tarjeta-stock:hover {
  box-shadow: var(--sombra-elevada);
}

.tarjeta-stock.agotado {
  opacity: 0.5;
  background: var(--color-fondo);
}

.badge-agotado {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--color-texto-suave);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
}

.badge-alerta {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  background: #fef9c3;
  color: #854d0e;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  margin-left: 0.3rem;
}

.badge-caducado {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  background: #fef2f2;
  color: var(--color-peligro);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  margin-left: 0.3rem;
}

/* ══════════════════════════════════════════════
   PANEL DE ALBARÁN
══════════════════════════════════════════════ */
#panel-albaran,
#panel-recetario {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--sombra-elevada);
}

.panel-albaran-cabecera {
  margin-bottom: 1rem;
}

.panel-albaran-cabecera h3 {
  font-size: 1rem;
  font-weight: 700;
}

.panel-albaran-cabecera p {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
}

.item-albaran {
  border-top: 1px solid var(--color-borde);
  padding-top: 1rem;
  margin-top: 1rem;
}

.item-albaran-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.item-albaran-check input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--color-primario);
}

.item-albaran-nombre {
  font-weight: 700;
  color: var(--color-primario);
}

.aviso-nuevo {
  font-size: 0.82rem;
  color: #92400e;
  background: #fef9c3;
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  margin-bottom: 0.6rem;
}

.aviso-enlazado {
  font-size: 0.82rem;
  color: #166534;
  background: #f0fdf4;
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  margin-bottom: 0.6rem;
}

.campos-fila {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.campos-fila .campo {
  flex: 1;
  min-width: 110px;
}

.panel-albaran-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--color-borde);
  padding-top: 1rem;
}

/* SELECT (desplegable del formulario) */
.campo select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 10px;
  font-size: 1rem;          /* 16px — evita zoom en iOS */
  background: var(--color-superficie);
  color: var(--color-texto);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
  appearance: auto;
}

.campo select:focus {
  outline: none;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* ══════════════════════════════════════════════
   TEXTAREA
══════════════════════════════════════════════ */
.campo textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  background: var(--color-superficie);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.campo textarea:focus {
  outline: none;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
  background: white;
}

/* ══════════════════════════════════════════════
   MÓDULO DE FÓRMULAS
══════════════════════════════════════════════ */
.formulas-grupo-titulo {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-texto-suave);
  padding: 0.6rem 0 0.3rem;
  margin-top: 0.5rem;
  border-bottom: 1px solid var(--color-borde);
  margin-bottom: 0.5rem;
}

.tarjeta-formula {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: var(--sombra);
  transition: box-shadow 0.2s;
}

.tarjeta-formula:hover {
  box-shadow: var(--sombra-elevada);
}

.modal-contenido-grande {
  max-width: 620px;
}

.formula-ingredientes-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-borde);
}

.btn-pequeno {
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  min-height: 34px;
}

.linea-ingrediente {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.linea-ingrediente select,
.linea-ingrediente input[type="number"],
.linea-ingrediente input[type="text"] {
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  font-size: 0.9rem;
  background: var(--color-fondo);
  transition: border-color 0.2s;
  min-height: 40px;
}

.linea-ingrediente select:focus,
.linea-ingrediente input:focus {
  outline: none;
  border-color: var(--color-primario);
  background: white;
}

.linea-ing-select { flex: 2; min-width: 140px; }
.linea-cantidad   { width: 80px; }
.linea-unidad     { width: 70px; }
.linea-fase       { flex: 1; min-width: 110px; }

.detalle-grupo {
  margin-bottom: 1.25rem;
}

.detalle-grupo-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-texto-suave);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-borde);
}

.detalle-linea {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.95rem;
}

.detalle-cantidad {
  color: var(--color-texto-suave);
  white-space: nowrap;
  margin-left: 1rem;
}

.detalle-notas {
  background: var(--color-fondo);
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--color-texto-suave);
  margin-top: 1rem;
}

.calculadora-escala {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.calculadora-escala input {
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  background: white;
  min-height: 40px;
  width: 80px;
}

.calculadora-referencia {
  font-size: 0.82rem;
  color: var(--color-texto-suave);
  margin-left: auto;
}

.tags-ingredientes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.tag-ingrediente {
  font-size: 0.78rem;
  background: var(--color-fondo);
  border: 1px solid var(--color-borde);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  color: var(--color-texto-suave);
}

/* ══════════════════════════════════════════════
   PRODUCCIÓN
══════════════════════════════════════════════ */
.tarjeta-produccion {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 1rem 1.1rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--sombra);
  transition: box-shadow 0.2s;
}

.tarjeta-produccion:hover {
  box-shadow: var(--sombra-elevada);
}

.tarjeta-prod-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.tarjeta-prod-lote-badge {
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-primario);
  background: var(--color-primario-suave);
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
}

.tarjeta-prod-fecha {
  font-size: 0.82rem;
  color: var(--color-texto-suave);
}

.tarjeta-prod-tipo {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  margin-bottom: 0.45rem;
}

.tarjeta-prod-formatos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.badge-formato {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

.tarjeta-produccion-notas {
  font-size: 0.82rem;
  color: var(--color-texto-suave);
  margin-top: 0.3rem;
  font-style: italic;
}

.tarjeta-prod-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.lote-display {
  background: var(--color-primario-suave);
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  color: var(--color-primario);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* Bloques paso 1 / paso 2 del modal de producción */
.prod-bloque-paso {
  background: #fafafa;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1rem 0.75rem;
  margin-bottom: 0.75rem;
}

.prod-paso-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin-bottom: 0.75rem;
}

.prod-separador-pasos {
  text-align: center;
  font-size: 0.82rem;
  color: #aaa;
  margin: 0.25rem 0 0.5rem;
  font-style: italic;
}

/* Botón grande de imprimir pegatinas */
.btn-etiqueta-grande {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff7ed;
  border: 2px solid #f97316;
  color: #c2410c;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-etiqueta-grande:hover {
  background: #ffedd5;
}

/* Mantenemos la clase antigua por si se usa en otro sitio */
.btn-etiqueta-rapida {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  background: #fff7ed;
  border: 1.5px solid #f97316;
  color: #c2410c;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-etiqueta-rapida:hover {
  background: #ffedd5;
}

.linea-lote-ing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

/* Líneas de fruta/stock para polos */
.linea-polo-stock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.linea-polo-stock select {
  flex: 2;
  min-width: 140px;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  font-size: 0.88rem;
}
.linea-polo-stock .input-polo-cant {
  width: 80px;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  font-size: 0.88rem;
}
.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
}

.linea-lote-ing label {
  min-width: 120px;
  font-size: 0.88rem;
  color: var(--color-texto);
  font-weight: 500;
}

.linea-lote-ing select {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  font-size: 0.9rem;
  min-height: 40px;
  min-width: 160px;
}

.input-formato {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 10px;
  font-size: 1rem;
  min-height: 44px;
}

/* ══════════════════════════════════════════════
   HELADERÍAS
══════════════════════════════════════════════ */
.heladerias-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-heladeria {
  background: linear-gradient(135deg, var(--color-primario), #7c3aed);
  color: white;
  border: none;
  border-radius: var(--radio-borde);
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  box-shadow: var(--sombra-elevada);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-heladeria:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(79,70,229,0.22);
}

.btn-heladeria:active {
  transform: translateY(0);
}

.btn-heladeria-icono {
  font-size: 2.2rem;
}

.btn-heladeria-nombre {
  font-size: 1rem;
  font-weight: 800;
}

.btn-heladeria-sub {
  font-size: 0.75rem;
  opacity: 0.82;
}

.panel-salida-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-salida-cabecera h3 {
  margin: 0;
  font-weight: 800;
}

.linea-salida-item {
  background: var(--color-fondo);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  border: 1.5px solid var(--color-borde);
}

.salida-cascada {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.salida-cascada select {
  flex: 1;
  min-width: 95px;
  padding: 0.5rem 0.5rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  font-size: 0.9rem;
  background: white;
  min-height: 42px;
}

.input-salida-cantidad {
  width: 62px;
  padding: 0.45rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 9px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  min-height: 42px;
}

.btn-quitar-linea {
  background: none;
  border: none;
  color: var(--color-peligro);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  min-height: 42px;
}

.aviso-lote {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: #d97706;
  background: #fef3c7;
  border-radius: 7px;
  padding: 0.35rem 0.7rem;
  border-left: 3px solid #f59e0b;
}

.tarjeta-salida {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--sombra);
}

.tarjeta-salida-cab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

/* ══════════════════════════════════════════════
   INFORMES
══════════════════════════════════════════════ */
.informe-seccion-titulo {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

.informe-sabores-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tarjeta-informe-sabor {
  background: var(--color-superficie);
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.85rem 1rem;
  box-shadow: var(--sombra);
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.15s;
}

.tarjeta-informe-sabor:hover {
  box-shadow: var(--sombra-elevada);
}

.tarjeta-alerta {
  border-color: #fcd34d;
  background: #fffbeb;
}

.tarjeta-alerta-roja {
  border-color: #fca5a5;
  background: #fff1f2;
}

.informe-sabor-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.informe-sabor-nombre {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-texto);
}

.informe-sabor-derecha {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.informe-chevron {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  transition: transform 0.2s;
}

.tarjeta-informe-sabor.abierta .informe-chevron {
  transform: rotate(90deg);
}

.informe-sabor-detalle {
  display: none;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-borde);
  flex-direction: column;
  gap: 0.3rem;
}

.tarjeta-informe-sabor.abierta .informe-sabor-detalle {
  display: flex;
}

.informe-linea-formato {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.informe-formato-label {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  min-width: 36px;
}

.informe-formato-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-texto);
}

.num-agotado { color: #94a3b8; }
.num-ultima  { color: #d97706; }

.badge-estado {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.badge-estado.agotado {
  background: #fee2e2;
  color: #991b1b;
}

.badge-estado.ultima {
  background: #fef3c7;
  color: #92400e;
}

.informe-heladerias-lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tarjeta-consumo-heladeria {
  background: var(--color-superficie);
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.85rem 1rem;
  box-shadow: var(--sombra);
  cursor: pointer;
  user-select: none;
}

.consumo-heladeria-detalle {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-borde);
}

.tarjeta-consumo-heladeria.abierta .consumo-heladeria-detalle {
  display: flex;
}

.tarjeta-consumo-heladeria.abierta > .informe-sabor-cabecera .informe-chevron {
  transform: rotate(90deg);
}

.consumo-sabor-item {
  background: var(--color-fondo);
  border: 1.5px solid var(--color-borde);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  user-select: none;
}

.consumo-sabor-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.consumo-sabor-detalle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-borde);
}

.consumo-sabor-item.abierto .consumo-sabor-detalle {
  display: flex;
}

.consumo-sabor-item.abierto .informe-chevron {
  transform: rotate(90deg);
}

.pdf-selector-opciones {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--color-fondo);
  border: 1.5px solid var(--color-borde);
  border-radius: 12px;
  font-size: 0.95rem;
}

.pdf-selector-opciones label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

.consumo-total-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primario);
  background: var(--color-primario-suave);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

/* ══════════════════════════════════════════════
   TEMPERATURAS
══════════════════════════════════════════════ */
.tarjeta-congelador {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  margin-bottom: 0.45rem;
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.tarjeta-congelador:hover {
  box-shadow: var(--sombra-elevada);
}

.cong-fila {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
}

.cong-fila-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  min-width: 0;
  flex-wrap: wrap;
}

.cong-fila-nombre {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-texto);
  flex: 1;
  min-width: 0;
}

.cong-fila-nombre em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--color-texto-suave);
}

.cong-fila-temp {
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-primario);
  white-space: nowrap;
}

.cong-fila-temp.temp-alerta {
  color: #dc2626;
}

.cong-fila-fecha {
  font-size: 0.74rem;
  color: var(--color-texto-suave);
  white-space: nowrap;
}

.btn-cong-add {
  background: var(--color-primario);
  color: white;
  border: none;
  border-radius: 9px;
  width: 38px;
  height: 38px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-cong-add:hover {
  background: var(--color-primario-hover);
}

.congelador-detalle {
  display: none;
  padding: 0 1rem 0.9rem;
  border-top: 1px solid var(--color-borde);
}

.tarjeta-congelador.abierto .congelador-detalle {
  display: block;
}

.tabla-temps {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.tabla-temps th {
  text-align: left;
  padding: 0.45rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-texto-suave);
  border-bottom: 1.5px solid var(--color-borde);
}

.tabla-temps td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--color-fondo);
}

.temp-alerta {
  color: #dc2626;
  font-weight: 700;
}

/* ══════════════════════════════════════════════
   JIJONENCA
══════════════════════════════════════════════ */
.jij-seccion-titulo {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-texto-suave);
  margin-bottom: 0.75rem;
}

/* ── Acordeón por categoría ── */
.jij-grupo {
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  margin-bottom: 0.55rem;
  overflow: hidden;
  background: var(--color-superficie);
}

.jij-grupo-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  background: #fafafa;
  gap: 0.5rem;
}

.jij-grupo-titulo {
  font-weight: 700;
  font-size: 0.95rem;
}

.jij-grupo-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.jij-badge-total {
  background: var(--color-borde);
  color: var(--color-texto-suave);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
}

.jij-badge-bajo {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  white-space: nowrap;
}

.jij-badge-agotado {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  white-space: nowrap;
}

.jij-grupo .informe-chevron {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  transition: transform 0.2s;
}

.jij-grupo-contenido {
  display: none;
  border-top: 1px solid var(--color-borde);
}

.jij-grupo.abierto .jij-grupo-contenido { display: block; }
.jij-grupo.abierto .informe-chevron     { transform: rotate(90deg); }

/* ── Fila compacta de producto ── */
.jij-fila {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--color-borde);
}

.jij-fila:last-child { border-bottom: none; }

.jij-fila-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.jij-fila-alerta { font-size: 0.85rem; flex-shrink: 0; }

.jij-fila-nombre {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jij-fila-fmt {
  font-size: 0.75rem;
  color: var(--color-texto-suave);
  white-space: nowrap;
}

.jij-fila-agotado .jij-fila-nombre { color: #94a3b8; }

/* mantener tarjeta-jij-stock usable en filas compactas */
.jij-fila .tarjeta-jij-stock {
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  flex-shrink: 0;
}

.tarjeta-jij {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.85rem 1rem;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--sombra);
}

.tarjeta-jij-info {
  flex: 1;
  min-width: 0;
}

.tarjeta-jij-nombre {
  font-weight: 700;
  font-size: 0.95rem;
}

.tarjeta-jij-formato {
  font-size: 0.8rem;
  color: var(--color-texto-suave);
}

.tarjeta-jij-ref {
  font-size: 0.75rem;
  color: #94a3b8;
}

.tarjeta-jij-stock {
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.stock-ok      { background: #f0fdf4; color: #166534; }
.stock-bajo    { background: #fef3c7; color: #92400e; }
.stock-agotado { background: #fee2e2; color: #991b1b; }

.tarjeta-jij-acciones {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Historial de movimientos */
.tarjeta-jij-mov {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.4rem;
  border-left: 4px solid var(--color-borde);
}

.mov-entrada { border-left-color: #10b981; }
.mov-salida  { border-left-color: #f43f5e; }

.mov-tipo {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 70px;
}

.mov-detalle {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mov-nombre {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mov-cant {
  font-size: 0.8rem;
  color: var(--color-texto-suave);
}

.mov-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.75rem;
  color: var(--color-texto-suave);
  white-space: nowrap;
  gap: 0.1rem;
}

.mov-tienda {
  font-size: 0.72rem;
  background: var(--color-primario-suave);
  color: var(--color-primario);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   ESCÁNER DE CÓDIGO DE BARRAS
══════════════════════════════════════════════ */
.scanner-hint {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  text-align: center;
  margin-bottom: 0.75rem;
}

#scanner-reader {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

#scanner-reader video {
  width: 100% !important;
  border-radius: 12px;
}

/* Ocultar el botón de "stop" que añade html5-qrcode */
#scanner-reader button { display: none !important; }

.scanner-card {
  background: var(--color-superficie);
  border: 1.5px solid var(--color-borde);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.75rem;
}

.scanner-nombre {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-texto);
  margin-bottom: 0.3rem;
}

.scanner-marca {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  margin-bottom: 0.5rem;
}

.scanner-alergenos {
  font-size: 0.82rem;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 0.4rem 0.7rem;
  border-radius: 0 7px 7px 0;
  margin-bottom: 0.5rem;
}

.scanner-alergenos.ok {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.scanner-codigo-small {
  font-size: 0.75rem;
  color: var(--color-texto-suave);
  margin-bottom: 0.75rem;
}

.scanner-acciones {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.scanner-no-encontrado {
  text-align: center;
  padding: 1rem;
}

.scanner-no-encontrado p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-texto-suave);
}

.scanner-codigo {
  font-size: 0.85rem;
  margin-bottom: 1rem !important;
}

/* ══════════════════════════════════════════════
   INFORMES — EXTRAS
══════════════════════════════════════════════ */
.consumo-sub-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-texto-suave);
  padding: 0.5rem 0 0.3rem;
  margin-top: 0.6rem;
  border-top: 1px solid var(--color-borde);
}

.consumo-sub-titulo:first-child { border-top: none; margin-top: 0; }

.consumo-sin-datos {
  color: var(--color-texto-suave);
  font-size: 0.82rem;
  padding: 0.35rem 0;
}

/* PDF selector — grupo título y sub-opciones Jijonenca */
.pdf-grupo-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-texto-suave);
  margin-bottom: 0.45rem;
}

.pdf-jij-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  margin-left: 1.5rem;
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: #fffbeb;
  border-left: 3px solid #fde68a;
  border-radius: 0 8px 8px 0;
}

.pdf-jij-subcats label {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   MODAL PRODUCCIÓN — SELECTOR DE TIPO
══════════════════════════════════════════════ */
.prod-tipo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.prod-tipo-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.85rem 0.5rem;
  border: 2px solid var(--color-borde);
  border-radius: var(--radio-borde);
  background: var(--color-superficie);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: center;
}

.prod-tipo-pill:hover {
  border-color: var(--color-primario);
  background: var(--color-primario-suave);
}

.prod-tipo-pill.activa {
  border-color: var(--color-primario);
  background: var(--color-primario-suave);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.18);
}

.prod-tipo-icono { font-size: 1.6rem; line-height: 1; }
.prod-tipo-nombre { font-size: 0.9rem; font-weight: 700; color: var(--color-texto); }
.prod-tipo-sub { font-size: 0.72rem; color: var(--color-texto-suave); }

/* ══════════════════════════════════════════════
   JIJONENCA — BLOQUE EN PANEL SALIDA HELADERÍAS
══════════════════════════════════════════════ */
.jij-salida-bloque {
  margin-top: 1.25rem;
  border: 1.5px solid #fde68a;
  border-radius: var(--radio-borde);
  overflow: hidden;
  background: #fffbeb;
}

.jij-salida-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #92400e;
  background: #fef3c7;
  user-select: none;
}

.jij-salida-toggle em {
  font-weight: 400;
  font-size: 0.82rem;
  color: #b45309;
}

.jij-salida-contenido {
  padding: 0.75rem 1rem 1rem;
}

/* Pills de categoría */
.jij-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.jij-cat-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  border: 1.5px solid #fde68a;
  background: white;
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.jij-cat-pill.activa {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

/* Filas de producto dentro del bloque salida */
.jij-prod-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #fde68a;
}

.jij-prod-row:last-child { border-bottom: none; }

.jij-prod-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.jij-prod-row-nombre {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jij-prod-row-fmt {
  font-size: 0.75rem;
  color: var(--color-texto-suave);
}

.jij-prod-agotado .jij-prod-row-nombre {
  color: #94a3b8;
}

/* ══════════════════════════════════════════════
   RESPONSIVE EXTRA
══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .app-main { padding: 1rem 0.75rem; }
  .heladerias-selector { gap: 0.6rem; }
  .btn-heladeria { padding: 1.1rem 0.75rem; }
  .btn-heladeria-icono { font-size: 1.8rem; }
  .btn-heladeria-nombre { font-size: 0.9rem; }
  .campos-fila { flex-direction: column; }
  .campos-fila .campo { min-width: unset; }
  .linea-ingrediente { flex-direction: column; align-items: stretch; }
  .linea-ing-select, .linea-cantidad, .linea-unidad, .linea-fase { width: 100%; }
}

@media (min-width: 600px) {
  .app-header { padding: 1.25rem 1.5rem; }
  .app-header h1 { font-size: 1.5rem; }
  .app-main { padding: 1.5rem 1.5rem; }
}

/* ══════════════════════════════════════════════
   BOTÓN MODO OSCURO
══════════════════════════════════════════════ */
.btn-tema {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-tema:hover { background: rgba(255,255,255,0.28); }

/* ══════════════════════════════════════════════
   BOTÓN INSTALAR PWA
══════════════════════════════════════════════ */
.btn-instalar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #3b82f6;
  border: none;
  border-radius: 2rem;
  padding: 0.35rem 0.9rem 0.35rem 0.4rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 10px rgba(59,130,246,0.5);
}
.btn-instalar:hover {
  background: #2563eb;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(59,130,246,0.65);
}
.btn-instalar-logo {
  width: 1.8rem;
  height: 1.8rem;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}


/* ══════════════════════════════════════════════
   RESUMEN PANTALLA INICIO
══════════════════════════════════════════════ */
#resumen-inicio {
  padding: 1rem 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.resumen-card {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  box-shadow: var(--sombra);
  flex: 1 1 160px;
  cursor: default;
}
.resumen-card.alerta { border-color: #f59e0b; background: #fffbeb; }
.resumen-card.peligro { border-color: #ef4444; background: #fef2f2; }
body.oscuro .resumen-card.alerta { background: #292303; }
body.oscuro .resumen-card.peligro { background: #300; }
.resumen-card-icono { font-size: 1.3rem; }
.resumen-card-texto { line-height: 1.3; }
.resumen-card-valor { font-weight: 700; font-size: 1rem; }
.resumen-card-label { color: var(--color-texto-suave); font-size: 0.78rem; }

/* ══════════════════════════════════════════════
   FILTRO BÚSQUEDA STOCK
══════════════════════════════════════════════ */
.filtro-busqueda-wrap {
  padding: 0.75rem 0 0.25rem;
}
.filtro-busqueda {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  font-size: 0.95rem;
  background: var(--color-superficie);
  color: var(--color-texto);
  transition: border-color 0.2s;
}
.filtro-busqueda:focus {
  outline: none;
  border-color: var(--color-primario);
}

/* ══════════════════════════════════════════════
   PEGATINAS — SELECTOR DE CANTIDAD
══════════════════════════════════════════════ */
.pegatinas-fila {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.pegatinas-count-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-fondo);
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  padding: 0.3rem 0.6rem;
}
.btn-count {
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-primario);
  padding: 0 0.2rem;
  line-height: 1;
}
.btn-count:hover { opacity: 0.7; }
#input-num-pegatinas {
  width: 3rem;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-texto);
}
.pegatinas-label {
  font-size: 0.85rem;
  color: var(--color-texto-suave);
}

/* ══════════════════════════════════════════════
   CADUCIDAD EN TARJETA PRODUCCIÓN
══════════════════════════════════════════════ */
.prod-caducidad {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  margin-top: 0.3rem;
}
.prod-cad-ok { color: #059669; background: #d1fae5; }
.prod-cad-aviso { color: #b45309; background: #fef3c7; }
.prod-cad-caducado { color: #dc2626; background: #fee2e2; }
body.oscuro .prod-cad-ok { background: #042f20; }
body.oscuro .prod-cad-aviso { background: #292303; }
body.oscuro .prod-cad-caducado { background: #300; }

/* ══════════════════════════════════════════════
   PRODUCCIÓN POR MES — PANEL EN INFORMES
══════════════════════════════════════════════ */
.informe-panel-meses {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  margin-bottom: 1rem;
  box-shadow: var(--sombra);
  overflow: hidden;
}
.informe-panel-meses-titulo {
  padding: 0.85rem 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.informe-panel-meses-titulo:hover { background: var(--color-fondo); }
.informe-panel-meses-contenido {
  display: none;
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid var(--color-borde);
}
.informe-panel-meses.abierto .informe-panel-meses-contenido { display: block; }
.informe-panel-meses.abierto .informe-chevron { transform: rotate(90deg); }
.informe-chevron { display: inline-block; transition: transform 0.2s; }

.mes-grupo { margin-bottom: 1.2rem; }
.mes-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-texto-suave);
  margin-bottom: 0.5rem;
}
.mes-barra-fila {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.mes-barra-nombre {
  width: 120px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.mes-barra-track {
  flex: 1;
  background: var(--color-fondo);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}
.mes-barra-fill {
  height: 100%;
  background: var(--color-primario);
  border-radius: 4px;
  transition: width 0.4s;
}
.mes-barra-valor {
  width: 50px;
  text-align: right;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-texto-suave);
}

/* ══════════════════════════════════════════════
   REPARTO — RESUMEN POR TIENDA
══════════════════════════════════════════════ */
.reparto-resumen {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.resumen-tienda-card {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  overflow: hidden;
  box-shadow: var(--sombra);
}
.resumen-tienda-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}
.resumen-tienda-header:hover { background: var(--color-fondo); }
.resumen-tienda-nombre { flex: 1; }
.resumen-tienda-fecha { font-size: 0.8rem; color: var(--color-texto-suave); font-weight: 400; }
.resumen-tienda-detalle {
  display: none;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--color-borde);
}
.resumen-tienda-card.abierto .resumen-tienda-detalle { display: block; }
.resumen-tienda-card.abierto .informe-chevron { transform: rotate(90deg); }
.resumen-tienda-subtitulo {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-texto-suave);
  margin-bottom: 0.4rem;
}
.top-barra-fila {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.84rem;
}
.top-barra-pos { width: 1rem; color: var(--color-texto-suave); font-size: 0.75rem; }
.top-barra-nombre { width: 110px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-barra-track { flex: 1; height: 10px; background: var(--color-fondo); border-radius: 4px; overflow: hidden; }
.top-barra-fill { height: 100%; background: var(--color-primario); border-radius: 4px; }
.top-barra-valor { width: 30px; text-align: right; font-weight: 600; color: var(--color-texto-suave); font-size: 0.8rem; }
.reparto-historial-titulo {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-texto-suave);
  margin-bottom: 0.6rem;
  padding-top: 0.25rem;
}

/* ══════════════════════════════════════════════
   JIJONENCA — SUGERENCIAS Y ALBARANES
══════════════════════════════════════════════ */
.jij-sugerencias-lista { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.jij-sugerencia {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radio-borde);
  font-size: 0.88rem;
  border-left: 4px solid;
}
.jij-sugerencia.alerta { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.jij-sugerencia.peligro { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
body.oscuro .jij-sugerencia.alerta { background: #292303; color: #fbbf24; }
body.oscuro .jij-sugerencia.peligro { background: #300; color: #fca5a5; }

.jij-albaran-grupo {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.jij-albaran-cabecera {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
}
.jij-albaran-cabecera:hover { background: var(--color-fondo); }
.jij-albaran-resumen { margin-left: auto; font-size: 0.78rem; color: var(--color-texto-suave); font-weight: 400; }
.jij-albaran-contenido {
  display: none;
  padding: 0.5rem 1rem 0.75rem;
  border-top: 1px solid var(--color-borde);
}
.jij-albaran-grupo.abierto .jij-albaran-contenido { display: block; }
.jij-albaran-grupo.abierto .informe-chevron { transform: rotate(90deg); }
.jij-albaran-linea {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--color-fondo);
}
.jij-albaran-linea:last-child { border-bottom: none; }
.jij-albaran-nombre { flex: 1; }
.jij-albaran-cant { font-weight: 600; color: #059669; min-width: 60px; text-align: right; }

/* ══════════════════════════════════════════════
   BÚSQUEDA GLOBAL
══════════════════════════════════════════════ */
.busqueda-global-wrap {
  padding: 0.75rem 1rem 0;
  position: relative;
}
.busqueda-global {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 999px;
  font-size: 1rem;
  background: var(--color-superficie);
  color: var(--color-texto);
  box-shadow: var(--sombra);
  transition: border-color 0.2s;
}
.busqueda-global:focus { outline: none; border-color: var(--color-primario); }

#resultados-busqueda-global {
  margin: 0.35rem 1rem 0;
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-elevada);
  overflow: hidden;
  z-index: 100;
  position: relative;
}
.busqueda-grupo-titulo {
  padding: 0.4rem 0.9rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-texto-suave);
  background: var(--color-fondo);
  border-bottom: 1px solid var(--color-borde);
}
.busqueda-resultado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--color-fondo);
  transition: background 0.15s;
}
.busqueda-resultado:hover { background: var(--color-primario-suave); }
.busqueda-res-nombre { font-weight: 500; font-size: 0.9rem; }
.busqueda-res-meta { font-size: 0.78rem; color: var(--color-texto-suave); }
.busqueda-cargando, .busqueda-sin-resultados {
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  color: var(--color-texto-suave);
  text-align: center;
}

/* ══════════════════════════════════════════════
   NOTAS RÁPIDAS
══════════════════════════════════════════════ */
.notas-wrap {
  position: relative;
  height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
}
#textarea-notas {
  flex: 1;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.7;
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  background: var(--color-superficie);
  color: var(--color-texto);
  resize: none;
  box-shadow: var(--sombra);
}
#textarea-notas:focus { outline: none; border-color: var(--color-primario); }
.notas-guardado {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: #059669;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* ══════════════════════════════════════════════
   TRAZABILIDAD INVERSA
══════════════════════════════════════════════ */
.traz-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
}
.traz-card-titulo {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.traz-fecha {
  font-weight: 400;
  font-size: 0.82rem;
  color: #64748b;
}
.traz-seccion-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.traz-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.traz-tabla th {
  background: #e2e8f0;
  padding: 0.35rem 0.6rem;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.traz-tabla td {
  padding: 0.4rem 0.6rem;
  border-top: 1px solid #f1f5f9;
}
.traz-destinos { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.traz-sin-datos { color: #94a3b8; font-style: italic; font-size: 0.82rem; }

/* ══════════════════════════════════════════════
   HISTORIAL POR SABOR
══════════════════════════════════════════════ */
.historial-sabor-lista { display: flex; flex-direction: column; gap: 0.6rem; }
.historial-sabor-fila {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
}
.historial-sabor-fecha {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
  white-space: nowrap;
  min-width: 70px;
  padding-top: 0.1rem;
}
.historial-sabor-info { flex: 1; }
.historial-sabor-lote {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}
.historial-sabor-formatos { margin-bottom: 0.3rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.historial-sabor-destinos { font-size: 0.82rem; color: #475569; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }

/* ══════════════════════════════════════════════
   CATÁLOGO JIJONENCA 2026
══════════════════════════════════════════════ */
.jij-catalogo-wrap {
  background: var(--color-superficie);
  border: 1.5px solid var(--color-borde);
  border-radius: var(--radio-borde);
  margin-bottom: 1rem;
  overflow: hidden;
}

.jij-catalogo-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
  transition: background 0.15s;
}
.jij-catalogo-toggle:hover { background: var(--color-primario-suave); }
.jij-catalogo-toggle .informe-chevron { transition: transform 0.2s; }
.jij-catalogo-toggle.abierto .informe-chevron { transform: rotate(90deg); }

#panel-catalogo-jij { padding: 0 1rem 1rem; }

.jij-catalogo-info {
  font-size: 0.82rem;
  color: var(--color-texto-suave);
  margin-bottom: 0.75rem;
}

/* Subgrupo */
.jij-cat-subgrupo {
  border: 1px solid var(--color-borde);
  border-radius: 10px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.jij-cat-subgrupo-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--color-fondo);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jij-cat-subgrupo-badge {
  font-size: 0.75rem;
  background: var(--color-primario-suave);
  color: var(--color-primario);
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-weight: 700;
}

/* Fila de producto */
.jij-cat-prod-fila {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--color-borde);
  transition: background 0.12s;
}
.jij-cat-prod-fila.jij-cat-prod-activo { background: #f0fdf4; }
body.oscuro .jij-cat-prod-fila.jij-cat-prod-activo { background: #052e16; }

.jij-cat-prod-check input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: #22c55e;
  cursor: pointer;
  flex-shrink: 0;
}

.jij-cat-prod-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.jij-cat-prod-nombre {
  font-size: 0.9rem;
  font-weight: 500;
}

.jij-cat-prod-fmt {
  font-size: 0.73rem;
  background: var(--color-primario-suave);
  color: var(--color-primario);
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-weight: 600;
}

.jij-cat-prod-precios {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
}

.jij-cat-prod-neto {
  font-size: 0.82rem;
  color: var(--color-texto-suave);
}

.jij-cat-prod-iva {
  font-size: 0.88rem;
  font-weight: 700;
  color: #16a34a;
}
.jij-cat-prod-iva small {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--color-texto-suave);
}

/* ── Buscador ingrediente en modal stock ── */
.ingrediente-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--color-superficie);
  border: 1.5px solid var(--color-primario);
  border-radius: 0 0 10px 10px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: var(--sombra-elevada);
}
.ingrediente-dropdown-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--color-borde);
}
.ingrediente-dropdown-item:last-child { border-bottom: none; }
.ingrediente-dropdown-item:hover, .ingrediente-dropdown-item:active {
  background: var(--color-primario-suave);
  color: var(--color-primario);
}

/* ── Botón añadir cantidad en lote ── */
.btn-agotar-add {
  background: none;
  border: 1.5px solid #22c55e;
  color: #16a34a;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

/* ── Toast notificación ── */
.toast-app {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.3s, opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
.toast-app.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-app.toast-alerta { background: #b45309; }

/* ── Entrada bulk Jijonenca ── */
.jij-entrada-subgrupo {
  border: 1px solid var(--color-borde);
  border-radius: 10px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}
.jij-entrada-subgrupo-titulo {
  padding: 0.5rem 0.85rem;
  background: var(--color-fondo);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.jij-entrada-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--color-borde);
}
.jij-entrada-fila-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.jij-entrada-fila-nombre {
  font-size: 0.9rem;
  font-weight: 500;
}
.jij-entrada-fila-cant {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.jij-entrada-cant-input {
  width: 52px;
  text-align: center;
  padding: 0.35rem 0.25rem;
  border: 1.5px solid var(--color-borde);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
}
.btn-jij-menos, .btn-jij-mas {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--color-borde);
  background: var(--color-superficie);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-texto);
}
.btn-jij-mas { border-color: #22c55e; color: #16a34a; }

/* ── Informe Jijonenca ── */
.informe-jij-cabecera {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--color-texto-suave);
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}
.informe-jij-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--color-borde);
  margin-bottom: 0.4rem;
  background: var(--color-superficie);
  flex-wrap: wrap;
}
.informe-jij-fila-nombre {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}
.informe-jij-fila-datos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.informe-jij-cant {
  font-size: 0.82rem;
  color: var(--color-texto-suave);
  min-width: 45px;
  text-align: right;
}
.informe-jij-coste {
  font-size: 0.88rem;
  text-align: right;
}
.informe-jij-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-primario);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.btn-texto-pequeño {
  background: none;
  border: none;
  color: var(--color-primario);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Trazabilidad de lotes en producción ── */
.traza-lotes {
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: #f0f9ff;
  border-left: 3px solid #0ea5e9;
  border-radius: 0 8px 8px 0;
  font-size: 0.8rem;
}
.traza-titulo {
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}
.traza-fila {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  align-items: center;
  padding: 0.2rem 0;
  border-bottom: 1px solid #e0f2fe;
}
.traza-fila:last-child { border-bottom: none; }
.traza-nombre { font-weight: 600; color: #1e293b; flex: 1 1 100%; }
.traza-lote   { color: #0369a1; background: #e0f2fe; padding: 0.1rem 0.4rem; border-radius: 4px; }
.traza-cad    { color: #64748b; font-size: 0.75rem; }
.traza-cant   { color: #059669; font-size: 0.75rem; }
.traza-vacio  { color: #64748b; font-size: 0.8rem; font-style: italic; }

/* ── Cantidad en lote de stock ── */
.lote-fila-cant {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Cantidad + unidad en modal stock ── */
.cantidad-unidad-wrap {
  display: flex;
  gap: 0.5rem;
}
.cantidad-unidad-wrap input[type=number] {
  flex: 1;
}
.cantidad-unidad-wrap select {
  width: 110px;
  flex-shrink: 0;
}
