/* Barcodesite — diseño unificado de módulos (UX Magento Sync) */
.module-ui {
  --bs-blue: #0a4ca2;
  --bs-blue-light: #005fd4;
  --bs-teal: #429ac4;
  --bs-teal-dark: #1d4c64;
  --bs-orange: #f26322;
  --bs-bg: #f5f7fa;
  --bs-card: #ffffff;
  --bs-border: #e2e8f0;
  --bs-text: #1a1a1a;
  --bs-muted: #64748b;
  --bs-success: #2e7d32;
  --bs-warning: #ed6c02;
  --bs-danger: #c62828;
  --bs-radius: 8px;
  --bs-shadow: 0 1px 3px rgba(10, 76, 162, 0.08);
}

.module-ui .module-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--bs-blue) 0%, var(--bs-teal-dark) 100%);
  border-radius: var(--bs-radius);
  color: #fff;
  box-shadow: var(--bs-shadow);
}

.module-ui .module-hero__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.module-ui .module-hero__title .material-icons {
  font-size: 28px;
  opacity: 0.95;
}

.module-ui .module-hero__title .magento-icon {
  width: 28px;
  height: 28px;
  color: var(--bs-orange);
  background-color: #fff;
  border-radius: 4px;
  padding: 2px;
  box-sizing: border-box;
}

.module-ui .module-hero__meta {
  font-size: 0.85rem;
  opacity: 0.92;
  margin-top: 0.35rem;
  color: #fff;
}

.module-ui .module-hero__meta a {
  color: #fff;
  text-decoration: underline;
}

.module-ui .module-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.module-ui .module-hero__actions .btn {
  font-weight: 600;
  border-radius: var(--bs-radius);
}

/* Magento Sync — hero toolbar */
.module-ui .module-hero--sync {
  align-items: flex-start;
}

.module-ui .module-hero--sync .module-hero__main {
  flex: 1 1 280px;
  min-width: 0;
}

.module-ui .module-hero--sync .module-hero__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  flex: 0 1 auto;
  margin-left: auto;
}

.module-ui .magento-sync-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--bs-radius);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.module-ui .magento-sync-toolbar__env {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.module-ui .magento-sync-toolbar__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1;
}

.module-ui .magento-env-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
  gap: 2px;
}

.module-ui .magento-env-toggle__btn {
  appearance: none;
  border: none;
  margin: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.module-ui .magento-env-toggle__btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.module-ui .magento-env-toggle__btn.is-active {
  color: var(--bs-blue);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.module-ui .magento-env-toggle__btn.is-active[data-env="dev"] {
  color: var(--bs-teal-dark);
}

.module-ui .magento-sync-env-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.module-ui .magento-sync-toolbar__sync {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--bs-radius);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(180deg, #f57c3b 0%, var(--bs-orange) 100%);
  box-shadow: 0 4px 14px rgba(242, 99, 34, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  white-space: nowrap;
}

.module-ui .magento-sync-toolbar__log {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--bs-radius);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.module-ui .magento-sync-toolbar__log .material-icons {
  font-size: 18px;
}

.module-ui .magento-sync-toolbar__log:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}

.module-ui .magento-sync-toolbar__sync .material-icons {
  font-size: 18px;
}

.module-ui .magento-sync-toolbar__sync:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(242, 99, 34, 0.45);
}

.module-ui .magento-sync-toolbar__sync:active:not(:disabled) {
  transform: translateY(0);
}

.module-ui .magento-sync-toolbar__sync:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .module-ui .module-hero--sync .module-hero__side {
    align-items: stretch;
    width: 100%;
    margin-left: 0;
  }

  .module-ui .magento-sync-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .module-ui .magento-sync-toolbar__env {
    align-items: stretch;
  }

  .module-ui .magento-env-toggle {
    width: 100%;
  }

  .module-ui .magento-env-toggle__btn {
    flex: 1 1 50%;
    text-align: center;
  }

  .module-ui .magento-sync-toolbar__sync,
  .module-ui .magento-sync-toolbar__log {
    width: 100%;
  }
}

.module-ui .env-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.module-ui .env-badge.is-dev {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.module-ui .env-badge.is-prod {
  background: var(--bs-orange);
  border: none;
}

.module-ui .last-run-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--bs-radius);
  font-size: 0.8rem;
  white-space: nowrap;
}

.module-ui .last-run-chip .material-icons {
  font-size: 16px;
}

.module-ui .last-run-chip--loading .material-icons {
  animation: bs-preloader-spin 1s linear infinite;
}

.module-ui .last-run-chip--ok {
  background: rgba(40, 167, 69, 0.25);
}

.module-ui .last-run-chip--next {
  background: rgba(255, 255, 255, 0.22);
}

.module-ui .last-run-chip--error {
  background: rgba(255, 193, 7, 0.3);
}

.module-ui .module-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.module-ui .module-kpis--row3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.module-ui .module-kpis--row4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-ui .products-stats {
  margin-bottom: 1.5rem;
  overflow: visible;
}

@media (max-width: 991px) {
  .module-ui .module-kpis--row3,
  .module-ui .module-kpis--row4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .module-ui .module-kpis--row3,
  .module-ui .module-kpis--row4 {
    grid-template-columns: 1fr;
  }
}

.module-ui .kpi-card {
  background: var(--bs-card);
  border: 1px solid var(--bs-border);
  border-radius: var(--bs-radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--bs-shadow);
  border-top: 3px solid var(--bs-teal);
  transition: box-shadow 0.15s ease;
}

.module-ui .kpi-card:hover {
  box-shadow: 0 4px 12px rgba(10, 76, 162, 0.12);
}

.module-ui .kpi-card--primary { border-top-color: var(--bs-blue); }
.module-ui .kpi-card--success { border-top-color: var(--bs-success); }
.module-ui .kpi-card--warning { border-top-color: var(--bs-warning); }
.module-ui .kpi-card--danger { border-top-color: var(--bs-danger); }
.module-ui .kpi-card--info { border-top-color: var(--bs-teal); }

.module-ui .kpi-card__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bs-muted);
  margin: 0 0 0.25rem;
}

.module-ui .kpi-card__value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--bs-text);
  line-height: 1.2;
  margin: 0;
}

.module-ui .kpi-card__hint {
  font-size: 0.72rem;
  color: var(--bs-muted);
  margin: 0.35rem 0 0;
}

.module-ui .kpi-card--danger .kpi-card__value {
  color: var(--bs-danger);
}

.module-ui .kpi-card--wide {
  grid-column: 1 / -1;
}

.module-ui .kpi-card--vendors {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-bottom: 0;
  overflow: visible;
}

.module-ui .vendor-kpi-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.55rem;
  margin-top: 0.45rem;
  overflow: visible;
}

.module-ui .vendor-kpi-list.kpi-loading {
  color: var(--bs-muted);
  animation: module-ui-pulse 1.2s ease-in-out infinite;
}

.module-ui .vendor-kpi-row {
  position: relative;
  display: block;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f4f7fb;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.module-ui .vendor-kpi-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  z-index: 40;
  width: max-content;
  max-width: 17.5rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(10, 76, 162, 0.18);
  background: #0f2744;
  color: #f4f7fb;
  box-shadow: 0 10px 28px rgba(15, 39, 68, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  text-align: left;
  white-space: normal;
}

.module-ui .vendor-kpi-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #0f2744;
}

.module-ui .vendor-kpi-row:hover .vendor-kpi-tip,
.module-ui .vendor-kpi-row:focus .vendor-kpi-tip,
.module-ui .vendor-kpi-row:focus-visible .vendor-kpi-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.module-ui .vendor-kpi-tip__title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.15rem;
}

.module-ui .vendor-kpi-tip__sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(244, 247, 251, 0.65);
  margin-bottom: 0.45rem;
  word-break: break-all;
}

.module-ui .vendor-kpi-tip__section {
  display: block;
  margin-top: 0.45rem;
  margin-bottom: 0.15rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(244, 247, 251, 0.55);
}

.module-ui .vendor-kpi-tip__row {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(244, 247, 251, 0.92);
}

.module-ui .vendor-kpi-tip__row strong {
  color: #fff;
  font-weight: 700;
}

.module-ui .vendor-kpi-tip__hint {
  display: block;
  margin-top: 0.55rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(244, 247, 251, 0.12);
  font-size: 0.68rem;
  color: #8ec5ff;
  font-weight: 600;
}

/* Evitar que el tip del primer/último proveedor se corte */
.module-ui .vendor-kpi-row:first-child .vendor-kpi-tip {
  left: 0;
  transform: translate(0, 4px);
}

.module-ui .vendor-kpi-row:first-child:hover .vendor-kpi-tip,
.module-ui .vendor-kpi-row:first-child:focus .vendor-kpi-tip,
.module-ui .vendor-kpi-row:first-child:focus-visible .vendor-kpi-tip {
  transform: translate(0, 0);
}

.module-ui .vendor-kpi-row:first-child .vendor-kpi-tip::after {
  left: 1.25rem;
  margin-left: 0;
}

.module-ui .vendor-kpi-row:last-child .vendor-kpi-tip {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.module-ui .vendor-kpi-row:last-child:hover .vendor-kpi-tip,
.module-ui .vendor-kpi-row:last-child:focus .vendor-kpi-tip,
.module-ui .vendor-kpi-row:last-child:focus-visible .vendor-kpi-tip {
  transform: translate(0, 0);
}

.module-ui .vendor-kpi-row:last-child .vendor-kpi-tip::after {
  left: auto;
  right: 1.25rem;
  margin-left: 0;
}

.module-ui .vendor-kpi-row:hover {
  background: #eaf1fa;
  border-color: rgba(10, 76, 162, 0.18);
}

.module-ui .vendor-kpi-row.is-active {
  background: #e3edf9;
  border-color: var(--bs-blue);
  box-shadow: inset 0 3px 0 0 var(--bs-blue);
}

.module-ui .vendor-kpi-row__top {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.module-ui .vendor-kpi-row__name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--bs-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-ui .vendor-kpi-row__total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bs-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.module-ui .vendor-kpi-row__bar {
  position: relative;
  display: block;
  height: 4px;
  margin: 0.4rem 0 0.2rem;
  border-radius: 99px;
  overflow: hidden;
}

.module-ui .vendor-kpi-row__bar--stock {
  background: rgba(245, 158, 11, 0.22);
}

.module-ui .vendor-kpi-row__bar--magento {
  margin-top: 0.35rem;
  background: rgba(242, 99, 34, 0.18);
}

.module-ui .vendor-kpi-row__bar-stock {
  display: block;
  height: 100%;
  background: var(--bs-success);
  border-radius: 99px;
}

.module-ui .vendor-kpi-row__bar-magento {
  display: block;
  height: 100%;
  background: #f26322;
  border-radius: 99px;
}

.module-ui .vendor-kpi-row__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 0.5rem;
  font-size: 0.68rem;
  color: var(--bs-muted);
  font-variant-numeric: tabular-nums;
}

.module-ui .vendor-kpi-row__meta--magento {
  margin-bottom: 0;
}

.module-ui .vendor-kpi-row__meta-ok {
  color: var(--bs-success);
  font-weight: 600;
}

.module-ui .vendor-kpi-row__meta-share {
  font-weight: 600;
}

.module-ui .vendor-kpi-row__meta-magento {
  color: #f26322;
  font-weight: 700;
}

.module-ui .vendor-kpi-row__meta-magento-share {
  font-weight: 600;
  color: #c24e1a;
}

.module-ui .vendor-filter-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: -0.5rem 0 1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(10, 76, 162, 0.2);
  border-radius: var(--bs-radius);
  background: #eef4fb;
  color: var(--bs-text);
  font-size: 0.85rem;
}

.module-ui .vendor-filter-hint__clear {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--bs-blue);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.module-ui .vendor-filter-hint__clear:hover {
  color: #083a7a;
}

.module-ui .lang-badges .badge {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 4px 4px 0;
}

.module-ui .module-panel {
  background: var(--bs-card);
  border: 1px solid var(--bs-border);
  border-radius: var(--bs-radius);
  box-shadow: var(--bs-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.module-ui .module-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bs-border);
  background: #fafbfc;
}

.module-ui .module-panel__head h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bs-blue);
}

.module-ui .module-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.module-ui .module-filters .btn-filter {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--bs-border);
  border-radius: 999px;
  background: #fff;
  color: var(--bs-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.module-ui .module-filters .btn-filter:hover {
  border-color: var(--bs-teal);
  color: var(--bs-blue);
}

.module-ui .module-filters .btn-filter.active {
  background: var(--bs-blue);
  border-color: var(--bs-blue);
  color: #fff;
}

.module-ui .module-panel__body {
  padding: 0 1rem 1rem;
}

.module-ui .module-panel__body .table-responsive {
  margin-top: 0.5rem;
}

.module-ui .module-panel table {
  font-size: 0.82rem;
}

.module-ui .module-panel thead th {
  background: #f0f4f8;
  color: var(--bs-blue) !important;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--bs-border);
  white-space: nowrap;
  padding: 0.65rem 0.5rem;
}

.module-ui .module-panel tbody td {
  vertical-align: middle;
  padding: 0.5rem;
  border-color: var(--bs-border);
  color: var(--bs-text);
}

.module-ui .module-panel tbody tr:hover {
  background-color: #f8fafc;
}

/* Oferta ganadora (misma lógica que magento.py / merger) */
.module-ui .module-panel tbody tr.is-winning-offer {
  background-color: #eef7f0;
  box-shadow: inset 3px 0 0 var(--bs-success);
}

.module-ui .module-panel tbody tr.is-winning-offer:hover {
  background-color: #e4f2e7;
}

.module-ui .winning-offer-tick {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
  color: var(--bs-success);
}

/* Columna icono Magento: centrado horizontal/vertical */
.module-ui .module-panel #table_products th.col-magento,
.module-ui .module-panel #table_products td.col-magento {
  text-align: center !important;
  vertical-align: middle;
  width: 48px;
  min-width: 48px;
  max-width: 56px;
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

.module-ui .module-panel #table_products th.col-magento .magento-icon,
.module-ui .module-panel #table_products td.col-magento .magento-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  vertical-align: middle;
}

.module-ui .cell-ref {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bs-teal-dark);
}

/* Agrupación visual por misma referencia / varios proveedores */
.module-ui .module-panel #table_products tbody tr.ref-group--alt:not(.is-winning-offer) {
  background-color: #f3f7fc;
}

.module-ui .module-panel #table_products tbody tr.ref-group--alt:not(.is-winning-offer):hover {
  background-color: #eaf1f9;
}

.module-ui .module-panel #table_products tbody tr.ref-group--first,
.module-ui .module-panel #table_products tbody tr.ref-group--middle,
.module-ui .module-panel #table_products tbody tr.ref-group--last {
  box-shadow: inset 3px 0 0 rgba(10, 76, 162, 0.45);
}

.module-ui .module-panel #table_products tbody tr.ref-group--first.is-winning-offer,
.module-ui .module-panel #table_products tbody tr.ref-group--middle.is-winning-offer,
.module-ui .module-panel #table_products tbody tr.ref-group--last.is-winning-offer {
  box-shadow: inset 3px 0 0 var(--bs-success);
}

.module-ui .module-panel #table_products tbody tr.ref-group--first td {
  border-top: 2px solid rgba(10, 76, 162, 0.16);
}

.module-ui .module-panel #table_products tbody tr.ref-group--last td {
  border-bottom: 2px solid rgba(10, 76, 162, 0.12);
}

.module-ui .module-panel #table_products tbody tr.ref-group--middle td,
.module-ui .module-panel #table_products tbody tr.ref-group--last td {
  border-top-color: transparent;
}

.module-ui .cell-ref-col {
  min-width: 8.5rem;
}

.module-ui .ref-group-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(10, 76, 162, 0.12);
  color: var(--bs-blue);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

.module-ui .cell-ref--cont {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--bs-muted);
}

.module-ui .cell-ref--cont .material-icons {
  font-size: 16px;
  color: rgba(10, 76, 162, 0.55);
}

.module-ui .cell-ref__muted {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--bs-muted);
}

.module-ui .cell-product {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-ui .cell-sku {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  color: var(--bs-muted);
}

.module-ui .stock-cell--mismatch {
  color: var(--bs-danger);
  font-weight: 700;
}

.module-ui .stock-cell--match {
  font-weight: 700;
  color: var(--bs-success);
}

.module-ui .kpi-card__value.kpi-loading,
.module-ui .lang-badges.kpi-loading {
  color: var(--bs-muted);
  animation: module-ui-pulse 1.2s ease-in-out infinite;
}

.module-ui .stock-loading {
  color: var(--bs-teal);
  animation: module-ui-pulse 1.2s ease-in-out infinite;
}

@keyframes module-ui-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.module-ui .ui-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.module-ui .ui-badge--success {
  background: #e8f5e9;
  color: var(--bs-success);
}

.module-ui .ui-badge--info {
  background: #e3f2fd;
  color: var(--bs-blue-light);
}

.module-ui .ui-badge--error {
  background: #ffebee;
  color: var(--bs-danger);
}

.module-ui .ui-badge--warning {
  background: #fff3e0;
  color: var(--bs-warning);
}

.module-ui .btn-json {
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--bs-border);
  border-radius: 4px;
  background: #fff;
  color: var(--bs-muted);
  cursor: pointer;
}

.module-ui .btn-json:hover {
  border-color: var(--bs-teal);
  color: var(--bs-blue);
}

.module-ui .cell-detail {
  max-width: 160px;
  font-size: 0.78rem;
  color: var(--bs-muted);
}

.module-ui .empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--bs-muted);
  background: var(--bs-card);
  border: 1px solid var(--bs-border);
  border-radius: var(--bs-radius);
  margin-bottom: 1.5rem;
}

.module-ui .empty-state .material-icons {
  font-size: 48px;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
}

.module-ui .alert-barcodesite {
  border-radius: var(--bs-radius);
  border-left: 4px solid var(--bs-warning);
}

.module-ui .json-modal pre {
  max-height: 60vh;
  overflow: auto;
  font-size: 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--bs-radius);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

#magento_log_modal.modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

#magento_log_modal.modal.fade .magento-log-modal__dialog {
  transform: none;
}

#magento_log_modal.modal.show .magento-log-modal__dialog {
  transform: none;
  margin: 0 auto;
}

.module-ui .magento-log-modal__dialog {
  max-width: min(1100px, 96vw);
  width: 100%;
  margin: 0 auto;
}

.module-ui .magento-log-modal .modal-content {
  overflow: hidden;
  background: #0b1220;
  border: 1px solid #1e293b;
}

.module-ui .magento-log-modal .modal-header {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #111827;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
}

.module-ui .magento-log-modal .modal-title {
  color: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
}

.module-ui .magento-log-modal .modal-header .close {
  color: #94a3b8;
  text-shadow: none;
  opacity: 0.85;
}

.module-ui .magento-log-modal .modal-header .close:hover {
  color: #f8fafc;
  opacity: 1;
}

.module-ui .magento-log-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.module-ui .magento-log-modal__actions .close {
  margin: 0;
  padding: 0.25rem;
}

.module-ui .magento-log-modal .modal-body {
  padding: 0 !important;
  background: #0b1220;
}

.module-ui .magento-log-live-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: #fff;
  background: #16a34a;
  animation: magento-log-pulse 1.4s ease-in-out infinite;
}

@keyframes magento-log-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.module-ui .magento-log-follow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.module-ui .magento-log-follow input {
  margin: 0;
}

.module-ui .magento-log-modal #btn_magento_log_refresh {
  border-color: #334155;
  color: #cbd5e1;
  padding: 0.15rem 0.4rem;
  line-height: 1;
}

.module-ui .magento-log-modal #btn_magento_log_refresh:hover {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

.module-ui .magento-log-pre {
  display: block;
  margin: 0;
  min-height: 55vh;
  max-height: 70vh;
  overflow: auto;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  background: #0b1220;
  color: #cbd5e1;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: #334155 #0b1220;
}

.module-ui .magento-log-pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.module-ui .magento-log-pre::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 6px;
}

.module-ui .magento-log-level {
  font-weight: 700;
}

.module-ui .magento-log-level--debug {
  color: #94a3b8;
}

.module-ui .magento-log-level--info {
  color: #38bdf8;
}

.module-ui .magento-log-level--warning {
  color: #fbbf24;
}

.module-ui .magento-log-level--error {
  color: #f87171;
}

.module-ui .magento-log-ts {
  color: #64748b;
}

.module-ui .magento-log-modal__footer {
  justify-content: flex-start;
  padding: 0.45rem 1rem;
  background: #111827;
  border-top: 1px solid #1e293b;
}

.module-ui .magento-log-modal__footer .text-muted {
  color: #94a3b8 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
}

.module-ui .dataTables_wrapper .dataTables_length,
.module-ui .dataTables_wrapper .dataTables_filter,
.module-ui .dataTables_wrapper .dataTables_info,
.module-ui .dataTables_wrapper .dataTables_paginate {
  font-size: 0.8rem;
  color: var(--bs-muted);
  padding-top: 0.75rem;
}

.module-ui .dataTables_wrapper .page-item.active .page-link {
  background-color: var(--bs-blue);
  border-color: var(--bs-blue);
}

.module-ui .dataTables_wrapper div.dataTables_processing {
  border-color: var(--bs-border);
  box-shadow: var(--bs-shadow);
}

.module-ui .dataTables_wrapper .bs-dt-loader__label {
  color: var(--bs-blue);
}
