/* =========================================
   INVENTARIO · AJUSTES UX 2026
========================================= */
.inventario-status-divider {
  align-self: center;
  height: 24px;
}

.inventario-provider-search,
.inventario-weekly-search {
  max-width: none;
  margin-bottom: 10px;
}

.inventario-provider-suggest-placeholder {
  background: var(--lj-surface-2);
}

.inventario-provider-suggest-icon {
  font-size: 1rem !important;
  line-height: 1;
}

.inventario-bulk-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.inventario-bulk-row {
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.inventario-bulk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 768px) {
  .dispatch-client-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.weekly-production-sheet {
  display: grid;
  gap: 16px;
}

.weekly-sheet-block {
  border: 1px solid var(--lj-border-strong);
  border-radius: 0;
  overflow: hidden;
  background: var(--lj-surface);
}

.weekly-sheet-block h3,
.weekly-sheet-block h4 {
  text-align: center;
  margin: 0;
  font-weight: 800;
  padding: 6px 10px;
}

.weekly-sheet-block h3 {
  background: var(--lj-brand);
  color: var(--lj-surface);
  border-bottom: 1px solid var(--lj-border-strong);
}

.weekly-sheet-block h4 {
  background: var(--lj-surface-2);
  color: var(--lj-brand);
  border-bottom: 1px solid var(--lj-border-strong);
}

.weekly-sheet-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--lj-surface);
  border-radius: 0;
  overflow: visible;
  box-shadow: 0 2px 12px -6px rgba(15, 23, 42, 0.15);
}

.weekly-sheet-table th:nth-child(1),
.weekly-sheet-table td:nth-child(1) {
  width: 11%;
}

.weekly-sheet-table th:nth-child(2),
.weekly-sheet-table td:nth-child(2) {
  width: 11%;
}

.weekly-sheet-table th:nth-child(3),
.weekly-sheet-table td:nth-child(3) {
  width: 22%;
}

.weekly-sheet-table th,
.weekly-sheet-table td {
  border-bottom: 1px solid var(--lj-border);
  border-right: 1px solid var(--lj-border);
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  font-size: 0.85rem;
  text-transform: uppercase !important;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}

.weekly-sheet-table th:last-child,
.weekly-sheet-table td:last-child {
  border-right: none;
}

.weekly-sheet-table tr:last-child td {
  border-bottom: none;
}

/* Headers: dos tonos (verde para cat/sub/producto, azul para días, gris para total). */
.weekly-sheet-table th.th-cat {
  background: var(--lj-brand);
  color: var(--lj-surface);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 10px 6px;
}

.weekly-sheet-table th.th-day {
  background: var(--lj-accent);
  color: var(--lj-surface);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 10px 6px;
}

.weekly-sheet-table th.th-total {
  background: var(--lj-brand);
  color: var(--lj-surface);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 10px 6px;
}

/* Categoría / Subcategoría: chip-style suave. */
.weekly-sheet-table td.weekly-cat-cell {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: normal;
  color: var(--lj-text);
  background: var(--lj-success-soft);
  text-transform: uppercase !important;
}

.weekly-sheet-table td.weekly-cat-cell:nth-child(2) {
  color: var(--lj-muted);
  background: var(--lj-surface-2);
}

/* Producto: alineado izquierda con foto + texto. */
.weekly-sheet-table td.weekly-product-td {
  font-size: 0.82rem;
  text-align: left;
  padding: 8px 10px;
}

.weekly-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-transform: none !important;
}

.weekly-product-cell img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lj-border);
  flex-shrink: 0;
}

.weekly-product-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  min-width: 0;
  flex: 1 1 auto;
}

.weekly-product-text strong {
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0;
  color: var(--lj-brand);
  text-transform: uppercase !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.weekly-product-text small {
  font-size: 0.7rem;
  font-weight: 500;
  font-style: italic;
  color: var(--lj-muted);
  text-transform: none !important;
  letter-spacing: 0;
  line-height: 1.2;
}

/* Filas alternadas con un tinte muy suave para legibilidad. */
.weekly-sheet-table tbody tr:nth-child(even) td:not(.weekly-cat-cell):not(.weekly-total):not(.is-ok):not(.is-missing) {
  background: var(--lj-surface-2);
}

/* Celdas de días sin producción: tinte ámbar muy claro. */
.weekly-sheet-table td.is-missing {
  background: var(--lj-warning-soft);
  color: var(--lj-warning);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none !important;
}

/* Celdas con producción: verde fuerte. */
.weekly-sheet-table td.is-ok {
  background: var(--lj-success-soft);
  color: var(--lj-success);
  font-weight: 800;
  font-size: 0.85rem;
}

/* Total a la derecha: destacado azul. */
.weekly-sheet-table .weekly-total {
  font-weight: 800;
  background: var(--lj-accent-soft);
  color: var(--lj-accent);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

/* Cabecera del bloque (FRIGORIFICO ... PLANILLA): más respiro. */
.weekly-sheet-block {
  margin-bottom: 24px;
  border-radius: 0;
  overflow: visible;
}

.weekly-sheet-block h3,
.weekly-sheet-block h4 {
  text-align: center;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 0;
}

.weekly-sheet-block h3 {
  background: var(--lj-brand);
  color: var(--lj-surface);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.weekly-sheet-block h4 {
  background: var(--lj-surface-2);
  color: var(--lj-accent);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  margin-top: -8px;
  border-radius: 0;
}

.weekly-sheet-block,
.weekly-sheet-block h3,
.weekly-sheet-block h4,
.weekly-sheet-table,
.weekly-sheet-table th,
.weekly-sheet-table td {
  border-radius: 0 !important;
}

/* === Modal Producir: realce del nombre y nombre comercial del producto === */
.produccion-editor-header .inventario-editor-name {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
  color: var(--lj-brand);
}

.produccion-editor-header .produccion-nombre-comercial-editor {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lj-muted);
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
  border-radius: 4px;
  width: fit-content;
}

.produccion-editor-header .produccion-nombre-comercial-editor::before {
  content: "\f02b"; /* fa-tag */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.78rem;
  opacity: 0.85;
}

.weekly-sheet-table th.th-cat { background: var(--lj-success); color: var(--lj-surface); }
.weekly-sheet-table th.th-day { background: var(--lj-accent); color: var(--lj-surface); }
.weekly-sheet-table th.th-total { background: var(--lj-brand); color: var(--lj-surface); }
.weekly-sheet-table td.is-missing { background: var(--lj-warning-soft); color: var(--lj-warning); }
.weekly-sheet-table td.is-ok { background: var(--lj-success-soft); color: var(--lj-success); font-weight: 800; }
.weekly-sheet-table .weekly-total { font-weight: 900; background: var(--lj-accent-soft); color: var(--lj-brand); }

.weekly-product-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  text-align: left;
  text-transform: uppercase !important;
  width: 100%;
}

.weekly-product-cell img {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}

/* =========================================
   INVENTARIO · AUTO EGRESOS
========================================= */
.inventario-auto-egreso-row td {
  background: var(--lj-warning-soft) !important;
  border-bottom: 1px dashed var(--lj-warning) !important;
}

.inventario-auto-egreso-home-row td {
  background: var(--lj-danger-soft) !important;
  border-bottom: 1px dashed var(--lj-danger) !important;
}

.inventario-auto-egreso-badge {
  background: var(--lj-warning-soft);
  border-color: var(--lj-warning);
  color: var(--lj-warning);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inventario-auto-egreso-badge.is-home-delivery {
  background: var(--lj-danger-soft);
  border-color: var(--lj-danger);
  color: var(--lj-danger);
}


.swal2-popup.inventario-expand-alert .swal2-html-container {
  max-height: 78vh;
  overflow: auto;
}

.swal2-popup.inventario-expand-alert .inventario-table-compact-wrap {
  max-height: 70vh;
}

.produccion-expired-max-help {
  color: var(--lj-warning);
  font-weight: 700;
  font-size: 0.85rem;
}

.produccion-max-values {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.produccion-max-base {
  text-decoration: line-through;
}

.produccion-max-adjusted {
  color: var(--lj-warning) !important;
  margin-top: 0 !important;
  line-height: 1.05;
}


.produccion-card.tone-expired {
  border-color: color-mix(in srgb, var(--lj-warning) 35%, var(--lj-surface));
  background: var(--lj-warning-soft);
}

.produccion-chip.tone-expired {
  color: var(--lj-warning);
  background: var(--lj-warning-soft);
  border-color: color-mix(in srgb, var(--lj-warning) 35%, var(--lj-surface));
}

/* ── three-dots more menu ── */
.produccion-more-wrap {
  position: relative;
}

.produccion-more-btn {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--lj-muted);
  border-color: var(--lj-border);
  background: transparent;
  transition: background 0.14s, color 0.14s, transform 0.12s;
}
.produccion-more-btn:hover {
  background: var(--lj-surface-2) !important;
  color: var(--lj-text);
  transform: scale(1.08);
}
.produccion-more-btn:active { transform: scale(0.93); }

.produccion-more-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .25);
  min-width: 246px;
  z-index: 300;
  overflow: hidden;
  transform-origin: bottom right;
  animation: pmMenuIn 0.2s cubic-bezier(0.34, 1.5, 0.64, 1) both;
}
@keyframes pmMenuIn {
  from { opacity: 0; transform: scale(0.86) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.produccion-more-menu-header {
  padding: 12px 16px 6px;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lj-muted);
}

.produccion-more-divider {
  height: 1px;
  background: var(--lj-surface-2);
  margin: 0 12px 4px;
}

.produccion-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.produccion-more-item:hover { background: var(--lj-warning-soft); }
.produccion-more-item:disabled{opacity: .48;cursor: not-allowed;}
.produccion-more-item:disabled:hover{background: none;}

.produccion-more-item-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--lj-radius-lg);
  background: var(--lj-warning-soft);
  border: 1px solid color-mix(in srgb, var(--lj-warning) 35%, var(--lj-surface));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--lj-warning);
  flex-shrink: 0;
}

.produccion-more-item-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.produccion-more-item-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lj-warning);
  line-height: 1.2;
}

.produccion-more-item-desc {
  font-size: 0.72rem;
  color: var(--lj-warning);
  line-height: 1.3;
}

/* --- sin-trazabilidad banner in editor --- */
.produccion-sin-traz-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--lj-warning-soft);
  border: 1px solid color-mix(in srgb, var(--lj-warning) 35%, var(--lj-surface));
  border-radius: var(--lj-radius-lg);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--lj-warning);
  margin-bottom: 14px;
}

.produccion-sin-traz-banner i {
  font-size: 1rem;
  color: var(--lj-warning);
  flex-shrink: 0;
}

.produccion-sin-traz-banner strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* --- Lote antiguo (producción retroactiva) --- */
.produccion-lote-antiguo-banner {
  background: var(--lj-surface-2);
  border-color: var(--lj-border);
  color: var(--lj-accent);
}

.produccion-lote-antiguo-banner i {
  color: var(--lj-accent);
}

/* --- Producción: vista compacta --- */
.produccion-view-toggle-btn.is-active {
  background: var(--lj-accent-soft);
  border-color: var(--lj-border-strong);
  color: var(--lj-accent);
}

.produccion-list.is-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.produccion-compact-row {
  display: grid;
  grid-template-columns: 34px 10px minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border: 1px solid var(--lj-border);
  border-left-width: 4px;
  border-radius: 0 var(--lj-radius-lg) var(--lj-radius-lg) 0;
  background: var(--lj-surface);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.produccion-compact-row:hover {
  background: var(--lj-surface-2);
  border-color: var(--lj-border-strong);
}

.produccion-compact-row.tone-success { border-left-color: var(--lj-success); }
.produccion-compact-row.tone-warning { border-left-color: var(--lj-warning); }
.produccion-compact-row.tone-danger { border-left-color: var(--lj-danger); }
.produccion-compact-row.tone-expired { border-left-color: var(--lj-accent); }

.produccion-compact-row .produccion-semaforo {
  justify-self: center;
}

.produccion-compact-row.tone-success .produccion-semaforo { background: var(--lj-success); }
.produccion-compact-row.tone-warning .produccion-semaforo { background: var(--lj-warning); }
.produccion-compact-row.tone-danger .produccion-semaforo { background: var(--lj-danger); }
.produccion-compact-row.tone-expired .produccion-semaforo { background: var(--lj-accent); }

.produccion-compact-thumb {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lj-accent-soft);
  flex-shrink: 0;
}

.produccion-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.produccion-compact-thumb .image-placeholder-circle-2 {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.produccion-compact-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.produccion-compact-name strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.produccion-compact-name small {
  font-size: 0.72rem;
  color: var(--lj-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.produccion-compact-uses {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lj-muted);
  background: var(--lj-accent-soft);
  border: 1px solid var(--lj-border);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.produccion-compact-uses i {
  font-size: 0.62rem;
}

.produccion-compact-max {
  font-size: 0.88rem;
  color: var(--lj-accent);
  white-space: nowrap;
}

.produccion-compact-max span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--lj-muted);
}

.produccion-compact-max.is-zero {
  color: var(--lj-danger);
}

.produccion-compact-produce-btn {
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--lj-radius-lg);
}

.produccion-compact-produce-btn i {
  font-size: 0.85rem;
}

.produccion-compact-row .produccion-more-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px;
  min-height: 30px !important;
  font-size: 0.95rem;
}

/* En compacta el menú abre hacia abajo: hacia arriba quedaría recortado
   por el overflow del listado en las primeras filas. */
.produccion-compact-row .produccion-more-menu {
  bottom: auto;
  top: calc(100% + 8px);
  transform-origin: top right;
}

@media (max-width: 576px) {
  .produccion-compact-row {
    grid-template-columns: 30px 8px minmax(0, 1fr) auto auto auto;
    gap: 8px;
    padding: 4px 8px;
  }

  .produccion-compact-uses {
    display: none;
  }

  .produccion-compact-thumb {
    width: 30px;
    height: 30px;
  }
}

.produccion-lote-antiguo-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
  color: var(--lj-accent);
  font-size: 0.68rem;
  font-weight: 600;
}

.produccion-lote-antiguo-tag i {
  font-size: 0.72rem;
}

/* --- nombre comercial in editor header --- */
.produccion-nombre-comercial-editor {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lj-muted);
  margin: 2px 0 0;
}

.produccion-progress-wrap.is-expired-only small {
  color: var(--lj-warning);
}

.produccion-progress-bar span.is-expired {
  background: var(--lj-warning);
}

.produccion-max-expired-only {
  color: var(--lj-danger) !important;
}


/* =========================================
   INVENTARIO · controles Shoelace (sl-button / sl-input / sl-checkbox)
   Las clases heredadas de los botones ahora viven en el host del sl-button:
   se neutraliza la caja del host y el aspecto se define en ::part(base).
========================================= */
#inventarioModal [hidden],
.lj-alert [hidden] {
  display: none !important;
}

sl-button.inventario-status-btn,
sl-button.inventory-production-action-btn,
sl-button.inventario-threshold-btn,
sl-button.inventario-head-action,
sl-button.inventario-expand-btn,
sl-button.inventario-delete-btn,
sl-button.inventario-no-photo-btn,
sl-button.inventario-page-btn,
sl-button.inventario-icon-only-btn,
sl-button.inventario-add-bulk-btn,
sl-button.inventario-weekly-config-btn,
#inventarioModal sl-button.recipe-table-action-btn {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  min-width: 0;
  width: auto;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
  color: inherit;
  font-size: inherit;
  transform: none;
}

/* Filtros de estado (chips, guía modal Ingredientes): neutros, activo en acento; el contador toma el color del estado */
sl-button.inventario-status-btn { flex: 0 0 auto; }
sl-button.inventario-status-btn::part(base) {
  height: 30px;
  min-height: 30px;
  line-height: 28px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--lj-surface);
  border-color: var(--lj-border-strong);
  color: var(--lj-text);
}
sl-button.inventario-status-btn::part(label) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
}
sl-button.inventario-status-btn::part(prefix) { padding-left: 10px; }
sl-button.inventario-status-btn strong {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 18px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: 4px;
  text-align: center;
  background: var(--lj-surface-2);
  color: var(--lj-text);
}
sl-button.inventario-status-btn::part(prefix) { font-size: 12px; color: var(--lj-muted); }
sl-button.inventario-status-btn.is-active::part(prefix) { color: var(--lj-accent); }
sl-button.inventario-status-btn.is-active strong { background: var(--lj-accent); color: var(--lj-surface); }
sl-button.inventario-status-btn::part(base):hover { border-color: var(--lj-accent); color: var(--lj-accent); background: var(--lj-surface); }
sl-button.inventario-status-btn.is-active::part(base) {
  background: var(--lj-accent-soft);
  border-color: var(--lj-accent);
  color: var(--lj-accent);
}
sl-button.inventario-status-btn[disabled]::part(base) { opacity: .55; }
.inventario-status-divider { align-self: center; height: 22px; }

/* Acciones de la tarjeta de inventario */
.inventario-actions-row.inventory-production-actions { gap: 8px; align-items: center; }

/* Botones con identidad propia */
/* Secundarias de las barras de tablas: default neutro; eliminar sólo con ícono rojo. */
sl-button.inventario-delete-btn[variant="default"]::part(base) {
  color: var(--lj-danger);
}
sl-button.inventario-delete-btn[variant="default"]::part(base):hover { border-color: var(--lj-danger); }
#inventarioModal sl-button.recipe-table-action-btn { min-width: 0; }

/* Botón RNE de la barra: contador como sufijo */
#inventarioProvidersRneBtn .inventario-rne-alert-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--lj-danger);
  color: var(--lj-surface);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

/* Paginación */
.inventario-pagination.enhanced { align-items: center; }
.inventario-pagination.enhanced > span { font-size: 13px; color: var(--lj-muted); }

/* Tablas: acciones compactas alineadas */
.inventario-entry-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.inventario-entry-more-menu sl-button { width: 100%; }
.inventario-entry-more-menu sl-button::part(base) { justify-content: flex-start; color: var(--lj-danger); }

/* Campos del editor de ingreso */
#inventarioEditorForm sl-input,
#inventarioEditorForm sl-select,
#inventarioEditorForm sl-textarea,
#inventarioEditorForm input.lj-input {
  width: 100%;
}
#inventarioEditorForm .lj-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
#inventarioEditorForm .lj-label .inventario-step-icon { color: var(--lj-accent); }
#inventarioEditorForm .inventario-table-head sl-input { flex: 1 1 260px; }
.inventario-lot-separator sl-select,
sl-select#lotSeparator { max-width: 140px; }
#inventarioEditorForm .recipe-ing-input-wrap sl-input { flex: 1 1 auto; min-width: 0; }
#inventarioEditorForm .inventario-bulk-unit-cell { display: grid; gap: 6px; }

/* Checkboxes (sl-checkbox) con la clase de fila heredada */
sl-checkbox.inventario-check-row {
  display: flex;
  padding: 2px 0;
  font-size: 13px;
}
sl-checkbox.inventario-check-row::part(base) { align-items: center; }
sl-checkbox.inventario-check-row::part(label) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lj-text);
  font-weight: 600;
}
sl-checkbox.inventario-selector-row { width: 100%; padding: 6px 0; }
.inventario-frozen-row { display: inline-flex; align-items: center; gap: 6px; }
.inventario-bulk-row-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.inventario-infinite-toggle { display: inline-flex; align-items: center; gap: 8px; }
.inventario-infinite-toggle sl-switch::part(label) { font-size: 13px; font-weight: 600; color: var(--lj-text); }
.inventario-radio-group sl-radio + sl-radio { margin-top: 6px; }
.inventario-radio-group sl-radio::part(label) { font-size: 13px; font-weight: 600; color: var(--lj-text); }

/* Tarjetas "Tipo de producto": el sl-checkbox real va oculto */
.inventario-flag-tile > sl-checkbox.inventario-flag-tile-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
#inventarioEditorForm .inventario-flags-block {
  background: var(--lj-surface-2);
  border-color: var(--lj-border);
  border-radius: var(--lj-radius-lg);
}
#inventarioEditorForm .inventario-flags-head { color: var(--lj-brand); border-bottom-color: var(--lj-border); }
#inventarioEditorForm .inventario-flags-head sl-icon { color: var(--lj-accent); }
#inventarioEditorForm .inventario-flag-tile {
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  box-shadow: none;
}
#inventarioEditorForm .inventario-flag-tile:hover { border-color: var(--lj-border-strong); background: var(--lj-surface); }
#inventarioEditorForm .inventario-flag-tile.is-checked {
  border-color: var(--lj-accent);
  background: var(--lj-accent-soft);
}
#inventarioEditorForm .inventario-flag-tile-title { color: var(--lj-text); }
#inventarioEditorForm .inventario-flag-tile-desc { color: var(--lj-muted); }
#inventarioEditorForm .inventario-flag-tile-icon {
  background: var(--lj-surface-2);
  color: var(--lj-accent);
  border-radius: var(--lj-radius-lg);
  font-size: 18px;
}
#inventarioEditorForm .inventario-flag-tile.is-checked .inventario-flag-tile-icon { background: var(--lj-surface); }
#inventarioEditorForm .inventario-flag-tile-check {
  background: var(--lj-surface);
  border-color: var(--lj-border-strong);
  color: transparent;
}
#inventarioEditorForm .inventario-flag-tile-check sl-icon { font-size: 14px; }
#inventarioEditorForm .inventario-flag-tile.is-checked .inventario-flag-tile-check {
  background: var(--lj-accent);
  border-color: var(--lj-accent);
  color: var(--lj-surface);
}
#inventarioEditorForm .inventario-flag-tile[data-flag="autoegreso"].is-checked { border-color: var(--lj-success); background: var(--lj-success-soft); }
#inventarioEditorForm .inventario-flag-tile[data-flag="autoegreso"].is-checked .inventario-flag-tile-check { background: var(--lj-success); border-color: var(--lj-success); }
#inventarioEditorForm .inventario-flag-tile[data-flag="noperecedero"].is-checked { border-color: var(--lj-warning); background: var(--lj-warning-soft); }
#inventarioEditorForm .inventario-flag-tile[data-flag="noperecedero"].is-checked .inventario-flag-tile-check { background: var(--lj-warning); border-color: var(--lj-warning); }
#inventarioEditorForm .inventario-flag-tile.is-from-pref { box-shadow: none; }
#inventarioEditorForm .inventario-flag-tile-pref { color: var(--lj-warning); background: var(--lj-warning-soft); border-color: color-mix(in srgb, var(--lj-warning) 30%, var(--lj-surface)); }

/* Botón de información "congelado" (sl-icon-button) */
sl-icon-button.frozen-info-icon {
  width: auto;
  height: auto;
  border: 0;
  background: none;
  font-size: 16px;
  color: var(--lj-accent);
}
sl-icon-button.frozen-info-icon:hover { background: none; }
sl-icon-button.frozen-info-icon::part(base) { padding: 4px; color: var(--lj-accent); }
sl-icon-button.inventario-flag-tile-info-btn,
sl-icon-button.inventario-flag-tile-info-btn:hover { transform: translateY(-50%); }

/* Encabezados colapsables y tiles (button.lj-tile) */
button.lj-tile.inventario-collapse-head,
button.lj-tile.inventario-zone-toggle { border-radius: var(--lj-radius-lg); }
button.lj-tile.family-circle-toggle { border-color: transparent; background: none; }
button.lj-tile.family-circle-item { border: 0; background: none; }
button.lj-tile.produccion-rne-expiry-alert { width: 100%; }

/* Badges de sugerencia de vencimiento (sl-badge) */
sl-badge.inventario-suggest-badge::part(base) { font-size: 11px; font-weight: 600; padding: 3px 8px; }
sl-badge.inventario-suggest-badge.is-empty::part(base) { font-weight: 500; }

/* Inputs nativos de archivo visibles */
input[type="file"].inventario-native-file {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--lj-muted);
}
input[type="file"].inventario-native-file::file-selector-button {
  height: 30px;
  margin-right: 10px;
  padding: 0 12px;
  border: 1px solid var(--lj-border-strong);
  border-radius: var(--lj-radius);
  background: var(--lj-surface);
  color: var(--lj-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Alertas de inventario (LJAlert): campos y controles */
.lj-alert .inventario-inline-field { display: flex; gap: 8px; align-items: center; }
.lj-alert .inventario-inline-field sl-input { flex: 1 1 auto; }
.lj-alert .swal-stack-fields { display: grid; gap: 8px; }
.lj-alert .lj-label { margin-top: 8px; margin-bottom: 4px; }
.lj-alert sl-input.swal2-input,
.lj-alert sl-select.swal2-select,
.lj-alert sl-select.swal2-input,
.lj-alert sl-textarea.swal2-textarea,
.lj-alert input.lj-input.swal2-input { width: 100%; margin: 0; }
.lj-alert .inventario-weekly-family-dropdown sl-button::part(label) { display: inline-flex; gap: 6px; align-items: center; }

/* Planilla semanal (gestor masivo) */
sl-dialog.lj-alert-dialog:has(.inventario-weekly-bulk-alert) { --width: min(1100px, 96vw); }
sl-dialog.lj-alert-dialog:has(.inventario-expand-alert) { --width: 96vw; }
sl-dialog.lj-alert-dialog:has(.inventario-provider-rne-alert) { --width: min(960px, 94vw); }
.inventario-weekly-toolbar-v2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inventario-weekly-toolbar-v2 sl-input.inventario-weekly-search { flex: 1 1 240px; max-width: 360px; }
.inventario-weekly-field { display: grid; gap: 4px; }
.inventario-weekly-field .lj-label { margin: 0; }
.inventario-weekly-family-menu { max-height: 320px; overflow: auto; }

/* Centro de proveedores RNE */
.inventario-provider-manager sl-input.inventario-provider-search { margin-bottom: 8px; }
.inventario-provider-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Visor de imágenes compartido */
.image-viewer-modal .lj-dialog-body { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }

/* Historial por período: el input de rango es un .lj-input nativo (flatpickr) */
#inventarioGlobalRange,
#produccionGlobalRange {
  flex: 0 0 auto;
  width: 100%;
  height: var(--sl-input-height-medium);
}
.inventario-period-filters .inventario-period-actions-scroll { padding-bottom: 2px; }
#inventarioEntriesRange { width: 100%; }

/* Planilla semanal: filas */
.inventario-weekly-grid.inventario-weekly-grid-v2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: end; }
.inventario-weekly-checks { display: grid; gap: 6px; }
.inventario-weekly-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inventario-weekly-product-head h6 { font-size: 14px; font-weight: 700; }
.inventario-weekly-thumb-wrap { width: 40px; height: 40px; flex: 0 0 auto; }
@media (max-width: 768px) {
  .inventario-weekly-grid.inventario-weekly-grid-v2 { grid-template-columns: minmax(0, 1fr); }
}

/* Alertas de inventario: que el contenido se adapte al ancho del diálogo (celular) */
.lj-alert.ingredientes-alert > * { min-width: 0; }
.lj-alert.ingredientes-alert .lj-alert-title { overflow-wrap: anywhere; }
.lj-alert .inventario-provider-manager-head { flex-wrap: wrap; }
.lj-alert .inventario-provider-manager-head .produccion-config-actions { flex-wrap: wrap; }
.lj-alert .inventario-provider-actions sl-button { flex: 0 0 auto; }
.lj-alert .inventario-status-filters { flex-wrap: wrap; overflow-x: visible; }
.inventario-weekly-field, .inventario-weekly-field sl-input, .inventario-weekly-checks { min-width: 0; }
.inventario-weekly-field .lj-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================
   INVENTARIO · diseño unificado (guía de modales, referencia: Ingredientes)
   Sólo presentación. Va al final para ganar a las capas v2/v3 anteriores.
========================================= */
/* Barra de herramientas */
#inventarioModal .inventario-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
#inventarioModal .inventario-toolbar > sl-input { flex: 1 1 260px; max-width: 420px; }
#inventarioModal .inventario-toolbar-actions { margin-left: auto; gap: 8px; flex-wrap: nowrap; padding-bottom: 0; }
#inventarioModal .inventario-toolbar .barra-separadora {
  display: inline-block;
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: var(--lj-border);
  flex: 0 0 1px;
}
@media (max-width: 767.98px) {
  #inventarioModal .inventario-toolbar > sl-input { flex-basis: 100%; max-width: none; }
  #inventarioModal .inventario-toolbar-actions { margin-left: 0; width: 100%; }
}

/* Avisos (vencidos / RNE) */
#inventarioModal .produccion-rne-expiry-alert {
  min-height: 0;
  padding: 10px 12px;
  border-radius: var(--lj-radius-lg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
#inventarioModal .produccion-expiry-alert-card { border-radius: var(--lj-radius-lg); }
#inventarioModal .inventario-rne-alert,
#inventarioModal .inventario-expiry-alert-host { margin-bottom: 10px; }

/* Chips de estado */
#inventarioModal .inventario-status-filters { gap: 6px; padding: 2px 0 10px; align-items: center; }

/* Indicador de scroll */
#inventarioModal .inventario-list.has-scroll-hint::after {
  font-size: 12px;
  font-weight: 600;
  color: var(--lj-accent);
  background: var(--lj-surface);
}

/* Vistas internas: editor de ingreso / historial */
#inventarioEditorForm .lj-label { font-size: 12px; font-weight: 600; color: var(--lj-muted); }
#inventarioEditorForm .recipe-step-card { border-radius: var(--lj-radius-lg); }
#inventarioEditorForm .step-title { font-size: 15px; }
#inventarioModal .inventario-period-board { background: var(--lj-surface); }
#inventarioModal .inventario-period-head .step-title { font-size: 15px; color: var(--lj-brand); }

/* Alertas de inventario con listas (RNE, planilla semanal): filas como tarjetas de la guía */
.lj-alert .inventario-provider-card {
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  padding: 12px;
  gap: 12px;
}
.lj-alert .inventario-provider-card:hover { border-color: var(--lj-border-strong); }
.lj-alert .inventario-provider-head strong { font-size: 15px; font-weight: 700; color: var(--lj-text); }
.lj-alert .inventario-provider-state,
.lj-alert .inventario-provider-line { font-size: 13px; color: var(--lj-muted); }
.lj-alert .inventario-provider-line strong { color: var(--lj-text); font-weight: 600; }
.lj-alert .inventario-provider-avatar { width: 56px; height: 56px; }
.lj-alert .inventario-weekly-row,
.lj-alert .inventario-weekly-row.is-perishable,
.lj-alert .inventario-weekly-row.is-non-perishable {
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  border-left: 3px solid var(--lj-border-strong);
  border-radius: var(--lj-radius-lg);
  padding: 10px 12px;
}
.lj-alert .inventario-weekly-row.is-perishable { border-left-color: var(--lj-success); }
.lj-alert .inventario-weekly-product-head p { font-size: 12px; }
.lj-alert .inventario-provider-manager-kicker { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lj-muted); margin: 0; }
.lj-alert .inventario-provider-manager-copy { font-size: 13px; color: var(--lj-muted); margin: 0; }


/* Barra de Inventario en celular: las acciones se acomodan en filas (todas visibles, sin scroll
   oculto) y la acción principal ocupa el ancho al final. */
@media (max-width: 767.98px) {
  #inventarioModal .inventario-toolbar.recetas-toolbar .inventario-toolbar-actions {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }
  #inventarioModal .inventario-toolbar.recetas-toolbar .inventario-toolbar-actions > sl-button { flex: 1 1 auto; }
  #inventarioModal .inventario-toolbar.recetas-toolbar .inventario-toolbar-actions > sl-button.lj-icon-btn { flex: 0 0 auto; }
  #inventarioModal .inventario-toolbar.recetas-toolbar .inventario-toolbar-actions > .recetas-toolbar-divider { display: none; }
  #inventarioModal .inventario-toolbar.recetas-toolbar .inventario-toolbar-actions > sl-button#inventarioToolbarCreateIngredientBtn { flex: 1 1 100%; margin-left: 0; }
  .inventario-status-filters.recetas-rnpa-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .inventario-status-filters.recetas-rnpa-filters > * { flex: 0 0 auto; }
}

/* Productos sincronizados con el POS (Ventas del local) */
.recetas-tag.tone-pos { display: inline-flex; align-items: center; gap: 4px; background: var(--lj-accent-soft); color: #0057ff; font-weight: 700; }
.sl-theme-dark .recetas-tag.tone-pos { color: var(--lj-accent); }
.recetas-tag.tone-pos img { background: #fff; border-radius: 3px; padding: 1px; }
.inv-pos { display: grid; gap: 10px; margin: 12px 0; padding: 12px 14px; background: var(--lj-surface); border: 1px solid var(--lj-border); border-radius: var(--lj-radius-lg); }
.inv-pos header { display: flex; gap: 10px; align-items: center; }
.inv-pos header div { display: flex; flex-direction: column; min-width: 0; }
.inv-pos header b { font-size: .9rem; color: var(--lj-text); }
.inv-pos header small { font-size: .78rem; color: var(--lj-muted); overflow-wrap: anywhere; }
.inv-pos-logo { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--lj-border); }
.inv-pos-logo img { width: 18px; height: 18px; }
.inv-pos-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.inv-pos-datos div { background: var(--lj-surface-2); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; }
.inv-pos-datos span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--lj-muted); }
.inv-pos-datos b { font-size: .95rem; color: var(--lj-text); font-variant-numeric: tabular-nums; }
.inv-pos-datos .is-esp b { color: var(--lj-warning); }
.inventario-auto-egreso-badge.is-pos { display: inline-flex; align-items: center; gap: 5px; }
.inventario-auto-egreso-badge.is-pos img { width: 12px; height: 12px; background: #fff; border-radius: 3px; padding: 1px; }

/* Planilla semanal: cómo baja el stock del producto */
.inv-planilla .inv-modo { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--lj-border); background: var(--lj-surface-2); margin: 4px 0 6px; }
.inv-planilla .inv-modo div { display: grid; gap: 2px; min-width: 0; }
.inv-planilla .inv-modo b { font-size: .9rem; color: var(--lj-text); }
.inv-planilla .inv-modo small { font-size: .8rem; color: var(--lj-muted); line-height: 1.4; overflow-wrap: anywhere; }
.inv-planilla .inv-modo-ico { flex: none; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: #fff; border: 1px solid var(--lj-border); color: var(--lj-muted); }
.inv-planilla .inv-modo-ico img { width: 16px; height: 16px; }
.inv-planilla .inv-modo.is-pos { border-color: #0057ff55; background: var(--lj-accent-soft); }
.inv-planilla .inv-modo.is-mp .inv-modo-ico { color: #b45309; }
.inv-planilla .inv-modo.is-ia .inv-modo-ico { color: var(--lj-accent); }
.inv-planilla .inv-ayuda { display: block; margin: -4px 0 6px 28px; font-size: .76rem; color: var(--lj-muted); line-height: 1.35; }
.inv-planilla .inv-ayuda.is-nota { margin-left: 0; display: flex; gap: 6px; align-items: baseline; }
.inv-planilla sl-input + .inv-ayuda { margin-left: 0; margin-top: 4px; }
.inv-modo-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 8px; border-radius: 5px; font-size: .78rem; font-weight: 600; background: var(--lj-surface-2); color: var(--lj-muted); }
.inv-modo-chip img { width: 14px; height: 14px; background: #fff; border-radius: 3px; padding: 1px; }
.inv-modo-chip.is-pos { background: var(--lj-accent-soft); color: #0057ff; }
.sl-theme-dark .inv-modo-chip.is-pos { color: var(--lj-accent); }
.inv-modo-chip.is-mp { background: #fef3c7; color: #92400e; }
.sl-theme-dark .inv-modo-chip.is-mp { background: #3a2a0c; color: #fbbf24; }

/* Trazabilidad de una venta POS: ingreso → venta → desglose */
.inv-traza { display: grid; gap: 0; }
.inv-traza-paso { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.inv-traza-paso:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--lj-border); }
.inv-traza-paso > div { display: grid; gap: 2px; min-width: 0; font-size: .82rem; }
.inv-traza-paso b { color: var(--lj-text); }
.inv-traza-paso small { color: var(--lj-muted); line-height: 1.4; overflow-wrap: anywhere; }
.inv-traza-paso small.is-esp { color: var(--lj-warning); }
.inv-traza-ico { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--lj-accent-soft); color: var(--lj-accent); }
.inv-traza-ico.is-pos { background: #fff; border: 1px solid var(--lj-border); }
.inv-traza-ico img { width: 16px; height: 16px; }
.inv-traza-comps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.inv-traza-comps li { display: grid; gap: 2px; padding: 7px 10px; border: 1px solid var(--lj-border); border-radius: 8px; background: var(--lj-surface-2); }
.inv-traza-comps li.is-este { border-color: var(--lj-accent); background: var(--lj-accent-soft); }
.inv-traza-este { font-size: .7rem; font-weight: 700; color: var(--lj-accent); }
.inv-traza-link { border: 0; background: none; padding: 0; color: var(--lj-accent); text-decoration: underline; cursor: pointer; font: inherit; }
