/* =========================================
   MODAL RECETAS
========================================= */
.receta-card {
  align-items: flex-start;
}

.receta-thumb-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.receta-thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .18s ease;
}

.receta-thumb.is-loaded,
.recipe-suggest-avatar.is-loaded,
.recipe-inline-avatar.is-loaded {
  opacity: 1;
}

.receta-card-meta {
  color: var(--lj-muted);
  font-size: 13px;
  margin: 0;
}

.receta-card-ingredients {
  margin-top: 2px;
  color: var(--lj-muted);
  font-size: 12px;
  line-height: 1.35;
}

.receta-card-dates {
  margin-top: 4px;
}

.receta-name {
  margin-bottom: 2px;
}

.receta-card-commercial,
.receta-card-folder {
  margin: 2px 0 0;
  line-height: 1.25;
  font-size: 12px;
  font-weight: 700;
}

.receta-card-commercial {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--lj-muted);
}

.receta-card-folder {
  color: var(--lj-muted);
}

.receta-card-folder span {
  margin-right: 5px;
}

/* Toolbar del listado: buscador + Imprimir + Crear receta a la misma altura */
.recetas-modal .ingredientes-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recetas-editor-header {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 2px;
}

.recetas-editor-kicker {
  margin: 0;
  color: var(--lj-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}

.recetas-editor-title {
  color: var(--lj-brand);
  font-size: 15px;
  font-weight: 700;
}

.recetas-editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-step-card {
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  text-align: start !important;
}

.recipe-step-card .step-title {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--lj-brand);
}

.recipe-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  font-size: 12px;
  font-weight: 700;
  background: var(--lj-accent-soft);
  color: var(--lj-accent);
  margin-right: 8px;
}

.recipe-description-lg::part(textarea) {
  min-height: 72px;
}

.recipe-step-card .lj-label {
  margin: 0 0 4px;
}

.recipe-highlight-field {
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface-2);
  padding: 10px;
}

.recipe-subsection-title {
  margin: 0;
  color: var(--lj-brand);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
}

.recipe-fields-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.recipe-field {
  min-width: 0;
}

.recipe-field-half {
  flex: 1 1 calc(50% - 6px);
}

.recipe-field-full {
  flex: 1 1 100%;
}

.recipe-highlight-field .lj-label {
  font-weight: 700;
  color: var(--lj-text);
}

.recipe-highlight-field .lj-label i {
  margin-right: 6px;
  color: var(--lj-accent);
}

/* Checkbox + botón de información en la misma línea */
.recipe-check-with-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.recipe-check-with-info .frozen-info-icon {
  margin-top: 0 !important;
}

/* RNPA */
.recipe-rnpa-block .recipe-rnpa-exempt-row {
  margin: 8px 0;
}

.recipe-rnpa-grid > sl-input,
.recipe-rnpa-grid > sl-select,
.recipe-rnpa-grid > .lj-input,
.recipe-rnpa-grid > .recipe-rnpa-file {
  width: 100%;
  min-width: 0;
}

.recipe-rnpa-grid .lj-input {
  width: 100%;
}

.recipe-rnpa-grid.is-disabled {
  opacity: .6;
}

.image-file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.image-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--lj-muted);
}

/* Tabla de ingredientes */
.recipe-table-wrap {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  /* Scroll lateral en celular (las tablas de salida de productos van directo acá, sin .recipe-table-scroll). */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin-top: 10px;
  background: var(--lj-surface);
}

.recipe-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.recipe-table {
  width: 100%;
  min-width: 100%;
  font-size: 13px;
  color: var(--lj-text);
  border-collapse: separate;
  border-spacing: 0;
}

.recipe-table th,
.recipe-table td {
  border-bottom: 1px solid var(--lj-border);
  padding: 8px;
  vertical-align: middle;
}

.recipe-table thead th {
  background: var(--lj-surface-2);
  color: var(--lj-muted);
  font-weight: 600;
  text-align: left;
}

.recipe-table tbody tr {
  background: var(--lj-surface);
}

.recipe-table tbody tr:nth-child(even) {
  background: var(--lj-surface-2);
}

.recipe-table tbody tr.is-comment {
  background: var(--lj-warning-soft);
}

.recipe-table tbody tr.is-monography {
  background: var(--lj-danger-soft);
}

.recipe-table td > i.fa-grip-lines {
  color: var(--lj-muted);
}

.recipe-table sl-input,
.recipe-table sl-select {
  width: 100%;
  min-width: 0;
}

.recipe-monography-toolbar {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.recipe-monography-editor {
  min-height: 140px;
  border: 1px solid var(--lj-border-strong);
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface);
  color: var(--lj-text);
  padding: 8px 10px;
}

.recipe-monography-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--lj-muted);
}
.recipe-monography-manual-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;}
.recipe-monography-manual-name{font-size:12px;color:var(--lj-muted);background:var(--lj-surface-2);border:1px solid var(--lj-border);padding:4px 8px;border-radius:4px;}

.recipe-table tbody tr.is-dragging {
  opacity: 0.55;
}

.recipe-table tbody tr.drag-over {
  outline: 2px dashed var(--lj-accent);
  outline-offset: -2px;
  background-color: var(--lj-accent-soft);
}

.recipe-table-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 10px;
}

.recipe-table-action-btn {
  min-width: 160px;
}

.recipe-table-action-btn-monography::part(base) {
  color: var(--lj-danger);
}

.recipe-table-action-btn-monography::part(base):hover {
  background: var(--lj-danger-soft);
  color: var(--lj-danger);
}

.dispatch-xlsx-conflicts-wrap {
  position: relative;
  display: inline-flex;
}

.dispatch-xlsx-conflicts-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 4px;
  background: var(--lj-danger);
  color: var(--lj-surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.dispatch-xlsx-conflicts-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 280px;
  background: var(--lj-surface);
  border-radius: var(--lj-radius-lg);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  border: 1px solid var(--lj-border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dispatch-xlsx-conflicts-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--lj-text);
  font-size: 13px;
}

.dispatch-xlsx-pagination {
  margin-top: 12px;
}

/* =========================================
   RECETAS · NUTRICIÓN IA
========================================= */
.recipe-nutrition-step {
  border-color: var(--lj-border);
  background: var(--lj-surface);
}

.recipe-highlight-field-nutrition {
  border-color: var(--lj-border);
  background: var(--lj-surface-2);
}

.recipe-nutrition-declaration-grid,
.recipe-nutrition-household-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recipe-nutrition-ai-actions {
  display: grid;
  gap: 8px;
}

.recipe-nutrition-head-actions {
  display: flex;
  justify-content: flex-start;
  margin: -2px 0 10px;
}

.recipe-nutrition-ai-btn {
  width: 100%;
  max-width: none;
}

.recipe-nutrition-head-actions .recipe-nutrition-ai-btn {
  width: auto;
  min-width: 220px;
}

.recipe-nutrition-ai-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.recipe-nutrition-ai-disclaimer {
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--lj-radius-lg);
  background: var(--lj-accent-soft);
  border: 1px solid var(--lj-border);
  color: var(--lj-text);
  font-size: 13px;
  line-height: 1.35;
}

.recipe-nutrition-autofill-recommendation {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--lj-radius-lg);
  border: 1px solid var(--lj-border);
  background: var(--lj-accent-soft);
  color: var(--lj-text);
  font-size: 13px;
  line-height: 1.35;
}

.recipe-nutrition-autofill-recommendation.is-warning {
  border-color: var(--lj-warning);
  background: var(--lj-warning-soft);
  color: var(--lj-warning);
}

.recipe-nutrition-autofill-recommendation.is-error {
  border-color: var(--lj-danger);
  background: var(--lj-danger-soft);
  color: var(--lj-danger);
}

.recipe-nutrition-ai-stale > i { margin-right: 6px; }

.recipe-nutrition-ai-stale {
  color: var(--lj-danger);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

.recipe-nutrition-ai-preview.is-stale {
  border-color: var(--lj-danger);
  background: var(--lj-danger-soft);
}

.recipe-nutrition-ai-preview.is-disabled {
  opacity: 0.95;
}

.recipe-nutrition-ai-table {
  border-radius: var(--lj-radius-lg);
  width: 100%;
  max-width: 100%;
}

.recipe-nutrition-ai-table,
.recipe-nutrition-ai-table * {
  max-width: 100%;
  box-sizing: border-box;
}

.recipe-nutrition-ai-table table {
  width: 100% !important;
  table-layout: fixed;
}

.recipe-nutrition-ai-table td,
.recipe-nutrition-ai-table th,
.recipe-nutrition-ai-table p,
.recipe-nutrition-ai-table span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recipe-nutrition-ai-table img {
  height: auto;
}

.recipe-nutrition-ai-table[contenteditable="true"] {
  outline: 2px dashed var(--lj-border-strong);
  outline-offset: 4px;
}

.recipe-nutrition-ai-table.is-locked {
  pointer-events: none;
  opacity: 0.85;
}

.recipe-nutrition-ai-help {
  margin: 8px 0 0;
  color: var(--lj-danger);
  background-color: var(--lj-danger-soft);
  font-size: 12px;
  text-align: center;
  border-radius: var(--lj-radius-lg);
  padding: 6px 10px;
}

.recipe-nutrition-ai-preview {
  margin-top: 8px;
  border: 1px dashed var(--lj-border-strong);
  background: var(--lj-surface);
  border-radius: var(--lj-radius-lg);
  padding: 12px;
  overflow-x: hidden;
}

.recipe-nutrition-ai-empty {
  margin: 0;
  color: var(--lj-muted);
}

.recipe-nutrition-product-meta h6 {
  margin: 0;
  color: var(--lj-brand);
  font-weight: 700;
}

.recipe-nutrition-product-meta p {
  margin: 4px 0 10px;
  color: var(--lj-muted);
  text-align: center;
}

.recipe-nutrition-front-labels{
  flex-direction: column;
  display: flex;
  align-items: center;
}

.recipe-nutrition-front-labels h6 {
  margin: 12px 0 8px;
  color: var(--lj-brand);
  font-weight: 700;
}

/* =========================================
   RECETAS · ETIQUETADO FRONTAL
   (réplica del sello oficial: negro y blanco en ambos temas)
========================================= */

.recipe-octagons-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.recipe-front-rectangles {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.recipe-octagon,
.recipe-front-rectangle {
  position: relative;
  color: #fff;
  text-align: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* =========================
   OCTÁGONOS
   Sin borde blanco
========================= */
.recipe-octagon {
  width: 112px;
  min-width: 112px;
  height: 112px;
  min-height: 112px;
  padding: 10px 8px 8px;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><polygon points='26,0 74,0 100,26 100,74 74,100 26,100 0,74 0,26' fill='%23111111'/></svg>");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  outline: none;
  box-shadow: none;
}

/* =========================
   RECTÁNGULOS
   Con borde blanco
========================= */
.recipe-front-rectangle {
  min-width: 236px;
  min-height: 78px;
  padding: 8px 12px;
  background: #111111;
  border: 3px solid #ffffff;
  outline: 2px solid #1d1d1d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

/* =========================
   TIPOGRAFÍA
========================= */
.recipe-octagon-title,
.recipe-front-rectangle-title {
  font-size: 0.95rem;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}

.recipe-octagon-ministry {
  margin-top: 5px;
  font-size: 0.58rem;
  line-height: 1;
  font-weight: 700;
  text-transform: none;
}

/* Si también usás ministry dentro de rectángulos */
.recipe-front-rectangle .recipe-octagon-ministry,
.recipe-front-rectangle .recipe-front-rectangle-ministry {
  margin-top: 5px;
  font-size: 0.58rem;
  line-height: 1;
  font-weight: 700;
  text-transform: none;
}

/* =========================
   COMPACTO
========================= */
.recipe-octagons-wrap.is-compact {
  gap: 6px;
}

.recipe-octagons-wrap.is-compact .recipe-octagon {
  width: 88px;
  min-width: 88px;
  height: 88px;
  min-height: 88px;
  padding: 7px 6px;
}

.recipe-front-rectangles.is-compact {
  gap: 6px;
  margin-top: 6px;
}

.recipe-front-rectangles.is-compact .recipe-front-rectangle {
  min-width: 174px;
  min-height: 60px;
  padding: 6px 8px;
}

.recipe-octagons-wrap.is-compact .recipe-octagon-title,
.recipe-front-rectangles.is-compact .recipe-front-rectangle-title {
  font-size: 0.66rem;
  line-height: 0.92;
}

.recipe-octagons-wrap.is-compact .recipe-octagon-ministry,
.recipe-front-rectangles.is-compact .recipe-front-rectangle .recipe-octagon-ministry,
.recipe-front-rectangles.is-compact .recipe-front-rectangle .recipe-front-rectangle-ministry {
  font-size: 0.44rem;
  margin-top: 4px;
}

.recipe-nutrition-front-empty {
  margin: 0;
  color: var(--lj-muted);
}


/* =========================================
   RECETAS · TARJETA NUTRICIONAL
   (réplica del rótulo impreso: fondo blanco y texto negro en ambos temas)
========================================= */
.recipe-nutrition-label-card {
  width: min(340px, 100%);
  margin: 0 auto;
  border: 2px solid #2f2f2f;
  padding: 10px;
  background: #ffffff;
  font-family: 'Roboto', 'Arial', sans-serif;
  color: #1f1f1f;
}

.recipe-nutrition-label-card h3 {
  margin: 0 0 4px;
  text-align: center;
  letter-spacing: 0.14em;
  font-size: 1rem;
  font-weight: 800;
  color: #1f1f1f;
}

.recipe-nutrition-product-name {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

.recipe-nutrition-serving,
.recipe-nutrition-subtitle,
.recipe-nutrition-dv,
.recipe-nutrition-micros,
.recipe-nutrition-footnote {
  margin: 0;
}

.recipe-nutrition-serving {
  font-size: 0.95rem;
  font-weight: 600;
}

.recipe-nutrition-bar {
  height: 12px;
  background: #000;
  margin: 8px 0;
}

.recipe-nutrition-subtitle {
  font-weight: 800;
  font-size: 1.1rem;
}

.recipe-nutrition-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.98rem;
}

.recipe-nutrition-rule {
  border-top: 2px solid #4b4b4b;
  margin: 8px 0;
}

.recipe-nutrition-dv {
  text-align: right;
  font-weight: 700;
}

.recipe-nutrition-table-fixed {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  color: #1f1f1f;
}

.recipe-nutrition-table-fixed td {
  border-top: 1px solid #848484;
  padding: 4px 0;
}

.recipe-nutrition-table-fixed td:last-child {
  text-align: right;
  font-weight: 700;
}

.recipe-nutrition-table-fixed .indent {
  padding-left: 18px;
}

.recipe-nutrition-micros {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.recipe-nutrition-footnote {
  margin-top: 8px;
  font-size: 0.82rem;
  line-height: 1.3;
}

.recipe-image-layout {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}

.recipe-image-preview {
  width: 120px;
  height: 120px;
}

.recipe-image-inputs {
  display: grid;
  gap: 10px;
}

.recipe-editor-actions {
  display: flex;
  justify-content: flex-end;
}

.recipe-ing-autocomplete {
  position: relative;
  z-index: 30;
}

/* =========================================
   SUGERENCIAS Y AUTOCOMPLETE (RECETAS)
   (flotante en body por encima del sl-dialog)
========================================= */
.recipe-suggest-floating {
  position: absolute;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--lj-border-strong);
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface);
  color: var(--lj-text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  z-index: 1200;
}

.recipe-ing-autocomplete .recipe-suggest-floating {
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 220px);
  min-width: 220px;
}

.recipe-suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--lj-text);
  font-size: 13px;
  padding: 8px 10px;
  text-align: left;
}

.recipe-suggest-item:hover {
  background: var(--lj-accent-soft);
}

.recipe-suggest-create {
  border-top: 1px solid var(--lj-border);
  color: var(--lj-accent);
  font-weight: 700;
}

.recipe-suggest-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
  opacity: 0;
  transition: opacity .18s ease;
}

.recipe-suggest-avatar-wrap {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.recipe-suggest-avatar-wrap .image-placeholder-circle-2 {
  width: 100%;
  height: 100%;
  border: 0;
  display: flex;
}

.recipe-suggest-avatar-wrap .image-placeholder-circle-2 i {
  font-size: 0.7rem;
}

.recipe-ing-input-wrap {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
}

.recipe-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recipe-related-row-note {
  margin: 8px 0 0;
  color: var(--lj-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.recipe-related-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recipe-related-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
  color: var(--lj-text);
}

.recipe-related-chip strong,
.recipe-related-picker-label strong,
.recipe-related-picker-copy strong {
  display: block;
  font-size: 13px;
}

.recipe-related-chip small,
.recipe-related-picker-label small,
.recipe-related-picker-copy small,
.recipe-related-empty {
  color: var(--lj-muted);
  font-size: 12px;
}

.recipe-related-picker {
  display: grid;
  gap: 12px;
  text-align: left;
}

.recipe-related-picker-head {
  display: grid;
  gap: 10px;
}

.recipe-related-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
}

.recipe-related-primary > div {
  display: grid;
  gap: 4px;
}

.recipe-related-selected-wrap,
.recipe-related-picker-list {
  display: grid;
  gap: 8px;
  max-height: 26vh;
  overflow-y: auto;
  padding-right: 4px;
}

.recipe-related-picker-selected {
  display: grid;
  gap: 8px;
}

.recipe-related-picker-chip,
.recipe-related-picker-row {
  border-radius: var(--lj-radius-lg);
  border: 1px solid var(--lj-border);
  background: var(--lj-surface);
  padding: 8px 10px;
}

.recipe-related-picker-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

/* sl-checkbox de la lista: avatar + textos en fila */
sl-checkbox.recipe-related-picker-row::part(base) {
  align-items: center;
  width: 100%;
}

sl-checkbox.recipe-related-picker-row::part(label) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.recipe-related-picker-copy {
  display: grid;
  gap: 6px;
}

.recipe-related-percent-input {
  max-width: 220px;
}

.recipe-inline-avatar-wrap {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.recipe-inline-avatar-wrap .recipe-small-placeholder {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

.recipe-inline-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .18s ease;
}

.recipe-inline-avatar-wrap .image-placeholder-circle-2,
.receta-thumb-wrap .image-placeholder-circle-2 {
  width: 100%;
  height: 100%;
  border: 0;
}

.recipe-inline-avatar-wrap .image-placeholder-circle-2 i,
.receta-thumb-wrap .image-placeholder-circle-2 i {
  font-size: 0.7rem;
}

.selector-section-label {
  display: flex;
  width: fit-content;
  align-items: center;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--lj-accent-soft);
  color: var(--lj-accent);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.recipe-small-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lj-accent-soft);
  color: var(--lj-accent);
}

.recipe-small-placeholder i {
  font-size: 0.92rem;
}

.recipe-inline-avatar-wrap .thumb-loading,
.receta-thumb-wrap .thumb-loading,
.recipe-suggest-avatar-wrap .thumb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lj-surface-2);
}

/* Spinner dentro de miniaturas: proporcional al círculo */
.receta-thumb-wrap .thumb-loading sl-spinner {
  font-size: 22px;
}

.recipe-inline-avatar-wrap .thumb-loading sl-spinner,
.recipe-suggest-avatar-wrap .thumb-loading sl-spinner {
  font-size: 14px;
  --track-width: 2px;
}

.receta-print-selector-thumb .thumb-loading sl-spinner {
  font-size: 18px;
}

.recipe-ai-input {
  margin-top: 4px;
}

.image-field-block {
  display: grid;
  gap: 6px;
}

.swal-stack-fields {
  display: grid;
  gap: 10px;
}

.swal2-popup.produccion-secure-alert :is(.swal2-input, .swal2-textarea, .swal2-select) {
  margin: 0;
  width: 100%;
}

.swal2-popup.produccion-secure-alert .swal-stack-fields {
  gap: 8px;
}

.inventario-total-banner{
  display: flex;
  gap: 5px;
  align-items: center;
  background-color: var(--lj-accent-soft);
  padding: 5px 10px;
  border-radius: var(--lj-radius-lg);
}

.inventario-total-banner small{
  color: var(--lj-accent);
}

.inventario-total-banner strong {
  color: var(--lj-accent);
  font-size: 18px;
  font-weight: 800;
}

.boton-fc{
  width: fit-content !important;
}

@media (max-width: 768px) {
  .recetas-editor-form,
  .recipe-step-card,
  .recipe-highlight-field,
  .recipe-field,
  .recipe-nutrition-ai-preview,
  .recipe-nutrition-ai-table {
    min-width: 0;
  }

  .recipe-field-half {
    flex: 1 1 100%;
  }

  .recipe-table-wrap,
  .recipe-table-scroll,
  .recipe-table-actions {
    min-width: 0;
  }

  .recipe-table-scroll .recipe-table {
    min-width: 720px;
  }

  .recipe-table-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .recipe-table-action-btn {
    width: 100%;
    min-width: 0;
  }

  .recipe-nutrition-declaration-grid,
  .recipe-nutrition-household-grid,
  .recipe-nutrition-two-cols {
    grid-template-columns: 1fr;
  }

  .recipe-nutrition-head-actions .recipe-nutrition-ai-btn {
    width: 100%;
    min-width: 0;
  }

  .recipe-nutrition-label-card {
    width: 100%;
    max-width: 100%;
    padding: 8px;
  }

  .recipe-ing-autocomplete .recipe-suggest-floating {
    width: max(100%, 240px);
    min-width: 240px;
    max-width: calc(100vw - 84px);
  }
}

.recipe-row-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--lj-radius-lg);
  border: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
  color: var(--lj-text);
}

.recipe-table .recipe-row-actions {
  flex-direction: row;
  border: 0;
  background: transparent;
  padding: 0;
  gap: 4px;
}

/* =========================================
   RECETAS / IMPRESION
========================================= */
.receta-print-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
}

.receta-print-btn {
  width: fit-content;
  flex: 0 0 auto;
  white-space: nowrap;
}

.receta-print-btn i {
  font-size: 12px;
}

.receta-print-selector-thumb {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.receta-print-thumb-fit {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
  padding: 5px;
  border-radius: 50%;
  background: #fff;
  display: block;
}

/* Selector de alcance de impresión (sl-radio-group + sl-checkbox por receta) */
.recipe-print-scope-group {
  margin-bottom: 8px;
}

.recipe-print-scope-group sl-radio + sl-radio {
  margin-top: 6px;
}

#recipePrintManualScope sl-checkbox.inventario-selector-row {
  display: flex;
  padding: 6px 0;
}

#recipePrintManualScope sl-checkbox.inventario-selector-row::part(base) {
  align-items: center;
}

#recipePrintManualScope sl-checkbox.inventario-selector-row::part(label) {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Render oculto para html2canvas: estilo de impresión fijo (no seguir el tema) */
.recipe-print-render-host {
  position: fixed;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.recipe-print-render-root {
  background: #ffffff;
  border: 1px solid #e4e8f4;
  border-radius: 12px;
  padding: 12px;
  width: 380px;
}

.recipe-print-render-root.mode-front {
  width: 420px;
}

.recipe-print-nutrition .recipe-nutrition-label-card {
  width: 100%;
  max-width: 100%;
}

.recipe-print-front .recipe-octagons-wrap,
.recipe-print-front .recipe-front-rectangles {
  justify-content: center;
}

.recipe-print-panel {
  display: grid;
  gap: 12px;
}

.recipe-print-loading {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.recipe-print-loading p {
  margin: 0;
}

.recipe-print-loading-container {
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  max-height: none !important;
}

.recipe-print-loader {
  font-size: 54px;
}

.recipe-print-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.recipe-print-field {
  display: grid;
  gap: 4px;
  text-align: left;
}

.recipe-print-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--lj-muted);
}

.recipe-print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  text-align: left;
}

.recipe-print-meta strong,
.recipe-print-meta span {
  background: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--lj-text);
}

.recipe-print-preview-wrap {
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface-2);
  padding: 10px;
  max-height: 58vh;
  overflow: auto;
}

/* Vista previa de la hoja: siempre blanca como el papel */
.recipe-print-preview-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--lj-radius);
  background: #ffffff;
}

.receta-front-inline {
  margin-top: 6px;
}

sl-dialog.lj-alert-dialog:has(.recipe-print-alert) {
  --width: 820px;
}

.recipe-print-alert .lj-alert-actions {
  gap: 12px;
}

.recipe-print-alert .lj-alert-actions sl-button {
  position: relative;
}

.recipe-print-alert .lj-alert-actions sl-button:last-child::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 24px;
  background: var(--lj-border-strong);
}

/* =========================================
   RECETAS · controles Shoelace y clases compartidas con otros módulos
   (los estilos base de .family-manage-btn, .image-method-btn y .editor-btn viven en sus módulos)
========================================= */
.recetas-editor-form .recipe-step-card {
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--lj-border);
}

.recetas-modal .recipe-step-card sl-checkbox.inventario-check-row {
  display: flex;
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
}

.recetas-modal .recipe-step-card sl-checkbox::part(label) {
  color: var(--lj-text);
  font-weight: 600;
}

.recetas-modal .recipe-step-card .recipe-check-with-info sl-checkbox.inventario-check-row {
  display: inline-flex;
}

.recetas-modal .image-method-buttons {
  margin-bottom: 10px;
}

.recetas-modal .recipe-rnpa-actions {
  padding: 0;
  margin: 0;
}

.recetas-modal .recipe-rnpa-block {
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  padding: 10px;
  background: var(--lj-surface-2);
}

/* Alerta de RNPA por vencer (botón colapsable) */
.recetas-modal .produccion-rne-expiry-alert {
  width: 100%;
  border-radius: var(--lj-radius-lg);
  font-size: 13px;
  border: 1px solid var(--lj-warning);
  background: var(--lj-warning-soft);
  color: var(--lj-warning);
}
.recetas-modal .produccion-rne-expiry-alert.is-danger { border-color: var(--lj-danger); background: var(--lj-danger-soft); color: var(--lj-danger); }
.recetas-modal .produccion-rne-expiry-alert.is-ok { border-color: var(--lj-success); background: var(--lj-success-soft); color: var(--lj-success); }

/* Lista de asignación de recetas a un grupo (sl-checkbox por receta) */
sl-checkbox.produccion-group-assign-row {
  display: flex;
}

sl-checkbox.produccion-group-assign-row::part(base) {
  align-items: center;
  width: 100%;
}

sl-checkbox.produccion-group-assign-row::part(label) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
