/* =========================================================
   WIRTZ HUB · PEDIDOS MAYORISTAS · ARMADO
   Scanner operativo · tabla compacta · cierre con cajas
   Minimalista · responsive · dark safe
   ========================================================= */

.pm-armado-page,
.pm-armado-page *,
.pm-armado-page *::before,
.pm-armado-page *::after {
  box-sizing: border-box;
  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif !important;
}

.pm-armado-page {
  min-width: 0;
}

/* =========================================================
   LAYOUT PRINCIPAL
   ========================================================= */

.pm-armado-layout {
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr);
  gap: 8px;

  width: 100%;
  max-width: 100%;
  min-height: 0;
}

/* =========================================================
   SIDEBAR · COLA DE ARMADO
   ========================================================= */

.pm-armado-sidebar {
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.pm-armado-list {
  display: grid;
  align-content: start;
  gap: 7px;

  max-height: calc(100vh - var(--topbar-height) - 194px);
  min-height: 0;
  padding: 8px;

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color: rgba(120, 128, 145, 0.35) transparent;
}

.pm-armado-list::-webkit-scrollbar,
.pm-armado-items::-webkit-scrollbar,
.pm-armado-table-wrap::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.pm-armado-list::-webkit-scrollbar-track,
.pm-armado-items::-webkit-scrollbar-track,
.pm-armado-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.pm-armado-list::-webkit-scrollbar-thumb,
.pm-armado-items::-webkit-scrollbar-thumb,
.pm-armado-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(120, 128, 145, 0.35);
  background-clip: content-box;
}

/* =========================================================
   CARD · PEDIDO EN COLA
   ========================================================= */

.pm-armado-card {
  display: grid;
  gap: 8px;

  min-width: 0;
  padding: 9px;

  border: 1px solid rgba(15, 23, 42, 0.11);
  border-radius: 13px;
  background: transparent;

  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.pm-armado-card:hover,
.pm-armado-card.is-active {
  border-color: color-mix(in srgb, #db2777 35%, rgba(15, 23, 42, 0.12));
  background: color-mix(in srgb, #db2777 5%, transparent);
  transform: translateY(-1px);
}

.pm-armado-card.is-active {
  box-shadow:
    0 0 0 1px color-mix(in srgb, #db2777 20%, transparent),
    0 12px 24px rgba(15, 23, 42, 0.045);
}

.pm-armado-card header,
.pm-armado-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-width: 0;
}

.pm-armado-card header div,
.pm-armado-card footer small {
  min-width: 0;
}

.pm-armado-card header span:first-child {
  display: block;

  color: var(--muted, #6b7280);

  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-card header strong {
  display: block;
  margin-top: 3px;

  color: var(--text-strong, #111827);

  font-size: 9.4px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-card footer small {
  color: var(--muted, #6b7280);

  font-size: 7.2px;
  font-weight: 800;
  line-height: 1.25;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-card footer .pm-btn {
  min-width: 68px;
}

/* =========================================================
   MINI GRID · CARD IZQUIERDA
   ========================================================= */

.pm-armado-card__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  border: 1px solid rgba(15, 23, 42, 0.095);
  border-radius: 10px;

  overflow: hidden;
}

.pm-armado-card__grid div {
  display: grid;
  gap: 3px;

  min-width: 0;
  padding: 6px;

  border-right: 1px solid rgba(15, 23, 42, 0.095);
}

.pm-armado-card__grid div:last-child {
  border-right: 0;
}

.pm-armado-card__grid span {
  color: var(--muted, #6b7280);

  font-size: 6.6px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-card__grid strong {
  color: var(--text-strong, #111827);

  font-size: 8.8px;
  font-weight: 950;
  line-height: 1;
}

/* =========================================================
   MAIN · ARMADO ACTIVO
   ========================================================= */

.pm-armado-main {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);

  min-height: calc(100vh - var(--topbar-height) - 164px);
  max-height: calc(100vh - var(--topbar-height) - 164px);

  overflow: hidden;
}

.pm-armado-main .pm-panel__head {
  min-height: 42px;
}

.pm-armado-main .pm-actions {
  flex-wrap: nowrap;
}

.pm-armado-main .pm-actions .pm-btn {
  min-width: 108px;
}

/* =========================================================
   PLACEHOLDER / EMPTY
   ========================================================= */

.pm-armado-placeholder,
.pm-armado-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;

  min-height: 180px;
  padding: 18px;

  text-align: center;
  color: var(--muted, #6b7280);
}

.pm-armado-placeholder .icon,
.pm-armado-empty .icon {
  width: 28px;
  height: 28px;

  color: #db2777;
  stroke-width: 1.9;
}

.pm-armado-placeholder strong,
.pm-armado-empty strong {
  color: var(--text-strong, #111827);

  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.pm-armado-placeholder span,
.pm-armado-empty span {
  max-width: 360px;

  color: var(--muted, #6b7280);

  font-size: 8.4px;
  font-weight: 780;
  line-height: 1.35;
}

.pm-armado-empty.is-error .icon,
.pm-armado-empty.is-error strong {
  color: #dc2626;
}

/* =========================================================
   RESUMEN SUPERIOR
   ========================================================= */

.pm-armado-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.pm-armado-summary article {
  display: grid;
  align-content: center;
  gap: 3px;

  min-width: 0;
  min-height: 44px;
  padding: 8px;

  border-right: 1px solid rgba(15, 23, 42, 0.1);
}

.pm-armado-summary article:last-child {
  border-right: 0;
}

.pm-armado-summary span {
  color: var(--muted, #6b7280);

  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-summary strong {
  color: var(--text-strong, #111827);

  font-size: 12.5px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-summary article:nth-child(1) strong {
  color: #2563eb;
}

.pm-armado-summary article:nth-child(2) strong {
  color: #7c3aed;
}

.pm-armado-summary article:nth-child(3) strong {
  color: #16a34a;
}

.pm-armado-summary article:nth-child(4) strong {
  color: #dc2626;
}

/* =========================================================
   SCANNER
   ========================================================= */

.pm-armado-scanner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 8px;

  padding: 9px;

  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.64);
}

.pm-armado-scanner__box {
  display: grid;
  gap: 6px;

  min-width: 0;
}

.pm-armado-scanner__box > span,
.pm-armado-lastscan span,
.pm-armado-close-form label span,
.pm-armado-close-summary span {
  display: block;

  color: var(--muted, #6b7280);

  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-scanner__box > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;

  height: 48px;
  padding: 0 10px;

  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 13px;
  background: #ffffff;

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.pm-armado-scanner__box > div:focus-within {
  border-color: rgba(15, 23, 42, 0.34);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.08);
}

.pm-armado-scanner__box .icon {
  width: 18px;
  height: 18px;
  color: #db2777;
  stroke-width: 2.15;
}

.pm-armado-scanner__box input {
  width: 100%;
  min-width: 0;

  border: 0;
  outline: 0;
  background: transparent;

  color: var(--text-strong, #111827);

  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.01em;
  line-height: 1;
}

.pm-armado-scanner__box input::placeholder {
  color: rgba(107, 114, 128, 0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.pm-armado-lastscan {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;

  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;

  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 13px;
  background: #ffffff;
}

.pm-armado-lastscan > .icon {
  width: 18px;
  height: 18px;

  color: #64748b;
  stroke-width: 2.15;
}

.pm-armado-lastscan strong {
  display: block;
  margin-top: 3px;

  color: var(--text-strong, #111827);

  font-size: 10px;
  font-weight: 950;
  line-height: 1.12;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-lastscan small {
  display: block;
  margin-top: 3px;

  color: var(--muted, #6b7280);

  font-size: 8px;
  font-weight: 780;
  line-height: 1.2;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-lastscan.is-ok {
  border-color: rgba(22, 163, 74, 0.26);
  background: rgba(22, 163, 74, 0.055);
}

.pm-armado-lastscan.is-ok > .icon,
.pm-armado-lastscan.is-ok strong {
  color: #16a34a;
}

.pm-armado-lastscan.is-warning {
  border-color: rgba(202, 138, 4, 0.28);
  background: rgba(202, 138, 4, 0.07);
}

.pm-armado-lastscan.is-warning > .icon,
.pm-armado-lastscan.is-warning strong {
  color: #ca8a04;
}

.pm-armado-lastscan.is-danger {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
}

.pm-armado-lastscan.is-danger > .icon,
.pm-armado-lastscan.is-danger strong {
  color: #dc2626;
}

/* =========================================================
   LISTA / TABLA ITEMS
   ========================================================= */

.pm-armado-items {
  display: grid;
  align-content: start;
  gap: 7px;

  min-height: 0;
  padding: 8px;

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color: rgba(120, 128, 145, 0.35) transparent;
}

.pm-armado-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: transparent;

  overflow: auto;
}

.pm-armado-table {
  width: 100%;
  min-width: 920px;

  border-collapse: collapse;
  table-layout: fixed;
}

.pm-armado-table th,
.pm-armado-table td {
  height: 40px;
  padding: 0 8px;

  border-bottom: 1px solid rgba(15, 23, 42, 0.095);
  border-right: 1px solid rgba(15, 23, 42, 0.06);

  color: var(--text-strong, #111827);

  font-size: 8.8px;
  font-weight: 780;
  line-height: 1.16;
  text-align: left;
  vertical-align: middle;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-table th:last-child,
.pm-armado-table td:last-child {
  border-right: 0;
}

.pm-armado-table tr:last-child td {
  border-bottom: 0;
}

.pm-armado-table th {
  position: sticky;
  top: 0;
  z-index: 3;

  height: 34px;

  background: rgba(248, 250, 252, 0.98);
  color: var(--muted, #6b7280);

  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.028);
}

.pm-armado-table tbody tr.is-complete {
  background: rgba(22, 163, 74, 0.04);
}

.pm-armado-table td strong {
  color: var(--text-strong, #111827);

  font-size: 9px;
  font-weight: 950;
  line-height: 1.1;
}

.pm-armado-product-name {
  display: block;

  color: var(--text-strong, #111827);

  font-size: 9.2px;
  font-weight: 950;
  line-height: 1.12;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-table td small {
  display: block;
  margin-top: 3px;

  color: var(--muted, #6b7280);

  font-size: 7.5px;
  font-weight: 760;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-armado-table th:nth-child(1),
.pm-armado-table td:nth-child(1) {
  width: 12%;
}

.pm-armado-table th:nth-child(2),
.pm-armado-table td:nth-child(2) {
  width: 31%;
}

.pm-armado-table th:nth-child(3),
.pm-armado-table td:nth-child(3),
.pm-armado-table th:nth-child(4),
.pm-armado-table td:nth-child(4),
.pm-armado-table th:nth-child(5),
.pm-armado-table td:nth-child(5),
.pm-armado-table th:nth-child(6),
.pm-armado-table td:nth-child(6) {
  width: 8%;
  text-align: center;
}

.pm-armado-table th:nth-child(7),
.pm-armado-table td:nth-child(7) {
  width: 13%;
}

.pm-armado-table th:nth-child(8),
.pm-armado-table td:nth-child(8) {
  width: 12%;
  text-align: center;
  overflow: visible;
}

.pm-armado-table td:nth-child(3),
.pm-armado-table td:nth-child(4),
.pm-armado-table td:nth-child(5) {
  font-size: 10px;
  font-weight: 950;
}

.pm-armado-table td:nth-child(4) strong {
  color: #16a34a;
}

.pm-armado-table td:nth-child(5) {
  color: #ca8a04;
}

.pm-armado-table td input {
  width: 54px;
  height: 28px;
  padding: 0 7px;

  border: 1px solid rgba(15, 23, 42, 0.13);
  border-radius: 8px;
  background: transparent;

  color: var(--text-strong, #111827);

  outline: none;

  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.pm-armado-table td input:focus {
  border-color: rgba(15, 23, 42, 0.32);
  background: rgba(15, 23, 42, 0.04);
}

.pm-armado-table td:nth-child(8) {
  display: table-cell;
}

.pm-armado-table td:nth-child(8) .pm-icon-btn {
  display: inline-flex;
  margin: 0 2px;
  width: 29px;
  min-width: 29px;
  height: 29px;
  border-radius: 9px;
}

/* =========================================================
   ESTADO SIN MINICARD
   ========================================================= */

.pm-armado-page .pm-badge {
  display: inline !important;

  min-height: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  color: var(--text-strong, #111827) !important;

  font-size: 8.8px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;

  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.pm-armado-page .pm-badge.is-ok {
  color: #16a34a !important;
}

.pm-armado-page .pm-badge.is-warning {
  color: #ca8a04 !important;
}

.pm-armado-page .pm-badge.is-danger {
  color: #dc2626 !important;
}

.pm-armado-page .pm-badge.is-info {
  color: #2563eb !important;
}

/* =========================================================
   AJUSTE MANUAL
   ========================================================= */

.pm-armado-adjust-row[hidden] {
  display: none !important;
}

.pm-armado-adjust-row td {
  height: auto !important;
  padding: 9px !important;
  background: rgba(248, 250, 252, 0.8);
  overflow: visible !important;
}

.pm-armado-item__form {
  display: grid;
  grid-template-columns: 94px 94px minmax(120px, 1fr) minmax(130px, 1fr) 106px;
  gap: 6px;
  align-items: end;

  width: 100%;
  max-width: 100%;
}

.pm-armado-item__form label {
  display: grid;
  gap: 4px;

  min-width: 0;
}

.pm-armado-item__form label span {
  color: var(--muted, #6b7280);

  font-size: 6.9px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-item__form input {
  width: 100%;
  height: 29px;
  min-width: 0;
  padding: 0 8px;

  border: 1px solid rgba(15, 23, 42, 0.13);
  border-radius: 8px;
  background: transparent;

  color: var(--text-strong, #111827);

  outline: none;

  font-size: 8.6px;
  font-weight: 830;
}

.pm-armado-item__form input:focus {
  border-color: rgba(15, 23, 42, 0.28);
  background: rgba(15, 23, 42, 0.04);
}

.pm-armado-item__form .pm-btn {
  width: 100%;
  min-height: 29px;
  padding: 0 8px;
}

/* =========================================================
   MODAL · CIERRE ARMADO
   ========================================================= */

.pm-armado-close-modal {
  width: min(680px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.pm-armado-close-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  border: 1px solid rgba(15, 23, 42, 0.1);
  border-right: 0;
  border-bottom: 0;
  border-radius: 14px;

  overflow: hidden;
}

.pm-armado-close-summary article {
  display: grid;
  align-content: center;
  gap: 5px;

  min-height: 58px;
  padding: 10px;

  border-right: 1px solid rgba(15, 23, 42, 0.1);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: transparent;
}

.pm-armado-close-summary strong {
  color: var(--text-strong, #111827);

  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pm-armado-close-summary article:nth-child(1) strong {
  color: #7c3aed;
}

.pm-armado-close-summary article:nth-child(2) strong {
  color: #16a34a;
}

.pm-armado-close-summary article:nth-child(3) strong {
  color: #ca8a04;
}

.pm-armado-close-summary article:nth-child(4) strong {
  color: #dc2626;
}

.pm-armado-close-form {
  display: grid;
  gap: 10px;

  margin-top: 10px;
}

.pm-armado-close-form label {
  display: grid;
  gap: 7px;
}

.pm-armado-close-form input,
.pm-armado-close-form textarea {
  width: 100%;
  min-width: 0;

  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: transparent;

  color: var(--text-strong, #111827);

  outline: none;

  font-size: 10px;
  font-weight: 850;
  line-height: 1.32;
}

.pm-armado-close-form input {
  height: 38px;
  padding: 0 10px;
}

.pm-armado-close-form textarea {
  min-height: 82px;
  padding: 10px;
  resize: vertical;
}

.pm-armado-close-form input:focus,
.pm-armado-close-form textarea:focus {
  border-color: rgba(15, 23, 42, 0.32);
  background: rgba(15, 23, 42, 0.035);
}

.pm-armado-close-form input::placeholder,
.pm-armado-close-form textarea::placeholder {
  color: rgba(107, 114, 128, 0.68);
}

.pm-armado-stock-warning {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;

  min-height: 58px;
  margin-top: 10px;
  padding: 10px;

  border: 1px solid rgba(202, 138, 4, 0.3);
  border-radius: 14px;
  background: rgba(202, 138, 4, 0.07);
}

.pm-armado-stock-warning .icon {
  width: 18px;
  height: 18px;
  color: #ca8a04;
  stroke-width: 2.2;
}

.pm-armado-stock-warning strong {
  display: block;

  color: #92400e;

  font-size: 10.2px;
  font-weight: 950;
  line-height: 1.15;
}

.pm-armado-stock-warning span {
  display: block;
  margin-top: 4px;

  color: #92400e;

  font-size: 8.5px;
  font-weight: 780;
  line-height: 1.3;
}

/* =========================================================
   BOTONES / ICONOS DEL MÓDULO
   ========================================================= */

.pm-armado-page .pm-btn,
.pm-armado-page .pm-icon-btn {
  opacity: 1;
}

.pm-armado-page .pm-btn:not(.pm-btn--dark),
.pm-armado-page .pm-icon-btn {
  border-color: rgba(15, 23, 42, 0.22);
  background: #ffffff;
  color: #0f172a;
}

.pm-armado-page .pm-btn:not(.pm-btn--dark):hover,
.pm-armado-page .pm-icon-btn:hover {
  border-color: #0f172a;
  background: #f8fafc;
  color: #0f172a;
}

.pm-armado-page .pm-btn--dark {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.pm-armado-page .pm-btn--dark .icon,
.pm-armado-page .pm-btn--dark span {
  color: #ffffff;
  stroke: #ffffff;
}

.pm-armado-page .pm-icon-btn--save {
  color: #16a34a;
}

.pm-armado-page .pm-icon-btn--save:hover {
  border-color: rgba(22, 163, 74, 0.38);
  background: rgba(22, 163, 74, 0.07);
  color: #16a34a;
}

/* =========================================================
   DARK SAFE
   ========================================================= */

html[data-theme="dark"] .pm-armado-scanner {
  border-bottom-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .pm-armado-scanner__box > div,
html[data-theme="dark"] .pm-armado-lastscan {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .pm-armado-scanner__box > div:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.09);
}

html[data-theme="dark"] .pm-armado-scanner__box input,
html[data-theme="dark"] .pm-armado-close-form input,
html[data-theme="dark"] .pm-armado-close-form textarea {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .pm-armado-scanner__box input::placeholder,
html[data-theme="dark"] .pm-armado-close-form input::placeholder,
html[data-theme="dark"] .pm-armado-close-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

html[data-theme="dark"] .pm-armado-card,
html[data-theme="dark"] .pm-armado-table-wrap,
html[data-theme="dark"] .pm-armado-close-summary {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .pm-armado-card:hover,
html[data-theme="dark"] .pm-armado-card.is-active {
  border-color: color-mix(in srgb, #f472b6 40%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, #f472b6 8%, transparent);
}

html[data-theme="dark"] .pm-armado-card.is-active {
  box-shadow:
    0 0 0 1px color-mix(in srgb, #f472b6 24%, transparent),
    0 14px 28px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .pm-armado-card header strong,
html[data-theme="dark"] .pm-armado-placeholder strong,
html[data-theme="dark"] .pm-armado-empty strong,
html[data-theme="dark"] .pm-armado-summary strong,
html[data-theme="dark"] .pm-armado-table td,
html[data-theme="dark"] .pm-armado-table td strong,
html[data-theme="dark"] .pm-armado-product-name,
html[data-theme="dark"] .pm-armado-lastscan strong,
html[data-theme="dark"] .pm-armado-close-summary strong {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .pm-armado-card header span:first-child,
html[data-theme="dark"] .pm-armado-card footer small,
html[data-theme="dark"] .pm-armado-placeholder span,
html[data-theme="dark"] .pm-armado-empty span,
html[data-theme="dark"] .pm-armado-summary span,
html[data-theme="dark"] .pm-armado-table th,
html[data-theme="dark"] .pm-armado-table td small,
html[data-theme="dark"] .pm-armado-lastscan span,
html[data-theme="dark"] .pm-armado-lastscan small,
html[data-theme="dark"] .pm-armado-scanner__box > span,
html[data-theme="dark"] .pm-armado-close-form label span,
html[data-theme="dark"] .pm-armado-close-summary span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .pm-armado-card__grid,
html[data-theme="dark"] .pm-armado-table th,
html[data-theme="dark"] .pm-armado-table td,
html[data-theme="dark"] .pm-armado-summary,
html[data-theme="dark"] .pm-armado-close-summary article {
  border-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .pm-armado-card__grid div,
html[data-theme="dark"] .pm-armado-summary article {
  border-right-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .pm-armado-table th {
  background: rgba(12, 12, 12, 0.98);
}

html[data-theme="dark"] .pm-armado-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .pm-armado-table tbody tr.is-complete {
  background: rgba(74, 222, 128, 0.045);
}

html[data-theme="dark"] .pm-armado-table td input,
html[data-theme="dark"] .pm-armado-item__form input,
html[data-theme="dark"] .pm-armado-close-form input,
html[data-theme="dark"] .pm-armado-close-form textarea {
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .pm-armado-table td input:focus,
html[data-theme="dark"] .pm-armado-item__form input:focus,
html[data-theme="dark"] .pm-armado-close-form input:focus,
html[data-theme="dark"] .pm-armado-close-form textarea:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.065);
}

html[data-theme="dark"] .pm-armado-adjust-row td {
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .pm-armado-page .pm-btn:not(.pm-btn--dark),
html[data-theme="dark"] .pm-armado-page .pm-icon-btn {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .pm-armado-page .pm-btn:not(.pm-btn--dark):hover,
html[data-theme="dark"] .pm-armado-page .pm-icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

html[data-theme="dark"] .pm-armado-page .pm-btn--dark {
  border-color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}

html[data-theme="dark"] .pm-armado-page .pm-btn--dark span,
html[data-theme="dark"] .pm-armado-page .pm-btn--dark .icon {
  color: #0f172a;
  stroke: #0f172a;
}

html[data-theme="dark"] .pm-armado-stock-warning {
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.075);
}

html[data-theme="dark"] .pm-armado-stock-warning strong,
html[data-theme="dark"] .pm-armado-stock-warning span,
html[data-theme="dark"] .pm-armado-stock-warning .icon {
  color: #fbbf24;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1240px) {
  .pm-armado-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .pm-armado-scanner {
    grid-template-columns: 1fr;
  }

  .pm-armado-item__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pm-armado-item__form .pm-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 980px) {
  .pm-armado-layout {
    grid-template-columns: 1fr;
  }

  .pm-armado-main {
    max-height: none;
    min-height: auto;
  }

  .pm-armado-list,
  .pm-armado-items {
    max-height: none;
  }

  .pm-armado-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pm-armado-card__grid div:nth-child(2n) {
    border-right: 0;
  }

  .pm-armado-card__grid div:nth-child(n + 3) {
    border-top: 1px solid rgba(15, 23, 42, 0.095);
  }

  .pm-armado-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pm-armado-summary article:nth-child(2n) {
    border-right: 0;
  }

  .pm-armado-summary article:nth-child(n + 3) {
    border-top: 1px solid rgba(15, 23, 42, 0.1);
  }

  .pm-armado-close-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pm-armado-close-summary article:nth-child(2n) {
    border-right: 0;
  }

  .pm-armado-table {
    min-width: 860px;
  }
}

@media (max-width: 720px) {
  .pm-armado-card header,
  .pm-armado-card footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pm-armado-card footer .pm-btn {
    width: 100%;
  }

  .pm-armado-scanner__box > div {
    height: 44px;
  }

  .pm-armado-scanner__box input {
    font-size: 13px;
  }

  .pm-armado-table {
    min-width: 760px;
  }

  .pm-armado-close-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .pm-armado-close-summary {
    grid-template-columns: 1fr;
  }

  .pm-armado-close-summary article {
    border-right: 1px solid rgba(15, 23, 42, 0.1);
  }

  .pm-armado-close-modal .pm-modal__footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pm-armado-close-modal .pm-modal__footer .pm-btn {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .pm-armado-item__form {
    grid-template-columns: 1fr;
  }

  .pm-armado-summary {
    grid-template-columns: 1fr;
  }

  .pm-armado-summary article {
    border-right: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
  }

  .pm-armado-summary article:first-child {
    border-top: 0;
  }

  .pm-armado-lastscan {
    grid-template-columns: 28px minmax(0, 1fr);
  }
}/* =========================================================
   FIX · ARMADO · AJUSTE MANUAL MÁS ANCHO
   Motivo / Observación sin cortes
   ========================================================= */

.pm-armado-adjust-row td {
  overflow: visible !important;
}

.pm-armado-adjust-row .pm-armado-item__form {
  grid-template-columns: 82px 82px minmax(260px, 1.15fr) minmax(340px, 1.55fr) 132px !important;
  align-items: end !important;
  gap: 8px !important;
}

.pm-armado-adjust-row .pm-armado-item__form label {
  min-width: 0 !important;
}

.pm-armado-adjust-row .pm-armado-item__form label:nth-child(3),
.pm-armado-adjust-row .pm-armado-item__form label:nth-child(4) {
  min-width: 240px !important;
}

.pm-armado-adjust-row .pm-armado-item__form label:nth-child(3) input,
.pm-armado-adjust-row .pm-armado-item__form label:nth-child(4) input {
  width: 100% !important;
  min-width: 0 !important;
}

.pm-armado-adjust-row .pm-armado-item__form input {
  height: 32px !important;
  font-size: 9.4px !important;
}

.pm-armado-adjust-row .pm-armado-item__form .pm-btn {
  min-height: 32px !important;
  width: 100% !important;
}

/* En pantallas medianas baja a 2 columnas, pero sin cortar */
@media (max-width: 1240px) {
  .pm-armado-adjust-row .pm-armado-item__form {
    grid-template-columns: 90px 90px minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .pm-armado-adjust-row .pm-armado-item__form .pm-btn {
    grid-column: 1 / -1 !important;
  }
}

/* En mobile queda vertical */
@media (max-width: 720px) {
  .pm-armado-adjust-row .pm-armado-item__form {
    grid-template-columns: 1fr !important;
  }

  .pm-armado-adjust-row .pm-armado-item__form label:nth-child(3),
  .pm-armado-adjust-row .pm-armado-item__form label:nth-child(4) {
    min-width: 0 !important;
  }
}/* =========================================================
   FIX · TOAST ARMADO · ICONO CENTRADO
   ========================================================= */

.pm-armado-notice {
  align-items: center !important;
}

.pm-armado-notice__icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;

  padding: 0 !important;
  line-height: 0 !important;
}

.pm-armado-notice__icon .icon,
.pm-armado-notice__icon svg {
  display: block !important;

  width: 15px !important;
  height: 15px !important;

  margin: 0 !important;
  padding: 0 !important;

  transform: none !important;
  vertical-align: middle !important;
}