/* Keep production mobile actions compact and aligned with the row content. */
@media (max-width: 1280px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    display: grid !important;
    grid-template-columns: 40px minmax(72px, 132px) 36px 36px 36px !important;
    justify-content: start !important;
    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 0 !important;
    width: 100% !important;
    min-height: 52px !important;
    padding: 8px 8px !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-row > * {
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-self: start !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-id,
  body.admin-body main.orders-screen .production-card .production-order-client {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-id strong,
  body.admin-body main.orders-screen .production-card .production-order-id span,
  body.admin-body main.orders-screen .production-card .production-order-client strong,
  body.admin-body main.orders-screen .production-card .production-order-client span {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products,
  body.admin-body main.orders-screen .production-card .production-order-meta,
  body.admin-body main.orders-screen .production-card .production-send-form {
    display: grid !important;
    place-items: center !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    margin: 0 !important;
    transform: none !important;
    justify-self: start !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products .production-item-chip,
  body.admin-body main.orders-screen .production-card .production-order-products .muted {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    display: grid !important;
    place-items: center !important;
    box-sizing: border-box !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    transform: none !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message strong,
  body.admin-body main.orders-screen .production-card .production-card-message p,
  body.admin-body main.orders-screen .production-card .production-send-form button b {
    display: none !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message::before,
  body.admin-body main.orders-screen .production-card .production-card-message.empty::before {
    content: "✉" !important;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    color: var(--theme-primary-text) !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-send-form button span,
  body.admin-body main.orders-screen .production-card .production-products-summary span,
  body.admin-body main.orders-screen .production-card .production-products-summary b {
    display: grid !important;
    place-items: center !important;
    margin: 0 !important;
    line-height: 1 !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: 34px minmax(52px, 96px) 32px 32px 32px !important;
    column-gap: 6px !important;
    padding-inline: 5px !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products,
  body.admin-body main.orders-screen .production-card .production-order-meta,
  body.admin-body main.orders-screen .production-card .production-send-form,
  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    width: 31px !important;
    height: 31px !important;
    min-width: 31px !important;
    min-height: 31px !important;
    max-width: 31px !important;
    max-height: 31px !important;
  }
}

/* Production actions: keep buttons readable and separated. */
@media (max-width: 1280px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: 54px minmax(138px, 1fr) 104px 118px 96px !important;
    column-gap: 12px !important;
    row-gap: 8px !important;
    min-height: 66px !important;
    padding: 10px 14px !important;
    overflow: visible !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-row > * {
    align-self: center !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products,
  body.admin-body main.orders-screen .production-card .production-order-meta,
  body.admin-body main.orders-screen .production-card .production-send-form {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 40px !important;
    min-width: 0 !important;
    min-height: 40px !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--theme-secondary-text) !important;
    box-shadow: 0 8px 18px rgba(var(--theme-primary-rgb), 0.08) !important;
    overflow: visible !important;
    text-align: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary::after {
    content: "Productos" !important;
    color: var(--theme-secondary-text) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary span,
  body.admin-body main.orders-screen .production-card .production-card-message::before,
  body.admin-body main.orders-screen .production-card .production-send-form button span {
    display: grid !important;
    place-items: center !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    color: var(--theme-primary-text) !important;
    font-size: 13px !important;
    line-height: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary b {
    display: grid !important;
    place-items: center !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: var(--brand-primary) !important;
    color: var(--theme-on-primary) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message::before,
  body.admin-body main.orders-screen .production-card .production-card-message.empty::before {
    content: "✉" !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message strong {
    display: block !important;
    color: var(--theme-secondary-text) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message p {
    display: none !important;
  }

  body.admin-body main.orders-screen .production-card .production-send-form button {
    grid-template-columns: auto 1fr !important;
    justify-items: center !important;
  }

  body.admin-body main.orders-screen .production-card .production-send-form button b {
    display: block !important;
    color: var(--theme-secondary-text) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }
}

@media (max-width: 640px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: 54px minmax(0, 1fr) 104px 112px 92px !important;
    column-gap: 9px !important;
    padding-inline: 10px !important;
  }
}

@media (max-width: 520px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    row-gap: 9px !important;
    min-height: 104px !important;
    padding: 10px 8px 12px !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-id {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-client {
    grid-column: 2 / 4 !important;
    grid-row: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-meta {
    grid-column: 3 !important;
    grid-row: 2 !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    height: 42px !important;
    padding-inline: 8px !important;
  }
}

@media (max-width: 380px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 6px !important;
    padding-inline: 6px !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary::after,
  body.admin-body main.orders-screen .production-card .production-card-message strong,
  body.admin-body main.orders-screen .production-card .production-send-form button b {
    font-size: 9px !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    gap: 4px !important;
    height: 40px !important;
    padding-inline: 6px !important;
  }
}

/* Final mobile: icon-only production actions. */
@media (max-width: 760px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: 44px minmax(0, 1fr) 42px 42px 42px !important;
    min-height: 58px !important;
    row-gap: 0 !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-order-meta {
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: center !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-products {
    grid-column: 3 !important;
  }

  body.admin-body main.orders-screen .production-card .production-card-message {
    grid-column: 4 !important;
  }

  body.admin-body main.orders-screen .production-card .production-order-meta {
    grid-column: 5 !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    display: grid !important;
    grid-template-columns: 1fr !important;
    place-items: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 999px !important;
    overflow: visible !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary::after,
  body.admin-body main.orders-screen .production-card .production-card-message strong,
  body.admin-body main.orders-screen .production-card .production-card-message p,
  body.admin-body main.orders-screen .production-card .production-send-form button b {
    display: none !important;
    content: none !important;
  }

  body.admin-body main.orders-screen .production-card .production-send-form button span,
  body.admin-body main.orders-screen .production-card .production-products-summary span,
  body.admin-body main.orders-screen .production-card .production-card-message::before {
    width: auto !important;
    height: auto !important;
    font-size: 16px !important;
    line-height: 1 !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary b {
    position: absolute !important;
    right: -5px !important;
    bottom: -5px !important;
    min-width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .production-card .production-order-row {
    grid-template-columns: 38px minmax(0, 1fr) 34px 34px 34px !important;
    column-gap: 6px !important;
  }

  body.admin-body main.orders-screen .production-card .production-products-summary,
  body.admin-body main.orders-screen .production-card .production-card-message,
  body.admin-body main.orders-screen .production-card .production-card-message.empty,
  body.admin-body main.orders-screen .production-card .production-send-form button {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }
}
