/* =========================================================
   WIRTZ HUB · PEDIDOS MAYORISTAS · GESTIÓN DE PEDIDOS
   CSS COMPLETO · PARTE 1 DE 2

   Diseño:
   - Operativo
   - Minimalista
   - Líneas finas
   - Sin glow
   - Sin azul oscuro
   - Métricas en franja continua
   - Filtros separados
   - Modal de creación en dos columnas
   - Detalle 70 / 30
   ========================================================= */

/* =========================================================
   VARIABLES
   ========================================================= */

.pm-page.pm-gestion-page {
  --pm-bg: #f7f7f7;

  --pm-surface: #ffffff;
  --pm-surface-soft: #fafafa;
  --pm-surface-strong: #f1f1f1;

  --pm-text: #171717;
  --pm-text-soft: #525252;
  --pm-text-muted: #858585;

  --pm-line: rgba(0, 0, 0, 0.08);
  --pm-line-strong: rgba(0, 0, 0, 0.15);

  --pm-primary: #111111;
  --pm-primary-text: #ffffff;

  --pm-success: #177245;
  --pm-success-soft: rgba(23, 114, 69, 0.09);
  --pm-success-line: rgba(23, 114, 69, 0.22);

  --pm-warning: #946200;
  --pm-warning-soft: rgba(148, 98, 0, 0.09);
  --pm-warning-line: rgba(148, 98, 0, 0.22);

  --pm-danger: #b42318;
  --pm-danger-soft: rgba(180, 35, 24, 0.08);
  --pm-danger-line: rgba(180, 35, 24, 0.2);

  --pm-radius-xs: 7px;
  --pm-radius-sm: 10px;
  --pm-radius-md: 13px;
  --pm-radius-lg: 16px;

  --pm-transition: 160ms ease;

  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;

  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: calc(
    100vh -
    var(--topbar-height, 72px) -
    44px
  );

  color: var(--pm-text);
  background: var(--pm-bg);

  overflow-x: hidden;
}

/* =========================================================
   MODO OSCURO · VARIABLES
   ========================================================= */

html[data-theme="dark"] .pm-page.pm-gestion-page,
body.dark .pm-page.pm-gestion-page,
.dark .pm-page.pm-gestion-page {
  --pm-bg: #000000;

  --pm-surface: #080808;
  --pm-surface-soft: #0d0d0d;
  --pm-surface-strong: #181818;

  --pm-text: #f5f5f5;
  --pm-text-soft: #bdbdbd;
  --pm-text-muted: #7d7d7d;

  --pm-line: rgba(255, 255, 255, 0.08);
  --pm-line-strong: rgba(255, 255, 255, 0.15);

  --pm-primary: #f5f5f5;
  --pm-primary-text: #000000;

  --pm-success: #6fd7a3;
  --pm-success-soft: rgba(111, 215, 163, 0.09);
  --pm-success-line: rgba(111, 215, 163, 0.2);

  --pm-warning: #e5c36a;
  --pm-warning-soft: rgba(229, 195, 106, 0.09);
  --pm-warning-line: rgba(229, 195, 106, 0.2);

  --pm-danger: #ff8a80;
  --pm-danger-soft: rgba(255, 138, 128, 0.08);
  --pm-danger-line: rgba(255, 138, 128, 0.2);

  color: var(--pm-text);
  background: #000000;
}

/* =========================================================
   RESET LOCAL
   ========================================================= */

.pm-page.pm-gestion-page,
.pm-page.pm-gestion-page *,
.pm-modal,
.pm-modal * {
  box-sizing: border-box;
}

.pm-page.pm-gestion-page button,
.pm-page.pm-gestion-page input,
.pm-page.pm-gestion-page select,
.pm-page.pm-gestion-page textarea,
.pm-modal button,
.pm-modal input,
.pm-modal select,
.pm-modal textarea {
  font: inherit;
}

.pm-page.pm-gestion-page button,
.pm-modal button {
  -webkit-tap-highlight-color: transparent;
}

.pm-page.pm-gestion-page img,
.pm-modal img {
  display: block;
  max-width: 100%;
}

.pm-page.pm-gestion-page .icon,
.pm-modal .icon {
  display: block;

  width: 16px;
  height: 16px;
  flex: 0 0 auto;

  stroke-width: 1.9;
}

/* =========================================================
   CABECERA
   ========================================================= */

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

  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 11px 13px;

  background: var(--pm-surface);
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius-md);
}

.pm-page.pm-gestion-page .pm-brand {
  display: flex;
  align-items: center;
  gap: 11px;

  min-width: 0;
}

.pm-page.pm-gestion-page .pm-brand__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;
  flex: 0 0 36px;

  color: var(--pm-text);
  background: var(--pm-surface-soft);
  border: 1px solid var(--pm-line);
  border-radius: 10px;
}

.pm-page.pm-gestion-page .pm-brand__icon .icon,
.pm-page.pm-gestion-page .pm-brand__icon svg {
  width: 17px;
  height: 17px;

  margin: 0;
}

.pm-page.pm-gestion-page .pm-brand > div {
  min-width: 0;
}

.pm-page.pm-gestion-page .pm-brand h2 {
  margin: 0;

  color: var(--pm-text);

  font-size: 17px;
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.pm-page.pm-gestion-page .pm-brand p {
  margin: 4px 0 0;

  color: var(--pm-text-soft);

  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

/* =========================================================
   ACCIONES
   ========================================================= */

.pm-page.pm-gestion-page .pm-actions,
.pm-page.pm-gestion-page .pm-actions--top,
.pm-modal .pm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;

  flex-wrap: wrap;
}

/* =========================================================
   BOTONES
   ========================================================= */

.pm-page.pm-gestion-page .pm-btn,
.pm-modal .pm-btn {
  appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

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

  color: var(--pm-text);
  background: var(--pm-surface);
  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;

  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;

  cursor: pointer;
  text-decoration: none;

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

.pm-page.pm-gestion-page .pm-btn:hover:not(:disabled),
.pm-modal .pm-btn:hover:not(:disabled) {
  background: var(--pm-surface-soft);
  border-color: var(--pm-line-strong);
}

.pm-page.pm-gestion-page .pm-btn:active:not(:disabled),
.pm-modal .pm-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.pm-page.pm-gestion-page .pm-btn:focus-visible,
.pm-modal .pm-btn:focus-visible {
  outline: 2px solid var(--pm-text);
  outline-offset: 2px;
}

.pm-page.pm-gestion-page .pm-btn:disabled,
.pm-modal .pm-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.pm-page.pm-gestion-page .pm-btn--dark,
.pm-modal .pm-btn--dark {
  color: var(--pm-primary-text);
  background: var(--pm-primary);
  border-color: var(--pm-primary);
}

.pm-page.pm-gestion-page .pm-btn--dark:hover:not(:disabled),
.pm-modal .pm-btn--dark:hover:not(:disabled) {
  color: var(--pm-primary-text);
  background: var(--pm-primary);
  border-color: var(--pm-primary);
  opacity: 0.9;
}

.pm-page.pm-gestion-page .pm-btn--table {
  min-height: 30px;
  padding: 0 10px;

  border-radius: 8px;

  font-size: 10px;
}

/* =========================================================
   BOTONES DE ICONO
   ========================================================= */

.pm-page.pm-gestion-page .pm-icon-btn,
.pm-modal .pm-icon-btn {
  appearance: none;

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

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

  color: var(--pm-text-soft);
  background: transparent;
  border: 1px solid var(--pm-line);
  border-radius: 9px;

  cursor: pointer;

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

.pm-page.pm-gestion-page .pm-icon-btn:hover,
.pm-modal .pm-icon-btn:hover {
  color: var(--pm-text);
  background: var(--pm-surface-strong);
  border-color: var(--pm-line-strong);
}

.pm-page.pm-gestion-page .pm-icon-btn:active,
.pm-modal .pm-icon-btn:active {
  transform: translateY(1px);
}

.pm-page.pm-gestion-page .pm-icon-btn.is-danger,
.pm-modal .pm-icon-btn.is-danger {
  color: var(--pm-danger);
  background: var(--pm-danger-soft);
  border-color: var(--pm-danger-line);
}

.pm-page.pm-gestion-page .pm-icon-btn.is-danger:hover,
.pm-modal .pm-icon-btn.is-danger:hover {
  color: var(--pm-danger);
  background: var(--pm-danger-soft);
  border-color: var(--pm-danger);
}

/* =========================================================
   MÉTRICAS · FRANJA CONTINUA
   ========================================================= */

.pm-page.pm-gestion-page .pm-metrics {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(0, 1fr));
  gap: 1px;

  min-width: 0;

  overflow: hidden;

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

.pm-page.pm-gestion-page .pm-card-metric {
  display: flex;
  flex-direction: column;
  justify-content: center;

  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;

  background: var(--pm-surface);
}

.pm-page.pm-gestion-page .pm-card-metric span {
  display: block;

  margin: 0;

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

  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.pm-page.pm-gestion-page .pm-card-metric strong {
  display: block;

  margin-top: 5px;

  overflow: hidden;

  color: var(--pm-text);

  font-size: 19px;
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: -0.025em;

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

.pm-page.pm-gestion-page .pm-card-metric small {
  display: block;

  margin-top: 5px;

  color: var(--pm-text-soft);

  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.2;
}

/* =========================================================
   PANEL
   ========================================================= */

.pm-page.pm-gestion-page .pm-panel,
.pm-modal .pm-panel {
  min-width: 0;

  overflow: hidden;

  background: var(--pm-surface);
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius-md);
}

.pm-page.pm-gestion-page .pm-panel__head,
.pm-modal .pm-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  min-height: 52px;
  padding: 10px 12px;

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

.pm-page.pm-gestion-page .pm-panel__head > div,
.pm-modal .pm-panel__head > div {
  min-width: 0;
}

.pm-page.pm-gestion-page .pm-panel__head span,
.pm-modal .pm-panel__head span {
  display: block;

  margin: 0;

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

  font-size: 8.5px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.pm-page.pm-gestion-page .pm-panel__head strong,
.pm-modal .pm-panel__head strong {
  display: block;

  margin-top: 3px;

  color: var(--pm-text);

  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.2;
}

/* =========================================================
   BARRA DE FILTROS
   ========================================================= */

.pm-page.pm-gestion-page .pm-filters-bar {
  display: grid;
  grid-template-columns:
    minmax(260px, 1fr)
    auto;
  gap: 10px;
  align-items: center;

  min-width: 0;
  padding: 11px 12px;

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

.pm-page.pm-gestion-page .pm-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;

  min-width: 0;
  flex-wrap: wrap;
}

/* =========================================================
   BUSCADOR
   ========================================================= */

.pm-page.pm-gestion-page .pm-search {
  position: relative;

  display: flex;
  align-items: center;

  min-width: 0;
}

.pm-page.pm-gestion-page .pm-search .icon {
  position: absolute;
  left: 11px;
  z-index: 1;

  width: 15px;
  height: 15px;

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

  pointer-events: none;
}

.pm-page.pm-gestion-page .pm-search input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 12px 0 36px;

  color: var(--pm-text);
  background: var(--pm-surface-soft);
  border: 1px solid var(--pm-line);
  border-radius: 9px;

  font-size: 11px;
  font-weight: 500;

  outline: none;

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

.pm-page.pm-gestion-page .pm-search input::placeholder {
  color: var(--pm-text-muted);
}

.pm-page.pm-gestion-page .pm-search input:focus {
  background: var(--pm-surface);
  border-color: var(--pm-line-strong);
}

/* =========================================================
   SELECTS
   ========================================================= */

.pm-page.pm-gestion-page .pm-toolbar select,
.pm-page.pm-gestion-page .pm-select,
.pm-modal .pm-select {
  min-width: 150px;
  height: 36px;
  padding: 0 10px;

  color: var(--pm-text);
  background: var(--pm-surface-soft);
  border: 1px solid var(--pm-line);
  border-radius: 9px;

  font-size: 10.5px;
  font-weight: 600;

  outline: none;
  cursor: pointer;

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

.pm-page.pm-gestion-page .pm-toolbar select:hover,
.pm-page.pm-gestion-page .pm-toolbar select:focus,
.pm-page.pm-gestion-page .pm-select:hover,
.pm-page.pm-gestion-page .pm-select:focus,
.pm-modal .pm-select:hover,
.pm-modal .pm-select:focus {
  background: var(--pm-surface);
  border-color: var(--pm-line-strong);
}

.pm-page.pm-gestion-page .pm-select--mini {
  width: 150px;
  min-width: 150px;
  height: 32px;

  font-size: 10px;
}

/* =========================================================
   SELECTS · MODO OSCURO
   ========================================================= */

html[data-theme="dark"] .pm-page.pm-gestion-page select,
body.dark .pm-page.pm-gestion-page select,
.dark .pm-page.pm-gestion-page select,
html[data-theme="dark"] .pm-modal select,
body.dark .pm-modal select,
.dark .pm-modal select {
  color-scheme: dark;
}

html[data-theme="dark"] .pm-page.pm-gestion-page option,
body.dark .pm-page.pm-gestion-page option,
.dark .pm-page.pm-gestion-page option,
html[data-theme="dark"] .pm-modal option,
body.dark .pm-modal option,
.dark .pm-modal option {
  color: #f5f5f5;
  background: #080808;
}

/* =========================================================
   TABLA PRINCIPAL
   ========================================================= */

.pm-page.pm-gestion-page .pm-table-wrap,
.pm-modal .pm-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  overflow: auto;

  scrollbar-width: thin;
  scrollbar-color:
    var(--pm-line-strong)
    transparent;
}

.pm-page.pm-gestion-page .pm-table {
  width: 100%;
  min-width: 1030px;

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

.pm-page.pm-gestion-page .pm-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;

  padding: 9px 10px;

  color: var(--pm-text-muted);
  background: var(--pm-surface-soft);
  border-bottom: 1px solid var(--pm-line);

  font-size: 8.5px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.pm-page.pm-gestion-page .pm-table tbody td {
  padding: 9px 10px;

  color: var(--pm-text-soft);
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-line);

  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  vertical-align: middle;
}

.pm-page.pm-gestion-page .pm-table tbody tr:hover td {
  background: var(--pm-surface-soft);
}

.pm-page.pm-gestion-page .pm-table tbody tr:last-child td {
  border-bottom: 0;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(1),
.pm-page.pm-gestion-page .pm-table td:nth-child(1) {
  width: 145px;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(2),
.pm-page.pm-gestion-page .pm-table td:nth-child(2) {
  width: 205px;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(3),
.pm-page.pm-gestion-page .pm-table td:nth-child(3) {
  width: 135px;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(4),
.pm-page.pm-gestion-page .pm-table td:nth-child(4) {
  width: 105px;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(5),
.pm-page.pm-gestion-page .pm-table td:nth-child(5),
.pm-page.pm-gestion-page .pm-table th:nth-child(6),
.pm-page.pm-gestion-page .pm-table td:nth-child(6) {
  width: 72px;

  text-align: center;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(7),
.pm-page.pm-gestion-page .pm-table td:nth-child(7) {
  width: 215px;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(8),
.pm-page.pm-gestion-page .pm-table td:nth-child(8) {
  width: 120px;

  text-align: right;
}

/* =========================================================
   CELDAS DE PEDIDO Y CLIENTE
   ========================================================= */

.pm-page.pm-gestion-page .pm-order-cell,
.pm-page.pm-gestion-page .pm-client-cell {
  display: flex;
  flex-direction: column;

  min-width: 0;
}

.pm-page.pm-gestion-page .pm-order-cell strong,
.pm-page.pm-gestion-page .pm-client-cell strong {
  overflow: hidden;

  color: var(--pm-text);

  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;

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

.pm-page.pm-gestion-page .pm-order-cell small,
.pm-page.pm-gestion-page .pm-client-cell small {
  display: block;

  margin-top: 3px;

  overflow: hidden;

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

  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;

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

.pm-page.pm-gestion-page .pm-table-main {
  display: block;

  overflow: hidden;

  color: var(--pm-text);

  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;

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

.pm-page.pm-gestion-page .pm-table-number {
  color: var(--pm-text);

  font-size: 11px;
  font-weight: 750;
}

.pm-page.pm-gestion-page .pm-table-number.is-danger {
  color: var(--pm-danger);
}

/* =========================================================
   CELDA DE ASIGNACIÓN
   ========================================================= */

.pm-page.pm-gestion-page .pm-assignment-cell {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;
}

.pm-page.pm-gestion-page .pm-assignment-cell .pm-select {
  flex: 1 1 auto;
  min-width: 0;
}

/* =========================================================
   ACCIONES DE TABLA
   ========================================================= */

.pm-page.pm-gestion-page .pm-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;

  min-width: 0;
}

/* =========================================================
   BADGES
   ========================================================= */

.pm-page.pm-gestion-page .pm-badge,
.pm-modal .pm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 22px;
  max-width: 100%;
  padding: 0 8px;

  color: var(--pm-text-soft);
  background: var(--pm-surface-strong);
  border: 1px solid var(--pm-line);
  border-radius: 999px;

  font-size: 8.5px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pm-page.pm-gestion-page .pm-badge.is-ok,
.pm-modal .pm-badge.is-ok {
  color: var(--pm-success);
  background: var(--pm-success-soft);
  border-color: var(--pm-success-line);
}

.pm-page.pm-gestion-page .pm-badge.is-warning,
.pm-modal .pm-badge.is-warning {
  color: var(--pm-warning);
  background: var(--pm-warning-soft);
  border-color: var(--pm-warning-line);
}

.pm-page.pm-gestion-page .pm-badge.is-danger,
.pm-modal .pm-badge.is-danger {
  color: var(--pm-danger);
  background: var(--pm-danger-soft);
  border-color: var(--pm-danger-line);
}

.pm-page.pm-gestion-page .pm-badge.is-info,
.pm-page.pm-gestion-page .pm-badge.is-muted,
.pm-modal .pm-badge.is-info,
.pm-modal .pm-badge.is-muted {
  color: var(--pm-text-soft);
  background: var(--pm-surface-strong);
  border-color: var(--pm-line);
}

/* =========================================================
   MENSAJES DE TABLA
   ========================================================= */

.pm-table-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 190px;
  padding: 24px;

  color: var(--pm-text-muted);
  text-align: center;
}

.pm-table-message .icon {
  width: 24px;
  height: 24px;

  margin-bottom: 9px;
}

.pm-table-message strong {
  color: var(--pm-text);

  font-size: 11.5px;
  font-weight: 700;
}

.pm-table-message span {
  margin-top: 4px;

  color: var(--pm-text-soft);

  font-size: 10px;
}

.pm-table-message.is-error .icon,
.pm-table-message.is-error strong {
  color: var(--pm-danger);
}

/* =========================================================
   MODAL BASE
   ========================================================= */

.pm-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;

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

  padding: 16px;

  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(2px);
}

.pm-modal.is-open {
  display: flex;
}

.pm-modal__card {
  --pm-surface: #ffffff;
  --pm-surface-soft: #fafafa;
  --pm-surface-strong: #f1f1f1;

  --pm-text: #171717;
  --pm-text-soft: #525252;
  --pm-text-muted: #858585;

  --pm-line: rgba(0, 0, 0, 0.08);
  --pm-line-strong: rgba(0, 0, 0, 0.15);

  --pm-primary: #111111;
  --pm-primary-text: #ffffff;

  --pm-success: #177245;
  --pm-success-soft: rgba(23, 114, 69, 0.09);
  --pm-success-line: rgba(23, 114, 69, 0.22);

  --pm-warning: #946200;
  --pm-warning-soft: rgba(148, 98, 0, 0.09);
  --pm-warning-line: rgba(148, 98, 0, 0.22);

  --pm-danger: #b42318;
  --pm-danger-soft: rgba(180, 35, 24, 0.08);
  --pm-danger-line: rgba(180, 35, 24, 0.2);

  display: flex;
  flex-direction: column;

  width: min(1050px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);

  overflow: hidden;

  color: var(--pm-text);
  background: var(--pm-surface);
  border: 1px solid var(--pm-line-strong);
  border-radius: 15px;
}

.pm-create-modal {
  width: min(1180px, calc(100vw - 32px));
}

.pm-detail-modal {
  width: min(1180px, calc(100vw - 32px));
}

.pm-excel-modal {
  width: min(1180px, calc(100vw - 32px));
}

/* =========================================================
   MODAL · CABECERA
   ========================================================= */

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

  min-height: 62px;
  padding: 13px 14px;

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

.pm-modal__head > div:first-child {
  min-width: 0;
}

.pm-modal__head span {
  display: block;

  margin: 0;

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

  font-size: 8.5px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.075em;

  text-transform: uppercase;
}

.pm-modal__head strong {
  display: block;

  margin-top: 4px;

  color: var(--pm-text);

  font-size: 15px;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.pm-modal__head small {
  display: block;

  margin-top: 4px;

  color: var(--pm-text-soft);

  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

/* =========================================================
   MODAL · CUERPO Y FOOTER
   ========================================================= */

.pm-modal__body {
  flex: 1 1 auto;
  min-height: 0;

  overflow: auto;

  padding: 12px;

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

  scrollbar-width: thin;
  scrollbar-color:
    var(--pm-line-strong)
    transparent;
}

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

  min-height: 56px;
  padding: 10px 14px;

  background: var(--pm-surface);
  border-top: 1px solid var(--pm-line);

  flex-wrap: wrap;
}

/* =========================================================
   MODAL NUEVO PEDIDO · LAYOUT
   ========================================================= */

.pm-create-layout {
  display: grid;
  grid-template-columns:
    minmax(300px, 0.78fr)
    minmax(0, 1.55fr);
  gap: 12px;

  min-width: 0;
  min-height: 510px;
}

.pm-create-column {
  display: flex;
  flex-direction: column;

  min-width: 0;

  overflow: visible;

  background: var(--pm-surface);
  border: 1px solid var(--pm-line);
  border-radius: 12px;
}

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

  min-height: 54px;
  padding: 10px 12px;

  background: var(--pm-surface-soft);
  border-bottom: 1px solid var(--pm-line);
  border-radius: 12px 12px 0 0;
}

.pm-create-column__head > div {
  min-width: 0;
}

.pm-create-column__head > span,
.pm-create-column__head > div > span {
  display: block;

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

  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.pm-create-column__head > strong,
.pm-create-column__head > div > strong {
  display: block;

  margin-top: 3px;

  color: var(--pm-text);

  font-size: 12px;
  font-weight: 750;
}

.pm-create-column__body {
  display: grid;
  align-content: start;
  gap: 10px;

  min-width: 0;
  padding: 11px;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.pm-field {
  display: grid;
  gap: 6px;

  min-width: 0;
}

.pm-field--clean {
  gap: 0;
}

.pm-field--relative {
  position: relative;
}

.pm-field--button {
  align-self: end;
}

.pm-field > span {
  color: var(--pm-text-soft);

  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
}

.pm-field input,
.pm-field select,
.pm-field textarea,
.pm-excel-table input,
.pm-excel-paste textarea {
  width: 100%;
  min-width: 0;

  color: var(--pm-text);
  background: var(--pm-surface);
  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;

  font-size: 10.5px;
  font-weight: 500;

  outline: none;

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

.pm-field input,
.pm-field select,
.pm-excel-table input {
  height: 36px;
  padding: 0 10px;
}

.pm-field textarea,
.pm-excel-paste textarea {
  min-height: 92px;
  padding: 9px 10px;

  line-height: 1.4;
  resize: vertical;
}

.pm-field input:focus,
.pm-field select:focus,
.pm-field textarea:focus,
.pm-excel-table input:focus,
.pm-excel-paste textarea:focus {
  background: var(--pm-surface);
  border-color: var(--pm-text);
}

.pm-field input::placeholder,
.pm-field textarea::placeholder,
.pm-excel-paste textarea::placeholder {
  color: var(--pm-text-muted);
}

/* =========================================================
   CAMPOS EN DOS COLUMNAS
   ========================================================= */

.pm-create-fields-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 9px;

  min-width: 0;
}

/* =========================================================
   INGRESO DE PRODUCTO
   ========================================================= */

.pm-product-entry {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    92px
    102px;
  gap: 8px;
  align-items: end;

  min-width: 0;
}

/* =========================================================
   CLIENTE SELECCIONADO / PRODUCTO DETECTADO
   ========================================================= */

.pm-selected-box,
.pm-detected-line,
.pm-empty-inline {
  display: flex;
  align-items: center;
  gap: 9px;

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

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

.pm-selected-box {
  justify-content: space-between;
}

.pm-selected-box > div {
  min-width: 0;
  flex: 1 1 auto;
}

.pm-selected-box strong,
.pm-detected-line strong,
.pm-empty-inline strong {
  display: block;

  color: var(--pm-text);

  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
}

.pm-selected-box span,
.pm-detected-line span,
.pm-detected-line small,
.pm-empty-inline span {
  display: block;

  color: var(--pm-text-soft);

  font-size: 9px;
  font-weight: 500;
  line-height: 1.3;
}

.pm-selected-box.is-empty,
.pm-detected-line.is-empty,
.pm-empty-inline {
  justify-content: center;

  color: var(--pm-text-muted);
  text-align: center;
}

/* =========================================================
   SUGERENCIAS
   ========================================================= */

.pm-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 50;

  display: grid;
  gap: 3px;

  max-height: 260px;
  padding: 5px;

  overflow-y: auto;

  background: var(--pm-surface);
  border: 1px solid var(--pm-line-strong);
  border-radius: 10px;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.16);
}

.pm-suggestions button {
  appearance: none;

  display: grid;
  gap: 3px;

  width: 100%;
  padding: 8px 9px;

  color: var(--pm-text);
  background: transparent;
  border: 0;
  border-radius: 8px;

  text-align: left;

  cursor: pointer;
}

.pm-suggestions button:hover {
  background: var(--pm-surface-soft);
}

.pm-suggestions button:disabled {
  cursor: default;
}

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

  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.pm-suggestions span {
  color: var(--pm-text-soft);

  font-size: 8.8px;
  font-weight: 500;
  line-height: 1.25;
}

/* =========================================================
   PRODUCTOS AGREGADOS
   ========================================================= */

.pm-fast-items {
  min-width: 0;

  overflow: hidden;

  background: var(--pm-surface);
  border: 1px solid var(--pm-line);
  border-radius: 11px;
}

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

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

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

.pm-fast-items__head span {
  display: block;

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

  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.pm-fast-items__head strong {
  display: block;

  margin-top: 3px;

  color: var(--pm-text);

  font-size: 10.5px;
  font-weight: 750;
}

.pm-fast-items-wrap {
  max-height: 300px;

  overflow: auto;

  scrollbar-width: thin;
  scrollbar-color:
    var(--pm-line-strong)
    transparent;
}

.pm-fast-items-table {
  width: 100%;
  min-width: 690px;

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

.pm-fast-items-table th {
  padding: 8px;

  color: var(--pm-text-muted);
  background: var(--pm-surface-soft);
  border-bottom: 1px solid var(--pm-line);

  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.pm-fast-items-table td {
  padding: 8px;

  color: var(--pm-text-soft);
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-line);

  font-size: 9.5px;
  font-weight: 500;
  vertical-align: middle;
}

.pm-fast-items-table tbody tr:last-child td {
  border-bottom: 0;
}

.pm-fast-items-table tbody tr:hover td {
  background: var(--pm-surface-soft);
}

.pm-fast-items-table td strong {
  display: block;

  color: var(--pm-text);

  font-size: 9.8px;
  font-weight: 750;
}

.pm-fast-items-table td small {
  display: block;

  margin-top: 3px;

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

  font-size: 8px;
  line-height: 1.2;
}

/* =========================================================
   CONTINÚA EN LA PARTE 2 DE 2
   ========================================================= */

   /* =========================================================
   WIRTZ HUB · PEDIDOS MAYORISTAS · GESTIÓN DE PEDIDOS
   CSS COMPLETO · PARTE 2 DE 2
   ========================================================= */

/* =========================================================
   DETALLE · RESUMEN
   ========================================================= */

.pm-detail-grid {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(0, 1fr));
  gap: 8px;

  min-width: 0;
  margin-bottom: 12px;
}

.pm-detail-grid article {
  min-width: 0;
  padding: 10px;

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

.pm-detail-grid span {
  display: block;

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

  font-size: 8px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.06em;

  text-transform: uppercase;
}

.pm-detail-grid strong {
  display: block;

  margin-top: 4px;

  overflow: hidden;

  color: var(--pm-text);

  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;

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

/* =========================================================
   DETALLE · LAYOUT 70 / 30
   ========================================================= */

.pm-detail-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 2.2fr)
    minmax(260px, 0.8fr);
  gap: 12px;

  min-width: 0;
}

.pm-detail-products,
.pm-detail-history {
  min-width: 0;
}

.pm-detail-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  min-height: 24px;
  padding: 0 8px;

  color: var(--pm-text-soft) !important;
  background: var(--pm-surface-strong);
  border: 1px solid var(--pm-line);
  border-radius: 999px;

  font-size: 8.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;

  text-transform: none !important;
  white-space: nowrap;
}

/* =========================================================
   DETALLE · LISTA DE PRODUCTOS
   ========================================================= */

.pm-items-list {
  display: grid;
  align-content: start;
  gap: 6px;

  max-height: 450px;
  padding: 9px;

  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color:
    var(--pm-line-strong)
    transparent;
}

.pm-item-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    74px
    74px
    74px;
  gap: 8px;
  align-items: center;

  min-width: 0;
  padding: 9px;

  background: var(--pm-surface-soft);
  border: 1px solid var(--pm-line);
  border-radius: 9px;
}

.pm-item-row > div {
  min-width: 0;
}

.pm-item-row > div:first-child strong,
.pm-item-row > div:first-child span {
  display: block;

  overflow: hidden;

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

.pm-item-row > div:not(:first-child) {
  text-align: center;
}

.pm-item-row strong {
  display: block;

  color: var(--pm-text);

  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.pm-item-row span,
.pm-item-row small {
  display: block;

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

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

.pm-item-row > div:first-child span {
  margin-top: 3px;
}

.pm-item-row > div:not(:first-child) strong {
  margin-top: 3px;

  font-size: 11px;
}

/* =========================================================
   DETALLE · HISTORIAL
   ========================================================= */

.pm-history-list {
  display: grid;
  align-content: start;
  gap: 6px;

  max-height: 450px;
  padding: 9px;

  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color:
    var(--pm-line-strong)
    transparent;
}

.pm-history-list article {
  position: relative;

  min-width: 0;
  padding: 9px 9px 9px 17px;

  background: var(--pm-surface-soft);
  border: 1px solid var(--pm-line);
  border-radius: 9px;
}

.pm-history-list article::before {
  content: "";

  position: absolute;
  top: 13px;
  left: 8px;

  width: 4px;
  height: 4px;

  background: var(--pm-text-muted);
  border-radius: 999px;
}

.pm-history-list span {
  display: block;

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

  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
}

.pm-history-list strong {
  display: block;

  margin-top: 4px;

  color: var(--pm-text);

  font-size: 9.8px;
  font-weight: 750;
  line-height: 1.2;
}

.pm-history-list small {
  display: block;

  margin-top: 4px;

  color: var(--pm-text-soft);

  font-size: 8.5px;
  font-weight: 500;
  line-height: 1.35;
}

/* =========================================================
   EXCEL · LAYOUT PRINCIPAL
   ========================================================= */

.pm-excel-layout {
  display: grid;
  grid-template-columns:
    270px
    minmax(0, 1fr);
  gap: 12px;

  min-width: 0;
  min-height: 520px;
}

.pm-excel-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;

  min-width: 0;
}

.pm-excel-sidebar__body {
  display: grid;
  gap: 8px;

  padding: 10px;
}

.pm-excel-main {
  display: flex;
  flex-direction: column;

  min-width: 0;

  overflow: hidden;

  background: var(--pm-surface);
  border: 1px solid var(--pm-line);
  border-radius: 12px;
}

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

  min-height: 54px;
  padding: 10px 12px;

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

.pm-excel-main__head > div {
  min-width: 0;
}

.pm-excel-main__head span {
  display: block;

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

  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.pm-excel-main__head strong {
  display: block;

  margin-top: 3px;

  color: var(--pm-text);

  font-size: 11.5px;
  font-weight: 750;
}

.pm-excel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;

  flex-wrap: wrap;
}

/* =========================================================
   EXCEL · SELECTOR DE ARCHIVO
   ========================================================= */

.pm-excel-file {
  position: relative;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  width: 100%;
  min-height: 36px;
  padding: 0 11px;

  overflow: hidden;

  color: var(--pm-text);
  background: var(--pm-surface);
  border: 1px solid var(--pm-line-strong);
  border-radius: 9px;

  font-size: 10px;
  font-weight: 700;

  cursor: pointer;

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

.pm-excel-file:hover {
  background: var(--pm-surface-soft);
  border-color: var(--pm-text);
}

.pm-excel-file input {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  opacity: 0;
  cursor: pointer;
}

/* =========================================================
   EXCEL · PEGADO MANUAL
   ========================================================= */

.pm-excel-paste {
  display: grid;
  gap: 6px;

  min-width: 0;
}

.pm-excel-paste textarea {
  min-height: 150px;
  resize: vertical;
}

.pm-excel-sidebar__body > .pm-btn {
  width: 100%;
}

/* =========================================================
   EXCEL · ERRORES
   ========================================================= */

.pm-excel-errors {
  display: grid;
  gap: 4px;

  max-height: 110px;
  margin: 10px 10px 0;
  padding: 9px;

  overflow-y: auto;

  color: var(--pm-danger);
  background: var(--pm-danger-soft);
  border: 1px solid var(--pm-danger-line);
  border-radius: 9px;
}

.pm-excel-errors span {
  color: inherit;

  font-size: 8.8px;
  font-weight: 600;
  line-height: 1.3;
}

/* =========================================================
   EXCEL · TABLA
   ========================================================= */

.pm-excel-table-wrap {
  flex: 1 1 auto;
  min-height: 0;

  overflow: auto;

  scrollbar-width: thin;
  scrollbar-color:
    var(--pm-line-strong)
    transparent;
}

.pm-excel-table {
  width: 100%;
  min-width: 800px;

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

.pm-excel-table th {
  position: sticky;
  top: 0;
  z-index: 2;

  padding: 8px;

  color: var(--pm-text-muted);
  background: var(--pm-surface-soft);
  border-bottom: 1px solid var(--pm-line);

  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.pm-excel-table td {
  padding: 8px;

  color: var(--pm-text-soft);
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-line);

  font-size: 9.5px;
  font-weight: 500;
  vertical-align: middle;
}

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

.pm-excel-table tr.is-ok td {
  background: var(--pm-success-soft);
}

.pm-excel-table tr.is-error td {
  background: var(--pm-warning-soft);
}

.pm-excel-table input {
  height: 32px;
  padding: 0 8px;

  font-size: 9px;
}

/* =========================================================
   NUEVO PEDIDO · BOTONES IMPORTANTES
   ========================================================= */

.pm-page.pm-gestion-page [data-open-create-pedido],
.pm-modal [data-create-pedido],
.pm-modal [data-add-producto-pedido],
.pm-modal [data-add-excel-validos] {
  color: var(--pm-primary-text);
  background: var(--pm-primary);
  border-color: var(--pm-primary);
}

.pm-page.pm-gestion-page [data-open-create-pedido]:hover,
.pm-modal [data-create-pedido]:hover,
.pm-modal [data-add-producto-pedido]:hover,
.pm-modal [data-add-excel-validos]:hover {
  color: var(--pm-primary-text);
  background: var(--pm-primary);
  border-color: var(--pm-primary);

  opacity: 0.9;
}

/* =========================================================
   MODO OSCURO · MODALES
   ========================================================= */

html[data-theme="dark"] .pm-modal__card,
body.dark .pm-modal__card,
.dark .pm-modal__card {
  --pm-surface: #080808;
  --pm-surface-soft: #0d0d0d;
  --pm-surface-strong: #181818;

  --pm-text: #f5f5f5;
  --pm-text-soft: #bdbdbd;
  --pm-text-muted: #7d7d7d;

  --pm-line: rgba(255, 255, 255, 0.08);
  --pm-line-strong: rgba(255, 255, 255, 0.15);

  --pm-primary: #f5f5f5;
  --pm-primary-text: #000000;

  --pm-success: #6fd7a3;
  --pm-success-soft: rgba(111, 215, 163, 0.09);
  --pm-success-line: rgba(111, 215, 163, 0.2);

  --pm-warning: #e5c36a;
  --pm-warning-soft: rgba(229, 195, 106, 0.09);
  --pm-warning-line: rgba(229, 195, 106, 0.2);

  --pm-danger: #ff8a80;
  --pm-danger-soft: rgba(255, 138, 128, 0.08);
  --pm-danger-line: rgba(255, 138, 128, 0.2);

  color: var(--pm-text);
  background: #080808;
  border-color: rgba(255, 255, 255, 0.15);
}

html[data-theme="dark"] .pm-modal,
body.dark .pm-modal,
.dark .pm-modal {
  background: rgba(0, 0, 0, 0.86);
}

html[data-theme="dark"] .pm-modal input,
html[data-theme="dark"] .pm-modal select,
html[data-theme="dark"] .pm-modal textarea,
body.dark .pm-modal input,
body.dark .pm-modal select,
body.dark .pm-modal textarea,
.dark .pm-modal input,
.dark .pm-modal select,
.dark .pm-modal textarea {
  color-scheme: dark;
}

html[data-theme="dark"] .pm-modal option,
body.dark .pm-modal option,
.dark .pm-modal option {
  color: #f5f5f5;
  background: #080808;
}

/* =========================================================
   SCROLLBARS
   ========================================================= */

.pm-page.pm-gestion-page *,
.pm-modal * {
  scrollbar-width: thin;
}

.pm-page.pm-gestion-page *::-webkit-scrollbar,
.pm-modal *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.pm-page.pm-gestion-page *::-webkit-scrollbar-track,
.pm-modal *::-webkit-scrollbar-track {
  background: transparent;
}

.pm-page.pm-gestion-page *::-webkit-scrollbar-thumb,
.pm-modal *::-webkit-scrollbar-thumb {
  background: var(--pm-line-strong);
  border-radius: 999px;
}

/* =========================================================
   ANIMACIÓN DE CARGA
   ========================================================= */

.is-spinning {
  animation:
    pm-spin
    0.85s
    linear
    infinite;
}

@keyframes pm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   RESPONSIVE · 1280
   ========================================================= */

@media (max-width: 1280px) {
  .pm-page.pm-gestion-page .pm-metrics {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .pm-create-layout {
    grid-template-columns:
      minmax(280px, 0.9fr)
      minmax(0, 1.35fr);
  }

  .pm-detail-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .pm-detail-layout {
    grid-template-columns:
      minmax(0, 1.8fr)
      minmax(250px, 0.8fr);
  }
}

/* =========================================================
   RESPONSIVE · 1024
   ========================================================= */

@media (max-width: 1024px) {
  .pm-page.pm-gestion-page .pm-filters-bar {
    grid-template-columns: 1fr;
  }

  .pm-page.pm-gestion-page .pm-toolbar {
    justify-content: flex-start;
  }

  .pm-page.pm-gestion-page .pm-toolbar select {
    flex: 1 1 170px;
  }

  .pm-create-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .pm-create-column {
    overflow: visible;
  }

  .pm-detail-layout {
    grid-template-columns: 1fr;
  }

  .pm-detail-history {
    max-height: none;
  }

  .pm-excel-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

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

/* =========================================================
   RESPONSIVE · 820
   ========================================================= */

@media (max-width: 820px) {
  .pm-page.pm-gestion-page {
    gap: 10px;
  }

  .pm-page.pm-gestion-page .pm-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pm-page.pm-gestion-page .pm-actions--top {
    justify-content: flex-start;
    width: 100%;
  }

  .pm-page.pm-gestion-page .pm-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .pm-page.pm-gestion-page .pm-card-metric {
    min-height: 70px;
  }

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

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

  .pm-product-entry .pm-field--button {
    grid-column: 1 / -1;
  }

  .pm-product-entry .pm-field--button .pm-btn {
    width: 100%;
  }

  .pm-item-row {
    grid-template-columns:
      minmax(0, 1fr)
      repeat(3, 66px);
  }

  .pm-excel-sidebar {
    grid-template-columns: 1fr;
  }

  .pm-excel-main__head {
    align-items: stretch;
    flex-direction: column;
  }

  .pm-excel-tools {
    justify-content: flex-start;
  }
}

/* =========================================================
   RESPONSIVE · 640
   ========================================================= */

@media (max-width: 640px) {
  .pm-page.pm-gestion-page .pm-brand {
    align-items: flex-start;
  }

  .pm-page.pm-gestion-page .pm-brand__icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .pm-page.pm-gestion-page .pm-brand h2 {
    font-size: 16px;
  }

  .pm-page.pm-gestion-page .pm-brand p {
    font-size: 10px;
  }

  .pm-page.pm-gestion-page .pm-actions--top,
  .pm-page.pm-gestion-page .pm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pm-page.pm-gestion-page .pm-actions--top .pm-btn,
  .pm-page.pm-gestion-page .pm-toolbar .pm-btn,
  .pm-page.pm-gestion-page .pm-toolbar select {
    width: 100%;
  }

  .pm-page.pm-gestion-page .pm-metrics {
    grid-template-columns: 1fr;
  }

  .pm-page.pm-gestion-page .pm-card-metric {
    min-height: 62px;
  }

  .pm-modal {
    padding: 8px;
  }

  .pm-modal__card,
  .pm-create-modal,
  .pm-detail-modal,
  .pm-excel-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);

    border-radius: 12px;
  }

  .pm-modal__head {
    align-items: stretch;
    flex-direction: column;

    min-height: 0;
  }

  .pm-modal__head .pm-actions {
    justify-content: flex-start;
  }

  .pm-modal__body {
    padding: 9px;
  }

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

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

  .pm-create-fields-grid {
    grid-template-columns: 1fr;
  }

  .pm-product-entry {
    grid-template-columns: 1fr;
  }

  .pm-product-entry .pm-field--button {
    grid-column: auto;
  }

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

  .pm-item-row {
    grid-template-columns: 1fr;
  }

  .pm-item-row > div:not(:first-child) {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      auto;
    align-items: center;

    text-align: left;
  }

  .pm-item-row > div:not(:first-child) strong {
    margin-top: 0;
  }

  .pm-excel-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .pm-excel-tools .pm-btn {
    width: 100%;
  }
}

/* =========================================================
   RESPONSIVE · 420
   ========================================================= */

@media (max-width: 420px) {
  .pm-page.pm-gestion-page .pm-head {
    padding: 10px;
  }

  .pm-page.pm-gestion-page .pm-brand__icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .pm-page.pm-gestion-page .pm-brand h2 {
    font-size: 15px;
  }

  .pm-page.pm-gestion-page .pm-brand p {
    font-size: 9.5px;
  }

  .pm-page.pm-gestion-page .pm-card-metric strong {
    font-size: 17px;
  }

  .pm-create-column__head,
  .pm-create-column__body,
  .pm-panel__head,
  .pm-excel-main__head {
    padding-right: 9px;
    padding-left: 9px;
  }

  .pm-selected-box,
  .pm-detected-line,
  .pm-empty-inline {
    padding: 8px;
  }
}/* =========================================================
   DETALLE DE PEDIDO · REDUCIR ESPACIO MUERTO
   ========================================================= */

.pm-detail-modal {
  width: min(980px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 48px) !important;
}

.pm-detail-modal .pm-modal__body {
  display: grid !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;

  min-height: 0 !important;
  max-height: calc(100vh - 132px) !important;
  overflow-y: auto !important;

  padding: 10px !important;
}

/* Resumen superior más compacto */
.pm-detail-modal .pm-detail-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 7px !important;

  margin-bottom: 9px !important;
}

.pm-detail-modal .pm-detail-grid article {
  min-height: 62px !important;
  padding: 9px !important;
}

.pm-detail-modal .pm-detail-grid span {
  font-size: 7.5px !important;
}

.pm-detail-modal .pm-detail-grid strong {
  margin-top: 4px !important;
  font-size: 10px !important;
}

/* Contenido inferior sin ocupar toda la altura */
.pm-detail-modal .pm-detail-layout {
  grid-template-columns:
    minmax(0, 2.2fr)
    minmax(230px, 0.8fr) !important;

  gap: 9px !important;

  align-items: start !important;
}

/* Los paneles ya no se estiran verticalmente */
.pm-detail-modal .pm-detail-products,
.pm-detail-modal .pm-detail-history {
  align-self: start !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Cabeceras compactas */
.pm-detail-modal .pm-panel__head {
  min-height: 44px !important;
  padding: 8px 10px !important;
}

/* Listas con altura automática */
.pm-detail-modal .pm-items-list,
.pm-detail-modal .pm-history-list {
  height: auto !important;
  min-height: 0 !important;
  max-height: 320px !important;

  padding: 8px !important;
  gap: 6px !important;

  overflow-y: auto !important;
}

/* Producto más compacto */
.pm-detail-modal .pm-item-row {
  min-height: 42px !important;
  padding: 8px !important;

  grid-template-columns:
    minmax(0, 1fr)
    62px
    62px
    62px !important;
}

/* Historial más compacto */
.pm-detail-modal .pm-history-list article {
  padding: 8px 8px 8px 16px !important;
}

/* Cuando hay pocos registros, no llenar la pantalla */
.pm-detail-modal .pm-detail-products,
.pm-detail-modal .pm-detail-history,
.pm-detail-modal .pm-items-list,
.pm-detail-modal .pm-history-list {
  flex: 0 0 auto !important;
}

/* Responsive */
@media (max-width: 900px) {
  .pm-detail-modal {
    width: min(760px, calc(100vw - 24px)) !important;
  }

  .pm-detail-modal .pm-detail-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;
  }

  .pm-detail-modal .pm-detail-layout {
    grid-template-columns: 1fr !important;
  }

  .pm-detail-modal .pm-items-list,
  .pm-detail-modal .pm-history-list {
    max-height: 260px !important;
  }
}

@media (max-width: 640px) {
  .pm-detail-modal .pm-detail-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
  }

  .pm-detail-modal .pm-item-row {
    grid-template-columns: 1fr !important;
  }
}/* =========================================================
   KPI · QUITAR SOMBRA / RELIEVE TRASERO
   ========================================================= */

.pm-page.pm-gestion-page .pm-metrics,
.pm-page.pm-gestion-page .pm-metrics--strip,
.pm-page.pm-gestion-page .pm-card-metric {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Quita cualquier pseudo-elemento que genere sombra */
.pm-page.pm-gestion-page .pm-metrics::before,
.pm-page.pm-gestion-page .pm-metrics::after,
.pm-page.pm-gestion-page .pm-card-metric::before,
.pm-page.pm-gestion-page .pm-card-metric::after {
  content: none !important;
  display: none !important;
}

/* Fondo plano detrás de los KPI */
.pm-page.pm-gestion-page .pm-metrics,
.pm-page.pm-gestion-page .pm-metrics--strip {
  background: var(--pm-line) !important;
  border: 1px solid var(--pm-line) !important;
}

/* KPI individuales completamente planos */
.pm-page.pm-gestion-page .pm-card-metric {
  background: var(--pm-surface) !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* Mantiene redondeadas solo las puntas externas */
.pm-page.pm-gestion-page .pm-card-metric:first-child {
  border-radius:
    var(--pm-radius-md)
    0
    0
    var(--pm-radius-md) !important;
}

.pm-page.pm-gestion-page .pm-card-metric:last-child {
  border-radius:
    0
    var(--pm-radius-md)
    var(--pm-radius-md)
    0 !important;
}/* =========================================================
   GESTIÓN DE PEDIDOS MAYORISTAS
   MISMA ESCALA VISUAL + MODALES CORREGIDOS
   Agregar al FINAL del CSS
   ========================================================= */

/* =========================================================
   ESCALA GENERAL
   ========================================================= */

.pm-page.pm-gestion-page {
  gap: 12px !important;
}

/* =========================================================
   CABECERA
   ========================================================= */

.pm-page.pm-gestion-page .pm-head {
  min-height: 92px !important;

  padding:
    15px
    17px !important;

  gap: 16px !important;
}

.pm-page.pm-gestion-page .pm-brand {
  gap: 13px !important;
}

.pm-page.pm-gestion-page .pm-brand__icon {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;

  border-radius: 11px !important;
}

.pm-page.pm-gestion-page .pm-brand__icon .icon,
.pm-page.pm-gestion-page .pm-brand__icon svg {
  width: 21px !important;
  height: 21px !important;
}

.pm-page.pm-gestion-page .pm-brand h2 {
  font-size:
    clamp(
      24px,
      2.1vw,
      30px
    ) !important;

  font-weight: 950 !important;
  line-height: 1 !important;
}

.pm-page.pm-gestion-page .pm-brand p {
  margin-top: 6px !important;

  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.45 !important;
}

/* =========================================================
   BOTONES
   ========================================================= */

.pm-page.pm-gestion-page .pm-btn,
.pm-modal .pm-btn {
  min-height: 36px !important;

  padding:
    0
    12px !important;

  gap: 7px !important;

  border-radius: 9px !important;

  font-size: 11px !important;
  font-weight: 900 !important;
}

.pm-page.pm-gestion-page .pm-btn .icon,
.pm-modal .pm-btn .icon {
  width: 15px !important;
  height: 15px !important;

  min-width: 15px !important;
  min-height: 15px !important;
}

.pm-page.pm-gestion-page .pm-icon-btn,
.pm-modal .pm-icon-btn {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;

  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;

  padding: 0 !important;

  border-radius: 9px !important;
}

.pm-page.pm-gestion-page .pm-icon-btn .icon,
.pm-modal .pm-icon-btn .icon {
  width: 15px !important;
  height: 15px !important;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.pm-page.pm-gestion-page .pm-card-metric {
  min-height: 72px !important;

  padding:
    11px
    12px !important;
}

.pm-page.pm-gestion-page .pm-card-metric span {
  font-size: 9px !important;
  font-weight: 900 !important;
}

.pm-page.pm-gestion-page .pm-card-metric strong {
  margin-top: 5px !important;

  font-size: 19px !important;
  font-weight: 950 !important;
}

.pm-page.pm-gestion-page .pm-card-metric small {
  margin-top: 5px !important;

  font-size: 9.5px !important;
}

/* =========================================================
   PANEL Y FILTROS
   ========================================================= */

.pm-page.pm-gestion-page .pm-panel__head {
  min-height: 60px !important;

  padding:
    10px
    13px !important;
}

.pm-page.pm-gestion-page .pm-panel__head span {
  font-size: 9px !important;
}

.pm-page.pm-gestion-page .pm-panel__head strong {
  font-size: 15px !important;
  font-weight: 950 !important;
}

.pm-page.pm-gestion-page .pm-filters-bar {
  padding:
    12px !important;

  gap: 10px !important;
}

.pm-page.pm-gestion-page .pm-search input,
.pm-page.pm-gestion-page .pm-toolbar select,
.pm-page.pm-gestion-page .pm-select {
  height: 38px !important;
  min-height: 38px !important;

  border-radius: 9px !important;

  font-size: 10.8px !important;
  font-weight: 800 !important;
}

.pm-page.pm-gestion-page .pm-search input {
  padding-left: 36px !important;
}

.pm-page.pm-gestion-page .pm-search .icon {
  width: 15px !important;
  height: 15px !important;
}

/* =========================================================
   TABLA PRINCIPAL
   ========================================================= */

.pm-page.pm-gestion-page .pm-table {
  min-width: 1120px !important;
}

.pm-page.pm-gestion-page .pm-table thead th {
  height: 42px !important;

  padding:
    0
    10px !important;

  font-size: 8.8px !important;
  font-weight: 950 !important;
}

.pm-page.pm-gestion-page .pm-table tbody td {
  height: 56px !important;

  padding:
    0
    10px !important;

  font-size: 10.8px !important;
  font-weight: 760 !important;
}

.pm-page.pm-gestion-page .pm-order-cell strong,
.pm-page.pm-gestion-page .pm-client-cell strong,
.pm-page.pm-gestion-page .pm-table-main,
.pm-page.pm-gestion-page .pm-table-number {
  font-size: 11px !important;
  font-weight: 950 !important;
}

.pm-page.pm-gestion-page .pm-order-cell small,
.pm-page.pm-gestion-page .pm-client-cell small {
  font-size: 9px !important;
}

/* =========================================================
   BADGES
   ========================================================= */

.pm-page.pm-gestion-page .pm-badge,
.pm-modal .pm-badge {
  min-height: 25px !important;

  padding:
    4px
    9px !important;

  font-size: 9px !important;
  font-weight: 950 !important;
}

/* =========================================================
   ACCIONES DE TABLA
   ========================================================= */

.pm-page.pm-gestion-page .pm-table th:nth-child(7),
.pm-page.pm-gestion-page .pm-table td:nth-child(7) {
  width: 240px !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(8),
.pm-page.pm-gestion-page .pm-table td:nth-child(8) {
  width: 145px !important;
}

.pm-page.pm-gestion-page .pm-assignment-cell {
  gap: 7px !important;
}

.pm-page.pm-gestion-page .pm-select--mini {
  height: 36px !important;
  min-height: 36px !important;

  font-size: 10px !important;
}

.pm-page.pm-gestion-page .pm-table-actions {
  justify-content: flex-start !important;

  gap: 6px !important;
}

.pm-page.pm-gestion-page .pm-btn--table {
  min-width: 72px !important;

  height: 32px !important;
  min-height: 32px !important;

  padding:
    0
    10px !important;

  font-size: 9.8px !important;
}

/* =========================================================
   MODALES · CAPA GENERAL
   ========================================================= */

.pm-modal {
  position: fixed !important;
  inset: 0 !important;

  z-index: 100000 !important;

  display: none !important;
  align-items: center !important;
  justify-content: center !important;

  width: 100vw !important;
  height: 100vh !important;

  padding: 18px !important;

  background:
    rgba(
      0,
      0,
      0,
      0.72
    ) !important;

  backdrop-filter: blur(7px) !important;
  -webkit-backdrop-filter: blur(7px) !important;

  overflow: hidden !important;
}

.pm-modal.is-open {
  display: flex !important;
}

/* =========================================================
   ORDEN DE SUPERPOSICIÓN
   ========================================================= */

#pmGestionModal {
  z-index: 100000 !important;
}

#pmCreatePedidoModal {
  z-index: 100100 !important;
}

#pmExcelModal {
  z-index: 100200 !important;
}

/* =========================================================
   TARJETA DEL MODAL
   ========================================================= */

.pm-modal__card {
  position: relative !important;
  z-index: 3 !important;

  display: grid !important;

  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto !important;

  width:
    min(
      1120px,
      calc(100vw - 36px)
    ) !important;

  max-height:
    calc(
      100vh -
      36px
    ) !important;

  min-width: 0 !important;
  min-height: 0 !important;

  color: #111111 !important;

  background: #ffffff !important;

  border:
    1px solid
    rgba(
      0,
      0,
      0,
      0.18
    ) !important;

  border-radius: 16px !important;

  box-shadow:
    0 30px 90px
    rgba(
      0,
      0,
      0,
      0.36
    ) !important;

  opacity: 1 !important;
  visibility: visible !important;

  overflow: hidden !important;
}

.pm-create-modal {
  width:
    min(
      1260px,
      calc(100vw - 36px)
    ) !important;

  height:
    min(
      860px,
      calc(100vh - 36px)
    ) !important;
}

.pm-detail-modal {
  width:
    min(
      1080px,
      calc(100vw - 36px)
    ) !important;

  height: auto !important;

  max-height:
    calc(
      100vh -
      36px
    ) !important;
}

.pm-excel-modal {
  width:
    min(
      1260px,
      calc(100vw - 36px)
    ) !important;

  height:
    min(
      860px,
      calc(100vh - 36px)
    ) !important;
}

/* =========================================================
   MODALES · MODO OSCURO
   ========================================================= */

html[data-theme="dark"] .pm-modal__card,
body.dark .pm-modal__card,
.dark .pm-modal__card {
  color: #f5f5f5 !important;

  background: #0b0b0b !important;

  border-color:
    rgba(
      255,
      255,
      255,
      0.16
    ) !important;

  box-shadow:
    0 34px 100px
    rgba(
      0,
      0,
      0,
      0.86
    ) !important;
}

/* =========================================================
   HEADER DEL MODAL
   ========================================================= */

.pm-modal__head {
  position: relative !important;
  z-index: 5 !important;

  min-height: 72px !important;

  padding:
    13px
    15px !important;

  background: #ffffff !important;

  border-bottom:
    1px solid
    rgba(
      0,
      0,
      0,
      0.12
    ) !important;
}

.pm-modal__head span {
  color: #666666 !important;

  font-size: 9px !important;
  font-weight: 900 !important;
}

.pm-modal__head strong {
  color: #111111 !important;

  font-size: 19px !important;
  font-weight: 950 !important;
}

.pm-modal__head small {
  color: #666666 !important;

  font-size: 10.5px !important;
}

html[data-theme="dark"] .pm-modal__head,
body.dark .pm-modal__head,
.dark .pm-modal__head {
  background: #0b0b0b !important;

  border-bottom-color:
    rgba(
      255,
      255,
      255,
      0.11
    ) !important;
}

html[data-theme="dark"] .pm-modal__head span,
html[data-theme="dark"] .pm-modal__head small,
body.dark .pm-modal__head span,
body.dark .pm-modal__head small,
.dark .pm-modal__head span,
.dark .pm-modal__head small {
  color:
    rgba(
      255,
      255,
      255,
      0.58
    ) !important;
}

html[data-theme="dark"] .pm-modal__head strong,
body.dark .pm-modal__head strong,
.dark .pm-modal__head strong {
  color: #ffffff !important;
}

/* =========================================================
   CUERPO DEL MODAL
   ========================================================= */

.pm-modal__body {
  min-width: 0 !important;
  min-height: 0 !important;

  padding:
    14px !important;

  background: #f5f6f8 !important;

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

  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
}

html[data-theme="dark"] .pm-modal__body,
body.dark .pm-modal__body,
.dark .pm-modal__body {
  background: #080808 !important;
}

/* =========================================================
   FOOTER DEL MODAL
   ========================================================= */

.pm-modal__footer {
  position: relative !important;
  z-index: 5 !important;

  min-height: 64px !important;

  padding:
    12px
    15px !important;

  gap: 8px !important;

  background: #ffffff !important;

  border-top:
    1px solid
    rgba(
      0,
      0,
      0,
      0.12
    ) !important;
}

html[data-theme="dark"] .pm-modal__footer,
body.dark .pm-modal__footer,
.dark .pm-modal__footer {
  background: #0b0b0b !important;

  border-top-color:
    rgba(
      255,
      255,
      255,
      0.11
    ) !important;
}

/* =========================================================
   NUEVO PEDIDO
   ========================================================= */

.pm-create-layout {
  grid-template-columns:
    minmax(330px, 0.78fr)
    minmax(0, 1.55fr) !important;

  gap: 12px !important;

  min-height: 0 !important;
  height: 100% !important;
}

.pm-create-column {
  min-height: 0 !important;

  border-radius: 12px !important;
}

.pm-create-column__head {
  min-height: 60px !important;

  padding:
    10px
    12px !important;
}

.pm-create-column__head > span,
.pm-create-column__head > div > span {
  font-size: 9px !important;
}

.pm-create-column__head > strong,
.pm-create-column__head > div > strong {
  font-size: 14px !important;
}

.pm-create-column__body {
  gap: 10px !important;

  padding:
    12px !important;

  min-height: 0 !important;
}

/* =========================================================
   CAMPOS
   ========================================================= */

.pm-field {
  gap: 6px !important;
}

.pm-field > span {
  font-size: 9px !important;
  font-weight: 900 !important;
}

.pm-field input,
.pm-field select,
.pm-field textarea,
.pm-excel-table input,
.pm-excel-paste textarea {
  font-size: 10.8px !important;
  font-weight: 800 !important;

  border-radius: 9px !important;
}

.pm-field input,
.pm-field select,
.pm-excel-table input {
  height: 38px !important;
  min-height: 38px !important;

  padding:
    0
    10px !important;
}

.pm-field textarea {
  min-height: 100px !important;

  padding:
    10px !important;
}

/* =========================================================
   PRODUCTOS DEL NUEVO PEDIDO
   ========================================================= */

.pm-product-entry {
  grid-template-columns:
    minmax(0, 1fr)
    100px
    112px !important;

  gap: 8px !important;
}

.pm-selected-box,
.pm-detected-line,
.pm-empty-inline {
  min-height: 50px !important;

  padding:
    10px
    11px !important;
}

.pm-selected-box strong,
.pm-detected-line strong,
.pm-empty-inline strong {
  font-size: 11px !important;
}

.pm-selected-box span,
.pm-detected-line span,
.pm-detected-line small,
.pm-empty-inline span {
  font-size: 9.5px !important;
}

.pm-fast-items__head {
  min-height: 56px !important;

  padding:
    10px
    12px !important;
}

.pm-fast-items__head span {
  font-size: 9px !important;
}

.pm-fast-items__head strong {
  font-size: 12px !important;
}

.pm-fast-items-wrap {
  max-height: 330px !important;
}

.pm-fast-items-table th {
  height: 40px !important;

  font-size: 8.5px !important;
}

.pm-fast-items-table td {
  height: 50px !important;

  font-size: 10px !important;
}

/* =========================================================
   DETALLE
   ========================================================= */

.pm-detail-modal .pm-detail-grid article {
  min-height: 68px !important;

  padding:
    10px !important;
}

.pm-detail-modal .pm-detail-grid span {
  font-size: 8.5px !important;
}

.pm-detail-modal .pm-detail-grid strong {
  font-size: 11px !important;
}

.pm-detail-modal .pm-panel__head {
  min-height: 54px !important;

  padding:
    9px
    11px !important;
}

.pm-detail-modal .pm-items-list,
.pm-detail-modal .pm-history-list {
  max-height: 360px !important;

  padding:
    9px !important;
}

.pm-detail-modal .pm-item-row {
  min-height: 50px !important;

  padding:
    9px !important;
}

.pm-detail-modal .pm-item-row strong {
  font-size: 10.5px !important;
}

.pm-detail-modal .pm-item-row span,
.pm-detail-modal .pm-item-row small {
  font-size: 9px !important;
}

/* =========================================================
   CARGA MASIVA
   ========================================================= */

.pm-excel-layout {
  grid-template-columns:
    300px
    minmax(0, 1fr) !important;

  gap: 12px !important;

  min-height: 0 !important;
  height: 100% !important;
}

.pm-excel-main__head {
  min-height: 60px !important;

  padding:
    10px
    12px !important;
}

.pm-excel-main__head span {
  font-size: 9px !important;
}

.pm-excel-main__head strong {
  font-size: 14px !important;
}

.pm-excel-file {
  min-height: 38px !important;

  font-size: 10.5px !important;
}

.pm-excel-table th {
  height: 40px !important;

  font-size: 8.5px !important;
}

.pm-excel-table td {
  height: 50px !important;

  font-size: 10px !important;
}

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

@media (max-width: 1024px) {
  .pm-create-layout,
  .pm-excel-layout {
    grid-template-columns: 1fr !important;

    height: auto !important;
  }

  .pm-create-column,
  .pm-excel-main {
    overflow: visible !important;
  }
}

@media (max-width: 760px) {
  .pm-page.pm-gestion-page {
    gap: 10px !important;
  }

  .pm-page.pm-gestion-page .pm-head {
    min-height: 0 !important;

    padding:
      12px !important;
  }

  .pm-page.pm-gestion-page .pm-brand h2 {
    font-size: 22px !important;
  }

  .pm-page.pm-gestion-page .pm-brand p {
    font-size: 11px !important;
  }

  .pm-modal {
    padding: 8px !important;
  }

  .pm-modal__card,
  .pm-create-modal,
  .pm-detail-modal,
  .pm-excel-modal {
    width:
      calc(
        100vw -
        16px
      ) !important;

    height:
      calc(
        100dvh -
        16px
      ) !important;

    max-height:
      calc(
        100dvh -
        16px
      ) !important;

    border-radius: 13px !important;
  }

  .pm-detail-modal {
    height: auto !important;
  }

  .pm-modal__footer {
    display: grid !important;
    grid-template-columns: 1fr !important;

    padding:
      10px !important;
  }

  .pm-modal__footer .pm-btn {
    width: 100% !important;
  }
}/* =========================================================
   GESTIÓN DE PEDIDOS · COLUMNA ACCIONES ALINEADA
   Agregar al FINAL del CSS
   ========================================================= */

/* Dar ancho fijo suficiente a la columna */

.pm-page.pm-gestion-page .pm-table th:nth-child(8),
.pm-page.pm-gestion-page .pm-table td:nth-child(8) {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;

  padding-left: 8px !important;
  padding-right: 8px !important;
}

/* Alinear el nombre de la columna con los botones */

.pm-page.pm-gestion-page .pm-table th:nth-child(8) {
  text-align: left !important;

  padding-left: 12px !important;
}

/* Mover los botones hacia la izquierda */

.pm-page.pm-gestion-page .pm-table-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;

  width: 100% !important;

  gap: 6px !important;

  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Botón Ver */

.pm-page.pm-gestion-page .pm-table-actions .pm-btn--table {
  flex: 0 0 72px !important;

  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;

  padding:
    0
    9px !important;
}

/* Botón cancelar */

.pm-page.pm-gestion-page .pm-table-actions .pm-icon-btn {
  flex: 0 0 36px !important;

  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
}

/* Evitar que la tabla empuje acciones al borde */

.pm-page.pm-gestion-page .pm-table th:nth-child(7),
.pm-page.pm-gestion-page .pm-table td:nth-child(7) {
  width: 225px !important;
}

/* Ajuste general de la tabla */

.pm-page.pm-gestion-page .pm-table {
  min-width: 1080px !important;
}/* =========================================================
   GESTIÓN DE PEDIDOS · USAR TODO EL ANCHO HORIZONTAL
   Agregar al FINAL del CSS
   ========================================================= */

.app-content:has(.pm-gestion-page) {
  width: 100% !important;
  max-width: none !important;

  padding-left: 10px !important;
  padding-right: 10px !important;
}

.pm-page.pm-gestion-page,
.pm-page.pm-gestion-page .pm-head,
.pm-page.pm-gestion-page .pm-metrics,
.pm-page.pm-gestion-page .pm-panel,
.pm-page.pm-gestion-page .pm-filters-bar,
.pm-page.pm-gestion-page .pm-table-wrap {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* La tabla se adapta al ancho completo */

.pm-page.pm-gestion-page .pm-table {
  width: 100% !important;
  min-width: 0 !important;

  table-layout: fixed !important;
}

/* Reparto horizontal de columnas */

.pm-page.pm-gestion-page .pm-table th:nth-child(1),
.pm-page.pm-gestion-page .pm-table td:nth-child(1) {
  width: 13% !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(2),
.pm-page.pm-gestion-page .pm-table td:nth-child(2) {
  width: 18% !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(3),
.pm-page.pm-gestion-page .pm-table td:nth-child(3) {
  width: 12% !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(4),
.pm-page.pm-gestion-page .pm-table td:nth-child(4) {
  width: 10% !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(5),
.pm-page.pm-gestion-page .pm-table td:nth-child(5),
.pm-page.pm-gestion-page .pm-table th:nth-child(6),
.pm-page.pm-gestion-page .pm-table td:nth-child(6) {
  width: 7% !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(7),
.pm-page.pm-gestion-page .pm-table td:nth-child(7) {
  width: 22% !important;
}

.pm-page.pm-gestion-page .pm-table th:nth-child(8),
.pm-page.pm-gestion-page .pm-table td:nth-child(8) {
  width: 11% !important;
  min-width: 150px !important;
  max-width: none !important;
}

/* Responsable ocupa todo el ancho de su celda */

.pm-page.pm-gestion-page .pm-assignment-cell {
  width: 100% !important;
}

.pm-page.pm-gestion-page .pm-assignment-cell .pm-select {
  width: 100% !important;
  max-width: none !important;
}

/* Acciones alineadas dentro de la columna */

.pm-page.pm-gestion-page .pm-table th:nth-child(8) {
  text-align: left !important;
}

.pm-page.pm-gestion-page .pm-table-actions {
  width: 100% !important;

  justify-content: flex-start !important;
}

/* Evitar espacio muerto en el panel */

.pm-page.pm-gestion-page .pm-follow-panel {
  width: 100% !important;
}

@media (max-width: 1100px) {
  .pm-page.pm-gestion-page .pm-table {
    min-width: 1080px !important;
  }

  .pm-page.pm-gestion-page .pm-table-wrap {
    overflow-x: auto !important;
  }
}/* =========================================================
   GESTIÓN DE PEDIDOS MAYORISTAS
   BORDES VISIBLES + TABLAS Y CARDS CUADRICULADAS
   Agregar al FINAL del CSS
   ========================================================= */

/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.app-content:has(.pm-page.pm-gestion-page) {
  display: block !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 10px !important;

  overflow: visible !important;
}

.pm-page.pm-gestion-page {
  --pm-line: rgba(0, 0, 0, 0.16) !important;
  --pm-line-strong: rgba(0, 0, 0, 0.26) !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  gap: 12px !important;

  overflow: visible !important;
}

html[data-theme="dark"] .pm-page.pm-gestion-page,
body.dark .pm-page.pm-gestion-page,
.dark .pm-page.pm-gestion-page {
  --pm-line: rgba(255, 255, 255, 0.16) !important;
  --pm-line-strong: rgba(255, 255, 255, 0.26) !important;
}

/* =========================================================
   BORDES PRINCIPALES
   ========================================================= */

.pm-page.pm-gestion-page .pm-head,
.pm-page.pm-gestion-page .pm-metrics,
.pm-page.pm-gestion-page .pm-panel,
.pm-modal__card,
.pm-create-column,
.pm-fast-items,
.pm-excel-main {
  border:
    1px solid
    rgba(15, 23, 42, 0.2) !important;

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 5px 16px rgba(15, 23, 42, 0.05) !important;
}

.pm-page.pm-gestion-page .pm-head:hover,
.pm-page.pm-gestion-page .pm-panel:hover,
.pm-create-column:hover,
.pm-fast-items:hover,
.pm-excel-main:hover {
  border-color:
    rgba(15, 23, 42, 0.3) !important;
}

/* =========================================================
   KPIS CUADRICULADOS
   ========================================================= */

.pm-page.pm-gestion-page .pm-metrics {
  display: grid !important;
  gap: 0 !important;

  background: var(--pm-surface) !important;

  overflow: hidden !important;
}

.pm-page.pm-gestion-page .pm-card-metric {
  border: 0 !important;

  border-right:
    1px solid
    rgba(15, 23, 42, 0.16) !important;

  border-radius: 0 !important;

  box-shadow: none !important;
}

.pm-page.pm-gestion-page .pm-card-metric:last-child {
  border-right: 0 !important;
}

.pm-page.pm-gestion-page .pm-card-metric:hover {
  background:
    rgba(15, 23, 42, 0.035) !important;
}

/* =========================================================
   PANEL Y FILTROS
   ========================================================= */

.pm-page.pm-gestion-page .pm-panel {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow: visible !important;
}

.pm-page.pm-gestion-page .pm-panel__head,
.pm-modal .pm-panel__head,
.pm-create-column__head,
.pm-fast-items__head,
.pm-excel-main__head {
  border-bottom:
    1px solid
    rgba(15, 23, 42, 0.19) !important;
}

.pm-page.pm-gestion-page .pm-filters-bar {
  border-bottom:
    1px solid
    rgba(15, 23, 42, 0.19) !important;
}

.pm-page.pm-gestion-page .pm-search input,
.pm-page.pm-gestion-page .pm-toolbar select,
.pm-page.pm-gestion-page .pm-select,
.pm-field input,
.pm-field select,
.pm-field textarea,
.pm-excel-table input,
.pm-excel-paste textarea {
  border-color:
    rgba(15, 23, 42, 0.2) !important;
}

.pm-page.pm-gestion-page .pm-search input:hover,
.pm-page.pm-gestion-page .pm-search input:focus,
.pm-page.pm-gestion-page .pm-toolbar select:hover,
.pm-page.pm-gestion-page .pm-toolbar select:focus,
.pm-page.pm-gestion-page .pm-select:hover,
.pm-page.pm-gestion-page .pm-select:focus,
.pm-field input:hover,
.pm-field input:focus,
.pm-field select:hover,
.pm-field select:focus,
.pm-field textarea:hover,
.pm-field textarea:focus {
  border-color:
    rgba(15, 23, 42, 0.34) !important;
}

/* =========================================================
   TABLA PRINCIPAL CUADRICULADA
   ========================================================= */

.pm-page.pm-gestion-page .pm-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow-x: auto !important;
  overflow-y: visible !important;
}

.pm-page.pm-gestion-page .pm-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;

  border:
    1px solid
    rgba(15, 23, 42, 0.2) !important;
}

.pm-page.pm-gestion-page .pm-table th,
.pm-page.pm-gestion-page .pm-table td {
  border-right:
    1px solid
    rgba(15, 23, 42, 0.15) !important;

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

.pm-page.pm-gestion-page .pm-table th:last-child,
.pm-page.pm-gestion-page .pm-table td:last-child {
  border-right: 0 !important;
}

.pm-page.pm-gestion-page .pm-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.pm-page.pm-gestion-page .pm-table thead th {
  background:
    color-mix(
      in srgb,
      var(--pm-surface-soft) 90%,
      #e8eaed
    ) !important;

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

.pm-page.pm-gestion-page .pm-table tbody tr:nth-child(even) td {
  background:
    rgba(15, 23, 42, 0.018) !important;
}

.pm-page.pm-gestion-page .pm-table tbody tr:hover td {
  background:
    rgba(15, 23, 42, 0.05) !important;
}

/* =========================================================
   COLUMNAS DE ASIGNACIÓN Y ACCIONES
   ========================================================= */

.pm-page.pm-gestion-page .pm-table th:nth-child(7),
.pm-page.pm-gestion-page .pm-table td:nth-child(7),
.pm-page.pm-gestion-page .pm-table th:nth-child(8),
.pm-page.pm-gestion-page .pm-table td:nth-child(8) {
  border-left:
    1px solid
    rgba(15, 23, 42, 0.2) !important;
}

.pm-page.pm-gestion-page .pm-assignment-cell,
.pm-page.pm-gestion-page .pm-table-actions {
  width: 100% !important;

  padding: 0 !important;
}

.pm-page.pm-gestion-page .pm-assignment-cell .pm-select {
  border-color:
    rgba(15, 23, 42, 0.2) !important;
}

.pm-page.pm-gestion-page .pm-table-actions {
  justify-content: flex-start !important;
}

/* =========================================================
   BADGES Y BOTONES
   ========================================================= */

.pm-page.pm-gestion-page .pm-badge,
.pm-modal .pm-badge,
.pm-page.pm-gestion-page .pm-btn,
.pm-modal .pm-btn,
.pm-page.pm-gestion-page .pm-icon-btn,
.pm-modal .pm-icon-btn,
.pm-detail-count {
  border-color:
    rgba(15, 23, 42, 0.2) !important;
}

.pm-page.pm-gestion-page .pm-btn:hover:not(:disabled),
.pm-modal .pm-btn:hover:not(:disabled),
.pm-page.pm-gestion-page .pm-icon-btn:hover,
.pm-modal .pm-icon-btn:hover {
  border-color:
    rgba(15, 23, 42, 0.32) !important;
}

/* =========================================================
   NUEVO PEDIDO · COLUMNAS CUADRICULADAS
   ========================================================= */

.pm-create-layout {
  gap: 12px !important;
}

.pm-create-column {
  overflow: visible !important;
}

.pm-create-column__body {
  gap: 0 !important;

  padding: 0 !important;
}

.pm-create-column__body > .pm-field,
.pm-create-column__body > .pm-create-fields-grid,
.pm-create-column__body > .pm-product-entry,
.pm-create-column__body > .pm-fast-items {
  padding:
    11px
    12px !important;

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

.pm-create-column__body > :last-child {
  border-bottom: 0 !important;
}

.pm-create-fields-grid {
  gap: 0 !important;

  padding: 0 !important;
}

.pm-create-fields-grid .pm-field {
  padding:
    10px
    11px !important;

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

.pm-create-fields-grid .pm-field:last-child {
  border-right: 0 !important;
}

.pm-product-entry {
  gap: 0 !important;

  padding: 0 !important;
}

.pm-product-entry .pm-field {
  padding:
    10px
    11px !important;

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

.pm-product-entry .pm-field:last-child {
  border-right: 0 !important;
}

/* =========================================================
   CLIENTE Y PRODUCTO DETECTADO
   ========================================================= */

.pm-selected-box,
.pm-detected-line,
.pm-empty-inline {
  border-color:
    rgba(15, 23, 42, 0.2) !important;
}

.pm-selected-box:hover,
.pm-detected-line:hover,
.pm-empty-inline:hover {
  border-color:
    rgba(15, 23, 42, 0.3) !important;
}

/* =========================================================
   PRODUCTOS AGREGADOS · TABLA CUADRICULADA
   ========================================================= */

.pm-fast-items-wrap {
  max-height: none !important;

  overflow-x: auto !important;
  overflow-y: visible !important;
}

.pm-fast-items-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;

  border:
    1px solid
    rgba(15, 23, 42, 0.19) !important;
}

.pm-fast-items-table th,
.pm-fast-items-table td {
  border-right:
    1px solid
    rgba(15, 23, 42, 0.14) !important;

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

.pm-fast-items-table th:last-child,
.pm-fast-items-table td:last-child {
  border-right: 0 !important;
}

.pm-fast-items-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.pm-fast-items-table tbody tr:nth-child(even) td {
  background:
    rgba(15, 23, 42, 0.018) !important;
}

.pm-fast-items-table tbody tr:hover td {
  background:
    rgba(15, 23, 42, 0.05) !important;
}

/* =========================================================
   DETALLE · RESUMEN CUADRICULADO
   ========================================================= */

.pm-detail-grid {
  gap: 0 !important;

  border:
    1px solid
    rgba(15, 23, 42, 0.19) !important;

  border-radius: 11px !important;

  overflow: hidden !important;
}

.pm-detail-grid article {
  border: 0 !important;

  border-right:
    1px solid
    rgba(15, 23, 42, 0.14) !important;

  border-radius: 0 !important;
}

.pm-detail-grid article:last-child {
  border-right: 0 !important;
}

.pm-detail-grid article:hover {
  background:
    rgba(15, 23, 42, 0.035) !important;
}

/* =========================================================
   DETALLE · PRODUCTOS E HISTORIAL
   ========================================================= */

.pm-detail-layout {
  align-items: start !important;
}

.pm-items-list,
.pm-history-list {
  gap: 0 !important;

  padding: 0 !important;
}

.pm-item-row,
.pm-history-list article {
  border: 0 !important;

  border-bottom:
    1px solid
    rgba(15, 23, 42, 0.15) !important;

  border-radius: 0 !important;
}

.pm-item-row:last-child,
.pm-history-list article:last-child {
  border-bottom: 0 !important;
}

.pm-item-row {
  gap: 0 !important;
}

.pm-item-row > div {
  min-height: 48px !important;

  padding:
    8px
    9px !important;

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

.pm-item-row > div:last-child {
  border-right: 0 !important;
}

.pm-item-row:hover,
.pm-history-list article:hover {
  background:
    rgba(15, 23, 42, 0.035) !important;
}

/* =========================================================
   CARGA MASIVA · PANEL Y TABLA CUADRICULADA
   ========================================================= */

.pm-excel-sidebar .pm-panel {
  border-color:
    rgba(15, 23, 42, 0.2) !important;
}

.pm-excel-sidebar__body {
  gap: 0 !important;

  padding: 0 !important;
}

.pm-excel-sidebar__body > * {
  padding:
    11px !important;

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

.pm-excel-sidebar__body > :last-child {
  border-bottom: 0 !important;
}

.pm-excel-table-wrap {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow-x: auto !important;
  overflow-y: visible !important;
}

.pm-excel-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;

  border:
    1px solid
    rgba(15, 23, 42, 0.19) !important;
}

.pm-excel-table th,
.pm-excel-table td {
  border-right:
    1px solid
    rgba(15, 23, 42, 0.14) !important;

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

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

.pm-excel-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.pm-excel-table thead th {
  border-bottom:
    1px solid
    rgba(15, 23, 42, 0.22) !important;
}

/* =========================================================
   MODALES SEGUROS
   ========================================================= */

.pm-modal {
  position: fixed !important;
  inset: 0 !important;

  z-index: 100000 !important;

  display: none !important;
  align-items: center !important;
  justify-content: center !important;

  width: 100vw !important;
  height: 100dvh !important;

  overflow: hidden !important;

  isolation: isolate !important;
}

.pm-modal.is-open {
  display: flex !important;
}

.pm-modal[aria-hidden="true"] {
  display: none !important;

  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.pm-modal[aria-hidden="false"] {
  display: flex !important;

  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* =========================================================
   SCROLL DE PÁGINA Y FOOTER
   ========================================================= */

body:has(.pm-page.pm-gestion-page) .app-main,
body:has(.pm-page.pm-gestion-page) .app-shell {
  min-height: 100vh !important;
  height: auto !important;

  overflow: visible !important;
}

body:has(.pm-page.pm-gestion-page) .app-footer,
body:has(.pm-page.pm-gestion-page) #footerMount,
body:has(.pm-page.pm-gestion-page) footer.app-footer {
  position: static !important;

  inset: auto !important;

  width: 100% !important;

  margin-top: 12px !important;

  transform: none !important;
}

/* =========================================================
   MODO OSCURO
   ========================================================= */

html[data-theme="dark"] .pm-page.pm-gestion-page .pm-head,
html[data-theme="dark"] .pm-page.pm-gestion-page .pm-metrics,
html[data-theme="dark"] .pm-page.pm-gestion-page .pm-panel,
html[data-theme="dark"] .pm-modal__card,
html[data-theme="dark"] .pm-create-column,
html[data-theme="dark"] .pm-fast-items,
html[data-theme="dark"] .pm-excel-main,
body.dark .pm-page.pm-gestion-page .pm-head,
body.dark .pm-page.pm-gestion-page .pm-metrics,
body.dark .pm-page.pm-gestion-page .pm-panel,
body.dark .pm-modal__card {
  border-color:
    rgba(255, 255, 255, 0.2) !important;

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 20px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .pm-page.pm-gestion-page .pm-table,
html[data-theme="dark"] .pm-fast-items-table,
html[data-theme="dark"] .pm-excel-table,
html[data-theme="dark"] .pm-detail-grid {
  border-color:
    rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .pm-page.pm-gestion-page .pm-table th,
html[data-theme="dark"] .pm-page.pm-gestion-page .pm-table td,
html[data-theme="dark"] .pm-page.pm-gestion-page .pm-card-metric,
html[data-theme="dark"] .pm-create-column__body > *,
html[data-theme="dark"] .pm-create-fields-grid .pm-field,
html[data-theme="dark"] .pm-product-entry .pm-field,
html[data-theme="dark"] .pm-fast-items-table th,
html[data-theme="dark"] .pm-fast-items-table td,
html[data-theme="dark"] .pm-detail-grid article,
html[data-theme="dark"] .pm-item-row,
html[data-theme="dark"] .pm-item-row > div,
html[data-theme="dark"] .pm-history-list article,
html[data-theme="dark"] .pm-excel-table th,
html[data-theme="dark"] .pm-excel-table td {
  border-right-color:
    rgba(255, 255, 255, 0.13) !important;

  border-bottom-color:
    rgba(255, 255, 255, 0.13) !important;
}

html[data-theme="dark"] .pm-page.pm-gestion-page .pm-table thead th,
html[data-theme="dark"] .pm-fast-items-table thead th,
html[data-theme="dark"] .pm-excel-table thead th {
  background:
    #111111 !important;

  border-bottom-color:
    rgba(255, 255, 255, 0.22) !important;
}

html[data-theme="dark"]
.pm-page.pm-gestion-page
.pm-table
tbody
tr:nth-child(even)
td,
html[data-theme="dark"]
.pm-fast-items-table
tbody
tr:nth-child(even)
td {
  background:
    rgba(255, 255, 255, 0.025) !important;
}

html[data-theme="dark"]
.pm-page.pm-gestion-page
.pm-table
tbody
tr:hover
td,
html[data-theme="dark"]
.pm-fast-items-table
tbody
tr:hover
td,
html[data-theme="dark"] .pm-detail-grid article:hover,
html[data-theme="dark"] .pm-item-row:hover,
html[data-theme="dark"] .pm-history-list article:hover {
  background:
    rgba(255, 255, 255, 0.055) !important;
}

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

@media (max-width: 1280px) {
  .pm-page.pm-gestion-page .pm-card-metric {
    border-bottom:
      1px solid
      rgba(15, 23, 42, 0.14) !important;
  }

  .pm-page.pm-gestion-page .pm-card-metric:nth-child(3n) {
    border-right: 0 !important;
  }

  .pm-page.pm-gestion-page .pm-card-metric:nth-last-child(-n + 3) {
    border-bottom: 0 !important;
  }
}

@media (max-width: 1024px) {
  .pm-create-fields-grid .pm-field,
  .pm-product-entry .pm-field {
    border-right: 0 !important;

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

  .pm-create-fields-grid .pm-field:last-child,
  .pm-product-entry .pm-field:last-child {
    border-bottom: 0 !important;
  }
}

@media (max-width: 820px) {
  .pm-page.pm-gestion-page .pm-card-metric:nth-child(3n) {
    border-right:
      1px solid
      rgba(15, 23, 42, 0.14) !important;
  }

  .pm-page.pm-gestion-page .pm-card-metric:nth-child(2n) {
    border-right: 0 !important;
  }

  .pm-page.pm-gestion-page .pm-card-metric:nth-last-child(-n + 2) {
    border-bottom: 0 !important;
  }

  .pm-detail-grid article {
    border-right:
      1px solid
      rgba(15, 23, 42, 0.14) !important;

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

  .pm-detail-grid article:nth-child(2n) {
    border-right: 0 !important;
  }
}

@media (max-width: 640px) {
  .pm-page.pm-gestion-page .pm-card-metric {
    border-right: 0 !important;

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

  .pm-page.pm-gestion-page .pm-card-metric:last-child {
    border-bottom: 0 !important;
  }

  .pm-detail-grid article,
  .pm-detail-grid article:nth-child(2n) {
    border-right: 0 !important;

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

  .pm-detail-grid article:last-child {
    border-bottom: 0 !important;
  }

  .pm-item-row > div {
    border-right: 0 !important;

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

  .pm-item-row > div:last-child {
    border-bottom: 0 !important;
  }
}