/* Bellísima ERP: sólo tablas opt-in. Desktop queda intacto. */
@media (max-width: 767.98px) {
  table[data-mobile-cards], table[data-mobile-cards] > tbody {
    display: block; width: 100%; max-width: 100%;
  }
  table[data-mobile-cards] > thead {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
  }
  table[data-mobile-cards] > tbody { padding: .6rem; box-sizing: border-box; }
  table[data-mobile-cards] > tbody > tr {
    display: block; margin-bottom: .7rem; background: #fff;
    border: 1px solid #e5e7eb; border-radius: .7rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%); overflow: hidden;
  }
  table[data-mobile-cards] > tbody > tr:last-child { margin-bottom: 0; }
  table[data-mobile-cards] > tbody > tr > td,
  table[data-mobile-cards] > tbody > tr > th {
    display: block; box-sizing: border-box; width: 100%;
    max-width: 100%; min-width: 0; padding: .65rem .8rem;
    text-align: left !important; white-space: normal !important;
    overflow-wrap: anywhere; border-bottom: 1px solid #f3f4f6;
  }
  table[data-mobile-cards] > tbody > tr > :last-child { border-bottom: 0; }
  table[data-mobile-cards] > tbody > tr > td[data-mobile-label]::before {
    content: attr(data-mobile-label); display: block; margin-bottom: .2rem;
    font-size: .72rem; line-height: 1.1rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .025em; color: #6b7280;
  }
  table[data-mobile-cards] > tbody > tr > td > * { max-width: 100%; }
  table[data-mobile-cards] > tbody > tr > td a,
  table[data-mobile-cards] > tbody > tr > td button { min-height: 40px; align-content: center; }
}

/* Pedidos web: separación clara entre tarjetas sin estilos inline. */
/* Separación deliberada entre pedidos web; sólo se aplica en celulares. */
@media (max-width: 767.98px) {
  table.pedidos-web-table[data-mobile-cards] > tbody {
    padding: 1rem .75rem 1.25rem;
    background: #f1f5f9;
  }
  table.pedidos-web-table[data-mobile-cards] > tbody > tr {
    margin-bottom: 1.4rem;
    border: 2px solid #94a3b8;
    border-top: 5px solid #db2777;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 7px 16px rgb(15 23 42 / 14%);
    overflow: hidden;
  }
  table.pedidos-web-table[data-mobile-cards] > tbody > tr > td {
    border-bottom: 1px solid #dfe4eb;
    padding: .85rem .95rem;
  }
  table.pedidos-web-table[data-mobile-cards] > tbody > tr > td:first-child {
    background: #fdf2f8;
    border-bottom: 2px solid #f9a8d4;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  table.pedidos-web-table[data-mobile-cards] > tbody > tr > td:first-child > .font-mono {
    font-size: 1.1rem;
    font-weight: 800;
    color: #831843;
  }
  table.pedidos-web-table[data-mobile-cards] > tbody > tr > td:last-child {
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
    border-bottom: 0;
  }
  table.pedidos-web-table[data-mobile-cards] > tbody > tr > td[data-mobile-label]::before {
    color: #475569;
    font-weight: 700;
  }
}

.pedido-item-nombre,
.pedido-item-cantidad,
.pedido-item-stock strong {
  color: #111827;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pedido-item-stock {
  color: #4b5563;
  font-size: .85rem;
}

.pedido-item-stock .pedido-stock-disponible { color: #166534; }
.pedido-item-stock .pedido-stock-bajo { color: #9a3412; }
.pedido-item-stock .pedido-stock-sin-stock { color: #b91c1c; }

.pedido-revision-campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.pedido-revision-campos label {
  color: #374151;
  font-size: .875rem;
  font-weight: 600;
  min-width: 0;
}

.pedido-revision-campos input,
.pedido-revision-campos select {
  border: 1px solid #cbd5e1;
  border-radius: .375rem;
  display: block;
  font-size: 1rem;
  min-height: 2.75rem;
  width: 100%;
}

@media (max-width: 767.98px) {
  .pedido-items-table .pedido-item-nombre,
  .pedido-items-table .pedido-item-cantidad,
  .pedido-items-table .pedido-item-stock strong { font-size: 1.25rem; }
}
