/* =========================================================
   WIRTZ HUB · PEDIDOS MAYORISTAS · ARMADO
   Layout operativo simple · moderno · compacto
   Scanner central · cola lateral · modal reducido
   Responsive · dark safe
   ========================================================= */

/* =========================================================
   01. RESET LOCAL
   ========================================================= */

.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 {
  width: 100%;
  min-width: 0;
  color: var(--text-strong, #111827);
}

/* =========================================================
   02. VARIABLES LOCALES
   ========================================================= */

.pm-armado-page {
  --pm-bg: #ffffff;
  --pm-bg-soft: #f8fafc;
  --pm-bg-muted: #f1f5f9;

  --pm-text: #111827;
  --pm-muted: #64748b;
  --pm-muted-2: #94a3b8;

  --pm-line: rgba(15, 23, 42, 0.1);
  --pm-line-strong: rgba(15, 23, 42, 0.18);

  --pm-accent: #db2777;
  --pm-accent-soft: rgba(219, 39, 119, 0.07);

  --pm-green: #16a34a;
  --pm-green-soft: rgba(22, 163, 74, 0.07);

  --pm-yellow: #ca8a04;
  --pm-yellow-soft: rgba(202, 138, 4, 0.08);

  --pm-red: #dc2626;
  --pm-red-soft: rgba(220, 38, 38, 0.07);

  --pm-blue: #2563eb;
  --pm-blue-soft: rgba(37, 99, 235, 0.07);

  --pm-radius: 12px;
  --pm-radius-small: 9px;

  --pm-transition: 0.18s ease;
}

/* =========================================================
   03. ENCABEZADO
   ========================================================= */

.pm-armado-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  min-width: 0;
  margin-bottom: 8px;
  padding: 2px 1px 10px;

  border-bottom: 1px solid var(--pm-line);
}

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

.pm-armado-page-head__eyebrow {
  display: block;
  margin-bottom: 4px;

  color: var(--pm-accent);

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

.pm-armado-page-head h2 {
  margin: 0;

  color: var(--pm-text);

  font-size: 19px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.pm-armado-page-head p {
  margin: 5px 0 0;

  color: var(--pm-muted);

  font-size: 9px;
  font-weight: 760;
  line-height: 1.35;
}

/* =========================================================
   04. PANELES BASE
   ========================================================= */

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

  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  background: var(--pm-bg);

  box-shadow: none;
}

/* =========================================================
   05. BOTONES
   ========================================================= */

.pm-armado-page .pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  min-height: 34px;
  padding: 0 12px;

  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;
  background: #ffffff;

  color: var(--pm-text);

  font-size: 8.5px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;

  cursor: pointer;
  outline: none;

  transition:
    background var(--pm-transition),
    border-color var(--pm-transition),
    color var(--pm-transition),
    opacity var(--pm-transition),
    transform var(--pm-transition);
}

.pm-armado-page .pm-btn:hover {
  border-color: rgba(15, 23, 42, 0.34);
  background: #f8fafc;
}

.pm-armado-page .pm-btn:active {
  transform: scale(0.985);
}

.pm-armado-page .pm-btn:focus-visible {
  box-shadow:
    0 0 0 3px rgba(219, 39, 119, 0.11);
}

.pm-armado-page .pm-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.pm-armado-page .pm-btn .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;

  stroke-width: 2.2;
}

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

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

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

.pm-armado-page .pm-btn--compact {
  min-height: 29px;
  padding: 0 9px;

  font-size: 8px;
}

.pm-armado-page .pm-btn--icon-text {
  min-width: 82px;
}

/* =========================================================
   06. BOTONES DE ICONO
   ========================================================= */

.pm-armado-page .pm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 31px;
  min-width: 31px;
  height: 31px;
  padding: 0;

  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;
  background: #ffffff;

  color: var(--pm-text);

  cursor: pointer;
  outline: none;

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

.pm-armado-page .pm-icon-btn:hover {
  border-color: rgba(15, 23, 42, 0.34);
  background: var(--pm-bg-soft);
}

.pm-armado-page .pm-icon-btn:active {
  transform: scale(0.96);
}

.pm-armado-page .pm-icon-btn .icon {
  width: 14px;
  height: 14px;

  stroke-width: 2.25;
}

/* =========================================================
   07. FILTROS
   ========================================================= */

.pm-armado-filterbar {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    minmax(180px, 230px)
    auto;
  gap: 8px;
  align-items: center;

  margin-bottom: 8px;
  padding: 8px;
}

.pm-armado-filterbar__search {
  position: relative;

  display: flex;
  align-items: center;

  min-width: 0;
}

.pm-armado-filterbar__search > .icon {
  position: absolute;
  left: 11px;
  z-index: 1;

  width: 14px;
  height: 14px;

  color: var(--pm-muted);
  stroke-width: 2.1;
}

.pm-armado-filterbar input,
.pm-armado-filterbar select {
  width: 100%;
  min-width: 0;
  height: 34px;

  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;
  background: #ffffff;

  color: var(--pm-text);

  outline: none;

  font-size: 8.8px;
  font-weight: 820;

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

.pm-armado-filterbar input {
  padding: 0 11px 0 34px;
}

.pm-armado-filterbar select {
  padding: 0 31px 0 10px;

  cursor: pointer;
}

.pm-armado-filterbar input::placeholder {
  color: var(--pm-muted-2);
}

.pm-armado-filterbar input:focus,
.pm-armado-filterbar select:focus {
  border-color: rgba(15, 23, 42, 0.36);
  box-shadow:
    0 0 0 3px rgba(219, 39, 119, 0.08);
}

/* =========================================================
   08. LAYOUT PRINCIPAL
   ========================================================= */

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

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

/* =========================================================
   09. COLA DE PEDIDOS
   ========================================================= */

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

  min-width: 0;
  min-height: calc(100vh - var(--topbar-height, 58px) - 170px);
  max-height: calc(100vh - var(--topbar-height, 58px) - 170px);

  overflow: hidden;
}

.pm-armado-queue__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  min-height: 49px;
  padding: 9px 10px;

  border-bottom: 1px solid var(--pm-line);
}

.pm-armado-queue__head > div {
  min-width: 0;
}

.pm-armado-step-label {
  display: block;

  color: var(--pm-accent);

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

.pm-armado-queue__head strong {
  display: block;
  margin-top: 4px;

  color: var(--pm-text);

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

.pm-armado-queue__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 26px;
  height: 24px;
  padding: 0 7px;

  border: 1px solid var(--pm-line);
  border-radius: 999px;
  background: var(--pm-bg-soft);

  color: var(--pm-muted);

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

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

  min-height: 0;
  padding: 7px;

  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-products::-webkit-scrollbar,
.pm-armado-table-wrap::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

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

.pm-armado-list::-webkit-scrollbar-thumb,
.pm-armado-products::-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;
}

/* =========================================================
   10. PEDIDO EN COLA
   ========================================================= */

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

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

  width: 100%;
  min-width: 0;
  padding: 9px;

  border: 1px solid var(--pm-line);
  border-radius: 10px;
  background: transparent;

  color: var(--pm-text);
  text-align: left;

  cursor: pointer;
  outline: none;

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

.pm-armado-order__button:hover {
  border-color: rgba(219, 39, 119, 0.3);
  background: var(--pm-accent-soft);
}

.pm-armado-order.is-active .pm-armado-order__button {
  border-color: rgba(219, 39, 119, 0.44);
  background: var(--pm-accent-soft);
}

.pm-armado-order__button:active {
  transform: scale(0.992);
}

.pm-armado-order__button:focus-visible {
  box-shadow:
    0 0 0 3px rgba(219, 39, 119, 0.1);
}

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

  min-width: 0;
}

.pm-armado-order__code {
  min-width: 0;

  color: var(--pm-muted);

  font-size: 7.3px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.06em;

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

.pm-armado-order__client {
  display: block;
  min-width: 0;

  color: var(--pm-text);

  font-size: 9.6px;
  font-weight: 950;
  line-height: 1.15;

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

.pm-armado-order__meta {
  color: var(--pm-muted);

  font-size: 7.6px;
  font-weight: 780;
  line-height: 1.2;
}

.pm-armado-order__progress {
  position: relative;

  display: block;

  width: 100%;
  height: 4px;

  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);

  overflow: hidden;
}

.pm-armado-order__progress-bar {
  display: block;

  height: 100%;

  border-radius: inherit;
  background: var(--pm-green);

  transition: width 0.25s ease;
}

.pm-armado-order__bottom {
  color: var(--pm-muted);

  font-size: 7.5px;
  font-weight: 850;
}

.pm-armado-order__open {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  color: var(--pm-accent);

  font-weight: 950;
}

.pm-armado-order__open .icon {
  width: 11px;
  height: 11px;

  stroke-width: 2.3;
}

/* =========================================================
   11. WORKSPACE ACTIVO
   ========================================================= */

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

  min-width: 0;
  min-height: calc(100vh - var(--topbar-height, 58px) - 170px);
  max-height: calc(100vh - var(--topbar-height, 58px) - 170px);

  overflow: hidden;
}

.pm-armado-workspace__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  min-width: 0;
  min-height: 58px;
  padding: 9px 11px;

  border-bottom: 1px solid var(--pm-line);
}

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

.pm-armado-workspace__title {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
  margin-top: 5px;
}

.pm-armado-workspace__title > div {
  min-width: 0;
}

.pm-armado-workspace__title h3 {
  margin: 0;

  color: var(--pm-text);

  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.025em;

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

.pm-armado-workspace__title p {
  margin: 4px 0 0;

  color: var(--pm-muted);

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

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

.pm-armado-workspace__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;

  flex: 0 0 auto;
}

.pm-armado-ready {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: var(--pm-green);

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

.pm-armado-ready .icon {
  width: 14px;
  height: 14px;

  stroke-width: 2.3;
}

/* =========================================================
   12. RESUMEN
   ========================================================= */

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

  border-bottom: 1px solid var(--pm-line);
}

.pm-armado-overview > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-width: 0;
  min-height: 40px;
  padding: 7px 10px;

  border-right: 1px solid var(--pm-line);
}

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

.pm-armado-overview span {
  color: var(--pm-muted);

  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-overview strong {
  color: var(--pm-text);

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

.pm-armado-overview > div:nth-child(1) strong {
  color: var(--pm-blue);
}

.pm-armado-overview > div:nth-child(2) strong {
  color: var(--pm-green);
}

.pm-armado-overview > div:nth-child(3) strong {
  color: var(--pm-yellow);
}

.pm-armado-overview > div:nth-child(4) strong {
  color: var(--pm-red);
}

/* =========================================================
   13. SCANNER
   ========================================================= */

.pm-armado-scan-area {
  display: grid;
  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(240px, 0.8fr);
  gap: 8px;

  padding: 9px;

  border-bottom: 1px solid var(--pm-line);
  background: var(--pm-bg-soft);
}

.pm-armado-scan-field {
  display: grid;
  gap: 5px;

  min-width: 0;
}

.pm-armado-scan-field > span {
  color: var(--pm-muted);

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

.pm-armado-scan-field > small {
  color: var(--pm-yellow);

  font-size: 7.4px;
  font-weight: 820;
  line-height: 1.2;
}

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

  min-width: 0;
  height: 45px;
  padding: 0 10px;

  border: 1px solid var(--pm-line-strong);
  border-radius: 10px;
  background: #ffffff;

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

.pm-armado-scan-field__control:focus-within {
  border-color: rgba(219, 39, 119, 0.5);
  box-shadow:
    0 0 0 3px rgba(219, 39, 119, 0.09);
}

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

  color: var(--pm-accent);
  stroke-width: 2.25;
}

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

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

  color: var(--pm-text);

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

.pm-armado-scan-field__control input::placeholder {
  color: var(--pm-muted-2);

  font-size: 9px;
  font-weight: 780;
}

.pm-armado-scan-field__control input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

/* =========================================================
   14. ÚLTIMA LECTURA
   ========================================================= */

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

  min-width: 0;
  min-height: 45px;
  padding: 8px 9px;

  border: 1px solid var(--pm-line);
  border-radius: 10px;
  background: #ffffff;
}

.pm-armado-scan-result__icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;

  border-radius: 9px;
  background: var(--pm-bg-muted);

  color: var(--pm-muted);
}

.pm-armado-scan-result__icon .icon {
  width: 15px;
  height: 15px;

  stroke-width: 2.25;
}

.pm-armado-scan-result > div {
  min-width: 0;
}

.pm-armado-scan-result > div > span {
  display: block;

  color: var(--pm-muted);

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

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

  color: var(--pm-text);

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

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

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

  color: var(--pm-muted);

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

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

.pm-armado-scan-result.is-ok {
  border-color: rgba(22, 163, 74, 0.27);
  background: var(--pm-green-soft);
}

.pm-armado-scan-result.is-ok .pm-armado-scan-result__icon,
.pm-armado-scan-result.is-ok strong {
  color: var(--pm-green);
}

.pm-armado-scan-result.is-ok .pm-armado-scan-result__icon {
  background: rgba(22, 163, 74, 0.1);
}

.pm-armado-scan-result.is-warning {
  border-color: rgba(202, 138, 4, 0.29);
  background: var(--pm-yellow-soft);
}

.pm-armado-scan-result.is-warning .pm-armado-scan-result__icon,
.pm-armado-scan-result.is-warning strong {
  color: var(--pm-yellow);
}

.pm-armado-scan-result.is-warning .pm-armado-scan-result__icon {
  background: rgba(202, 138, 4, 0.11);
}

.pm-armado-scan-result.is-danger {
  border-color: rgba(220, 38, 38, 0.28);
  background: var(--pm-red-soft);
}

.pm-armado-scan-result.is-danger .pm-armado-scan-result__icon,
.pm-armado-scan-result.is-danger strong {
  color: var(--pm-red);
}

.pm-armado-scan-result.is-danger .pm-armado-scan-result__icon {
  background: rgba(220, 38, 38, 0.1);
}

/* =========================================================
   15. PRODUCTOS
   ========================================================= */

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

  min-width: 0;
  min-height: 0;

  overflow: hidden;
}

.pm-armado-products__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  min-height: 39px;
  padding: 7px 10px;

  border-bottom: 1px solid var(--pm-line);
}

.pm-armado-products__head span {
  display: block;

  color: var(--pm-muted);

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

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

  color: var(--pm-text);

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

/* =========================================================
   16. TABLA
   ========================================================= */

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

  overflow: auto;
}

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

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

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

  border-bottom: 1px solid var(--pm-line);
  border-right: 1px solid rgba(15, 23, 42, 0.055);

  color: var(--pm-text);

  font-size: 8.5px;
  font-weight: 780;
  line-height: 1.15;
  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: 4;

  height: 32px;

  background: rgba(248, 250, 252, 0.98);
  color: var(--pm-muted);

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

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

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

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

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

.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) {
  width: 10%;
  text-align: center;
}

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

.pm-armado-sku {
  color: var(--pm-text);

  font-size: 8.7px;
  font-weight: 950;
}

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

  color: var(--pm-text);

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

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

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

  color: var(--pm-muted);

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

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

.pm-armado-table td.is-number {
  font-size: 10px;
  font-weight: 950;
  text-align: center;
}

.pm-armado-table td.is-armado {
  color: var(--pm-green);
}

.pm-armado-table td.is-pendiente {
  color: var(--pm-yellow);
}

.pm-armado-table td.is-action {
  text-align: center;
}

/* =========================================================
   17. AJUSTE MANUAL
   ========================================================= */

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

.pm-armado-adjust-row td {
  height: auto !important;
  padding: 8px !important;

  background: var(--pm-bg-soft);

  overflow: visible !important;
}

.pm-armado-adjust-panel {
  display: grid;
  gap: 9px;

  width: 100%;
  min-width: 0;
  padding: 9px;

  border: 1px solid var(--pm-line);
  border-radius: 10px;
  background: #ffffff;
}

.pm-armado-adjust-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  min-width: 0;
}

.pm-armado-adjust-panel > header > div {
  min-width: 0;
}

.pm-armado-adjust-panel > header span {
  display: block;

  color: var(--pm-accent);

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

.pm-armado-adjust-panel > header strong {
  display: block;
  margin-top: 4px;

  color: var(--pm-text);

  font-size: 9px;
  font-weight: 950;
  line-height: 1.15;

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

.pm-armado-adjust-grid {
  display: grid;
  grid-template-columns:
    90px
    90px
    minmax(180px, 1fr)
    minmax(200px, 1fr);
  gap: 7px;

  min-width: 0;
}

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

  min-width: 0;
}

.pm-armado-adjust-grid label > span {
  color: var(--pm-muted);

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

.pm-armado-adjust-grid input {
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0 8px;

  border: 1px solid var(--pm-line-strong);
  border-radius: 8px;
  background: transparent;

  color: var(--pm-text);

  outline: none;

  font-size: 8.4px;
  font-weight: 820;

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

.pm-armado-adjust-grid input:focus {
  border-color: rgba(219, 39, 119, 0.45);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(219, 39, 119, 0.07);
}

.pm-armado-adjust-grid input::placeholder {
  color: var(--pm-muted-2);
}

.pm-armado-adjust-panel > footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;

  padding-top: 1px;
}

/* =========================================================
   18. FINALIZAR
   ========================================================= */

.pm-armado-finalize {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

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

  border-top: 1px solid var(--pm-line);
  background: #ffffff;
}

.pm-armado-finalize > div {
  min-width: 0;
}

.pm-armado-finalize strong {
  display: block;
  margin-top: 4px;

  color: var(--pm-text);

  font-size: 8.5px;
  font-weight: 850;
  line-height: 1.2;
}

/* =========================================================
   19. PLACEHOLDER / EMPTY
   ========================================================= */

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

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

  text-align: center;
}

.pm-armado-placeholder {
  min-height: calc(100vh - var(--topbar-height, 58px) - 170px);
}

.pm-armado-placeholder__icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;

  border: 1px solid rgba(219, 39, 119, 0.16);
  border-radius: 12px;
  background: var(--pm-accent-soft);

  color: var(--pm-accent);
}

.pm-armado-placeholder__icon .icon,
.pm-armado-empty > .icon {
  width: 21px;
  height: 21px;

  stroke-width: 1.9;
}

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

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

.pm-armado-placeholder > span:last-child,
.pm-armado-empty span {
  max-width: 330px;

  color: var(--pm-muted);

  font-size: 8px;
  font-weight: 760;
  line-height: 1.35;
}

.pm-armado-empty.is-error > .icon,
.pm-armado-empty.is-error strong {
  color: var(--pm-red);
}

/* =========================================================
   20. BADGES
   ========================================================= */

.pm-armado-page .pm-badge {
  display: inline-flex;
  align-items: center;

  max-width: 130px;
  min-height: 20px;
  padding: 0 7px;

  border: 1px solid var(--pm-line);
  border-radius: 999px;
  background: var(--pm-bg-soft);

  color: var(--pm-muted);

  font-size: 6.8px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;

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

.pm-armado-page .pm-badge.is-ok {
  border-color: rgba(22, 163, 74, 0.2);
  background: var(--pm-green-soft);
  color: var(--pm-green);
}

.pm-armado-page .pm-badge.is-warning {
  border-color: rgba(202, 138, 4, 0.22);
  background: var(--pm-yellow-soft);
  color: var(--pm-yellow);
}

.pm-armado-page .pm-badge.is-danger {
  border-color: rgba(220, 38, 38, 0.2);
  background: var(--pm-red-soft);
  color: var(--pm-red);
}

.pm-armado-page .pm-badge.is-info {
  border-color: rgba(37, 99, 235, 0.2);
  background: var(--pm-blue-soft);
  color: var(--pm-blue);
}

/* =========================================================
   21. MODAL
   ========================================================= */

.pm-armado-page .pm-modal,
#pmArmadoCloseModal {
  position: fixed;
  inset: 0;
  z-index: 11000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 16px;

  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

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

  width: min(520px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);

  border: 1px solid var(--pm-line-strong);
  border-radius: 14px;
  background: #ffffff;

  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.2);

  overflow: hidden;
}

.pm-armado-close-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;

  padding: 12px;

  border-bottom: 1px solid var(--pm-line);
}

.pm-armado-close-modal__head > div {
  min-width: 0;
}

.pm-armado-close-modal__head > div > span {
  display: block;

  color: var(--pm-accent);

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

.pm-armado-close-modal__head h3 {
  margin: 5px 0 0;

  color: var(--pm-text);

  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pm-armado-close-modal__head p {
  margin: 5px 0 0;

  color: var(--pm-muted);

  font-size: 8px;
  font-weight: 760;
  line-height: 1.3;
}

.pm-armado-close-modal__body {
  min-height: 0;
  padding: 12px;

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

.pm-armado-close-inline-summary {
  display: flex;
  align-items: center;
  gap: 0;

  margin-bottom: 10px;

  border: 1px solid var(--pm-line);
  border-radius: 10px;

  overflow: hidden;
}

.pm-armado-close-inline-summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;

  border-right: 1px solid var(--pm-line);

  color: var(--pm-muted);

  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.pm-armado-close-inline-summary > span:last-child {
  border-right: 0;
}

.pm-armado-close-inline-summary strong {
  color: var(--pm-text);

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

.pm-armado-close-inline-summary > span:nth-child(1) strong {
  color: var(--pm-green);
}

.pm-armado-close-inline-summary > span:nth-child(2) strong {
  color: var(--pm-red);
}

.pm-armado-close-inline-summary > span:nth-child(3) strong {
  color: var(--pm-yellow);
}

/* =========================================================
   22. FORMULARIO MODAL
   ========================================================= */

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

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

.pm-armado-close-form label > span {
  color: var(--pm-muted);

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

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

  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;
  background: #ffffff;

  color: var(--pm-text);

  outline: none;

  font-size: 8.8px;
  font-weight: 820;
  line-height: 1.35;

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

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

.pm-armado-close-form textarea {
  min-height: 74px;
  max-height: 150px;
  padding: 9px 10px;

  resize: vertical;
}

.pm-armado-close-form input:focus,
.pm-armado-close-form textarea:focus {
  border-color: rgba(219, 39, 119, 0.45);
  box-shadow:
    0 0 0 3px rgba(219, 39, 119, 0.08);
}

.pm-armado-close-form input::placeholder,
.pm-armado-close-form textarea::placeholder {
  color: var(--pm-muted-2);
}

/* =========================================================
   23. ALERTA STOCK
   ========================================================= */

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

  min-width: 0;
  margin-top: 10px;
  padding: 9px;

  border: 1px solid rgba(202, 138, 4, 0.24);
  border-radius: 10px;
  background: var(--pm-yellow-soft);
}

.pm-armado-stock-warning > .icon {
  width: 17px;
  height: 17px;

  color: var(--pm-yellow);
  stroke-width: 2.2;
}

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

  color: #92400e;

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

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

  color: #92400e;

  font-size: 7.5px;
  font-weight: 760;
  line-height: 1.25;
}

/* =========================================================
   24. FOOTER MODAL
   ========================================================= */

.pm-armado-close-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;

  padding: 10px 12px;

  border-top: 1px solid var(--pm-line);
  background: var(--pm-bg-soft);
}

/* =========================================================
   25. DARK MODE
   ========================================================= */

html[data-theme="dark"] .pm-armado-page {
  --pm-bg: #0b0b0b;
  --pm-bg-soft: #111111;
  --pm-bg-muted: #181818;

  --pm-text: rgba(255, 255, 255, 0.92);
  --pm-muted: rgba(255, 255, 255, 0.55);
  --pm-muted-2: rgba(255, 255, 255, 0.35);

  --pm-line: rgba(255, 255, 255, 0.09);
  --pm-line-strong: rgba(255, 255, 255, 0.16);

  --pm-accent-soft: rgba(244, 114, 182, 0.08);
  --pm-green-soft: rgba(74, 222, 128, 0.07);
  --pm-yellow-soft: rgba(250, 204, 21, 0.07);
  --pm-red-soft: rgba(248, 113, 113, 0.07);
  --pm-blue-soft: rgba(96, 165, 250, 0.07);
}

html[data-theme="dark"] .pm-armado-page-head h2,
html[data-theme="dark"] .pm-armado-queue__head strong,
html[data-theme="dark"] .pm-armado-order__client,
html[data-theme="dark"] .pm-armado-workspace__title h3,
html[data-theme="dark"] .pm-armado-overview strong,
html[data-theme="dark"] .pm-armado-products__head 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-adjust-panel > header strong,
html[data-theme="dark"] .pm-armado-finalize strong,
html[data-theme="dark"] .pm-armado-placeholder strong,
html[data-theme="dark"] .pm-armado-empty strong,
html[data-theme="dark"] .pm-armado-close-modal__head h3,
html[data-theme="dark"] .pm-armado-close-inline-summary strong {
  color: var(--pm-text);
}

html[data-theme="dark"] .pm-armado-page .pm-panel,
html[data-theme="dark"] .pm-armado-order__button,
html[data-theme="dark"] .pm-armado-finalize,
html[data-theme="dark"] .pm-armado-adjust-panel,
html[data-theme="dark"] .pm-armado-close-modal {
  border-color: var(--pm-line);
  background: var(--pm-bg);
}

html[data-theme="dark"] .pm-armado-filterbar input,
html[data-theme="dark"] .pm-armado-filterbar select,
html[data-theme="dark"] .pm-armado-scan-field__control,
html[data-theme="dark"] .pm-armado-scan-result,
html[data-theme="dark"] .pm-armado-adjust-grid input,
html[data-theme="dark"] .pm-armado-close-form input,
html[data-theme="dark"] .pm-armado-close-form textarea {
  border-color: var(--pm-line-strong);
  background: #111111;
  color: var(--pm-text);
}

html[data-theme="dark"] .pm-armado-filterbar input::placeholder,
html[data-theme="dark"] .pm-armado-scan-field__control input::placeholder,
html[data-theme="dark"] .pm-armado-adjust-grid input::placeholder,
html[data-theme="dark"] .pm-armado-close-form input::placeholder,
html[data-theme="dark"] .pm-armado-close-form textarea::placeholder {
  color: var(--pm-muted-2);
}

html[data-theme="dark"] .pm-armado-scan-area,
html[data-theme="dark"] .pm-armado-adjust-row td,
html[data-theme="dark"] .pm-armado-close-modal__footer {
  background: var(--pm-bg-soft);
}

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

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

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

html[data-theme="dark"] .pm-armado-order__progress {
  background: rgba(255, 255, 255, 0.09);
}

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: var(--pm-line-strong);
  background: #111111;
  color: var(--pm-text);
}

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.3);
  background: #191919;
}

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: #111827;
}

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

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: #facc15;
}

/* =========================================================
   26. RESPONSIVE
   ========================================================= */

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

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

  .pm-armado-adjust-grid {
    grid-template-columns:
      90px
      90px
      minmax(0, 1fr);
  }

  .pm-armado-adjust-grid label:last-child {
    grid-column: 1 / -1;
  }
}

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

  .pm-armado-queue,
  .pm-armado-workspace {
    min-height: auto;
    max-height: none;
  }

  .pm-armado-list {
    max-height: 320px;
  }

  .pm-armado-products {
    min-height: 340px;
  }

  .pm-armado-placeholder {
    min-height: 280px;
  }
}

@media (max-width: 760px) {
  .pm-armado-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pm-armado-page-head .pm-btn {
    width: 100%;
  }

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

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

  .pm-armado-workspace__head {
    align-items: stretch;
    flex-direction: column;
  }

  .pm-armado-workspace__actions {
    justify-content: stretch;
  }

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

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

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

  .pm-armado-overview > div:nth-child(n + 3) {
    border-top: 1px solid var(--pm-line);
  }

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

  .pm-armado-adjust-grid .is-wide {
    grid-column: 1 / -1;
  }

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

  .pm-armado-close-inline-summary > span {
    border-right: 0;
    border-bottom: 1px solid var(--pm-line);
  }

  .pm-armado-close-inline-summary > span:last-child {
    border-bottom: 0;
  }

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

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

@media (max-width: 560px) {
  .pm-armado-page-head h2 {
    font-size: 17px;
  }

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

  .pm-armado-overview > div {
    border-right: 0;
    border-top: 1px solid var(--pm-line);
  }

  .pm-armado-overview > div:first-child {
    border-top: 0;
  }

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

  .pm-armado-adjust-grid .is-wide {
    grid-column: auto;
  }

  .pm-armado-adjust-panel > footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pm-armado-adjust-panel > footer .pm-btn {
    width: 100%;
  }

  .pm-armado-finalize {
    align-items: stretch;
    flex-direction: column;
  }

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

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

/* =========================================================
   27. MOVIMIENTO REDUCIDO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .pm-armado-page *,
  .pm-armado-page *::before,
  .pm-armado-page *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}