@import url("./inventario.buttons.css");
@import url("./inventario.modals.css");

/* =========================================================
   WIRTZ HUB · RECURSOS · INVENTARIO
   Stock operativo · depósitos · ML Full · kits · reposición
   Premium black · minimalista · sin scroll horizontal
   ========================================================= */

.inventory-page {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  min-height: calc(100vh - var(--topbar-height) - 44px);
  animation: fadeUp 0.2s ease both;
}

/* =========================================================
   HEADER COMPACTO
   ========================================================= */

.inventory-head {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
}

html[data-theme="dark"] .inventory-head {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(8, 8, 8, 0.94);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 42px rgba(0, 0, 0, 0.38);
}

.inventory-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inventory-brand__icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text-strong);
}

html[data-theme="dark"] .inventory-brand__icon {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.92);
}

.inventory-brand__icon .icon {
  width: 15px;
  height: 15px;
}

.inventory-brand h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.055em;
}

.inventory-brand p {
  margin: 2px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 760;
  line-height: 1.25;
}

html[data-theme="dark"] .inventory-brand h2 {
  color: rgba(255, 255, 255, 0.93);
}

html[data-theme="dark"] .inventory-brand p {
  color: rgba(255, 255, 255, 0.48);
}

.inventory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

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

.inventory-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-solid);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

html[data-theme="dark"] .inventory-metrics {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(8, 8, 8, 0.94);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 34px rgba(0, 0, 0, 0.34);
}

.inventory-metric {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 46px;
  padding: 7px 8px;
  border-right: 1px solid var(--line);
}

.inventory-metric:last-child {
  border-right: 0;
}

html[data-theme="dark"] .inventory-metric {
  border-right-color: rgba(255, 255, 255, 0.09);
}

.inventory-metric span {
  color: var(--muted);
  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.085em;
  line-height: 1;
  text-transform: uppercase;
}

.inventory-metric strong {
  color: var(--text-strong);
  font-size: 14.5px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.06em;
}

.inventory-metric small {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 820;
  line-height: 1;
}

html[data-theme="dark"] .inventory-metric span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .inventory-metric strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .inventory-metric small {
  color: rgba(255, 255, 255, 0.36);
}

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

.inventory-panel,
.inventory-flow {
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
}

html[data-theme="dark"] .inventory-panel,
html[data-theme="dark"] .inventory-flow {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(8, 8, 8, 0.94);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 42px rgba(0, 0, 0, 0.36);
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .inventory-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.inventory-title {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.inventory-title span {
  color: var(--muted);
  font-size: 7.4px;
  font-weight: 950;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.inventory-title strong {
  color: var(--text-strong);
  font-size: 11.5px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

html[data-theme="dark"] .inventory-title span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .inventory-title strong {
  color: rgba(255, 255, 255, 0.92);
}

/* =========================================================
   FILTROS
   ========================================================= */

.inventory-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}

.inventory-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(390px, 100%);
  min-width: 240px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--muted);
  transition:
    background var(--transition),
    border-color var(--transition);
}

.inventory-search:focus-within {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

html[data-theme="dark"] .inventory-search {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.52);
}

html[data-theme="dark"] .inventory-search:focus-within {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
}

.inventory-search .icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.inventory-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  outline: none;
  font-size: 9px;
  font-weight: 780;
}

.inventory-search input::placeholder {
  color: var(--muted-2);
}

html[data-theme="dark"] .inventory-search input {
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .inventory-search input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.inventory-filters select {
  height: 28px;
  min-width: 96px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--text-strong);
  outline: none;
  font-size: 8.5px;
  font-weight: 850;
}

html[data-theme="dark"] .inventory-filters select {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.88);
}

/* =========================================================
   SELECCIÓN MASIVA
   ========================================================= */

.inventory-bulk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 0;
  max-height: 0;
  padding: 0 7px;
  border-bottom: 0 solid transparent;
  background: color-mix(in srgb, var(--text-strong) 3%, transparent);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  transition:
    max-height var(--transition),
    min-height var(--transition),
    padding var(--transition),
    opacity var(--transition),
    transform var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.inventory-bulk.is-active {
  min-height: 38px;
  max-height: 74px;
  padding: 6px 7px;
  border-bottom: 1px solid var(--line);
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

html[data-theme="dark"] .inventory-bulk {
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .inventory-bulk.is-active {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.inventory-bulk__info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--text-strong);
  white-space: nowrap;
}

.inventory-bulk__info .icon {
  width: 12px;
  height: 12px;
  min-width: 12px;
  color: var(--success);
}

.inventory-bulk__info strong {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.inventory-bulk__info span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .inventory-bulk__info {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .inventory-bulk__info .icon {
  color: #4ade80;
}

html[data-theme="dark"] .inventory-bulk__info strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .inventory-bulk__info span {
  color: rgba(255, 255, 255, 0.48);
}

.inventory-bulk__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.inventory-bulk__actions .inventory-btn {
  min-height: 26px;
  padding: 0 7px;
  font-size: 7.8px;
}

.inventory-bulk__actions .inventory-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.inventory-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
}

.inventory-table tbody tr.is-selected:hover {
  background: color-mix(in srgb, var(--yellow) 17%, transparent);
}

html[data-theme="dark"] .inventory-table tbody tr.is-selected {
  background: rgba(250, 226, 50, 0.095);
}

html[data-theme="dark"] .inventory-table tbody tr.is-selected:hover {
  background: rgba(250, 226, 50, 0.135);
}

.inventory-check input,
.inventory-th.inventory-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--yellow);
  cursor: pointer;
}

.inventory-th.inventory-check input {
  vertical-align: middle;
}

.inventory-check input:focus-visible,
.inventory-th.inventory-check input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--yellow) 52%, transparent);
  outline-offset: 2px;
}

/* =========================================================
   TABLA · SIN BARRA HORIZONTAL
   ========================================================= */

.inventory-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.inventory-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
  background: var(--panel-solid);
}

html[data-theme="dark"] .inventory-table {
  background: rgba(8, 8, 8, 0.94);
}

.inventory-table th,
.inventory-table td {
  position: relative;
  height: 31px;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 7px;
  border-right: 0 !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none !important;
  color: var(--text);
  font-size: 8.3px;
  font-weight: 720;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html[data-theme="dark"] .inventory-table th,
html[data-theme="dark"] .inventory-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  overflow: visible !important;
  background: var(--panel-solid);
  color: var(--muted);
  font-size: 6.8px;
  font-weight: 950;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

html[data-theme="dark"] .inventory-table th {
  background: rgba(8, 8, 8, 0.98);
  color: rgba(255, 255, 255, 0.46);
}

.inventory-table th:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  transform: translateY(-50%);
}

.inventory-table td:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.09);
  transform: translateY(-50%);
}

html[data-theme="dark"] .inventory-table th:not(:last-child)::after {
  background: rgba(255, 255, 255, 0.17);
}

html[data-theme="dark"] .inventory-table td:not(:last-child)::after {
  background: rgba(255, 255, 255, 0.1);
}

.inventory-table tbody tr {
  transition:
    background var(--transition),
    color var(--transition);
}

.inventory-table tbody tr:hover {
  background: var(--panel-hover);
}

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

.inventory-table strong {
  color: var(--text-strong);
  font-weight: 920;
}

html[data-theme="dark"] .inventory-table strong {
  color: rgba(255, 255, 255, 0.88);
}

/* =========================================================
   COLUMNAS · ANCHOS BASE
   ========================================================= */

.inventory-table th:nth-child(1),
.inventory-table td:nth-child(1) {
  width: 3% !important;
}

.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
  width: 6% !important;
}

.inventory-table th:nth-child(3),
.inventory-table td:nth-child(3) {
  width: 7% !important;
}

.inventory-table th:nth-child(4),
.inventory-table td:nth-child(4) {
  width: 17% !important;
}

.inventory-table th:nth-child(5),
.inventory-table td:nth-child(5) {
  width: 8% !important;
}

.inventory-table th:nth-child(6),
.inventory-table td:nth-child(6) {
  width: 5% !important;
  text-align: right !important;
}

.inventory-table th:nth-child(7),
.inventory-table td:nth-child(7) {
  width: 7% !important;
}

.inventory-table th:nth-child(8),
.inventory-table td:nth-child(8) {
  width: 8% !important;
}

.inventory-table th:nth-child(9),
.inventory-table td:nth-child(9) {
  width: 6% !important;
  text-align: right !important;
}

.inventory-table th:nth-child(10),
.inventory-table td:nth-child(10) {
  width: 6% !important;
  text-align: right !important;
}

.inventory-table th:nth-child(11),
.inventory-table td:nth-child(11) {
  width: 5% !important;
  text-align: center !important;
}

.inventory-table th:nth-child(12),
.inventory-table td:nth-child(12),
.inventory-table th:nth-child(13),
.inventory-table td:nth-child(13),
.inventory-table th:nth-child(14),
.inventory-table td:nth-child(14),
.inventory-table th:nth-child(15),
.inventory-table td:nth-child(15) {
  width: 5.5% !important;
  text-align: right !important;
}

.inventory-table th:nth-child(16),
.inventory-table td:nth-child(16) {
  width: 8% !important;
}

.inventory-table th:nth-child(17),
.inventory-table td:nth-child(17) {
  width: 7% !important;
}

.inventory-table th:nth-child(18),
.inventory-table td:nth-child(18) {
  width: 7% !important;
  text-align: center !important;
}

/* =========================================================
   HEADER ORDENABLE + RESIZE
   Requiere inventario.js actualizado
   ========================================================= */

.inventory-th {
  position: sticky;
  top: 0;
  z-index: 4;
  overflow: visible !important;
}

.inventory-th__sort {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: calc(100% - 7px);
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.inventory-th__sort:disabled {
  cursor: default;
}

.inventory-th__sort span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-th__sort .icon {
  width: 9px;
  height: 9px;
  min-width: 9px;
  color: var(--muted);
  opacity: 0.68;
}

.inventory-th.is-sorted .inventory-th__sort {
  color: var(--text-strong);
}

.inventory-th.is-sorted .inventory-th__sort .icon {
  color: var(--text-strong);
  opacity: 1;
}

html[data-theme="dark"] .inventory-th.is-sorted .inventory-th__sort {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .inventory-th.is-sorted .inventory-th__sort .icon {
  color: rgba(255, 255, 255, 0.92);
}

.inventory-th.is-right .inventory-th__sort {
  text-align: right;
}

.inventory-th.is-right .inventory-th__sort span {
  text-align: right;
}

.inventory-th.is-center .inventory-th__sort {
  justify-content: center;
  text-align: center;
}

.inventory-th.is-center .inventory-th__sort span {
  text-align: center;
}

.inventory-th__resize {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 8;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.inventory-th__resize::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 3px;
  width: 1px;
  height: calc(100% - 14px);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition:
    opacity var(--transition),
    background var(--transition);
}

.inventory-th:hover .inventory-th__resize::after,
body.is-resizing-inventory-column .inventory-th__resize::after {
  opacity: 1;
}

html[data-theme="dark"] .inventory-th__resize::after {
  background: rgba(255, 255, 255, 0.26);
}

body.is-resizing-inventory-column,
body.is-resizing-inventory-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* =========================================================
   SACAR MINI-CARDS / PASTILLAS
   SKU · Stock · Estado · Fabricación · Kit
   ========================================================= */

.inventory-code,
.inventory-stock,
.inventory-status,
.inventory-kit {
  display: inline !important;
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text-strong) !important;
  font-size: 8.3px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: -0.015em !important;
}

.inventory-stock::before,
.inventory-status::before,
.inventory-kit::before {
  display: none !important;
}

html[data-theme="dark"] .inventory-code,
html[data-theme="dark"] .inventory-stock,
html[data-theme="dark"] .inventory-status,
html[data-theme="dark"] .inventory-kit {
  color: rgba(255, 255, 255, 0.88) !important;
}

.inventory-code {
  color: var(--muted) !important;
  font-weight: 850 !important;
}

html[data-theme="dark"] .inventory-code {
  color: rgba(255, 255, 255, 0.56) !important;
}

.inventory-stock.is-ok {
  color: var(--success) !important;
}

.inventory-stock.is-low {
  color: var(--warning) !important;
}

.inventory-stock.is-zero {
  color: var(--danger) !important;
}

html[data-theme="dark"] .inventory-stock.is-ok {
  color: #4ade80 !important;
}

html[data-theme="dark"] .inventory-stock.is-low {
  color: #facc15 !important;
}

html[data-theme="dark"] .inventory-stock.is-zero {
  color: #f87171 !important;
}

.inventory-status.is-local,
.inventory-kit.is-no {
  color: var(--success) !important;
}

.inventory-status.is-importado,
.inventory-kit.is-yes {
  color: var(--warning) !important;
}

html[data-theme="dark"] .inventory-status.is-local,
html[data-theme="dark"] .inventory-kit.is-no {
  color: #4ade80 !important;
}

html[data-theme="dark"] .inventory-status.is-importado,
html[data-theme="dark"] .inventory-kit.is-yes {
  color: #facc15 !important;
}

/* =========================================================
   PRODUCTO / UBICACIÓN / NÚMEROS
   ========================================================= */

.inventory-product {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-strong);
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.inventory-location,
.inventory-number,
.inventory-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  color: var(--text-strong);
  font-weight: 860;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-location .icon,
.inventory-kind .icon {
  width: 10px;
  height: 10px;
  min-width: 10px;
  color: var(--muted);
}

.inventory-check {
  width: 34px;
  text-align: center !important;
}

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

.inventory-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
  white-space: nowrap;
}

.inventory-row-btn {
  width: 23px;
  height: 23px;
  min-width: 23px;
  border-radius: 7px;
}

.inventory-row-btn .icon {
  width: 10px;
  height: 10px;
}

/* =========================================================
   PAGINACIÓN
   ========================================================= */

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 7px;
  border-top: 1px solid var(--line);
}

html[data-theme="dark"] .inventory-pagination {
  border-top-color: rgba(255, 255, 255, 0.09);
}

.inventory-pagination strong {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

html[data-theme="dark"] .inventory-pagination strong {
  color: rgba(255, 255, 255, 0.46);
}

/* =========================================================
   HISTORIAL / FLUJO ABAJO
   ========================================================= */

.inventory-flow {
  align-content: start;
}

.inventory-flow__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .inventory-flow__head {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.inventory-flow__head span {
  color: var(--muted);
  font-size: 7.4px;
  font-weight: 950;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.inventory-flow__head strong {
  display: block;
  margin-top: 2px;
  color: var(--text-strong);
  font-size: 11.5px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.inventory-flow__head .icon {
  width: 14px;
  height: 14px;
  color: var(--text-strong);
}

.inventory-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-event {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  min-height: 62px;
  padding: 8px;
  border-right: 1px solid var(--line);
}

.inventory-event:last-child {
  border-right: 0;
}

html[data-theme="dark"] .inventory-event {
  border-right-color: rgba(255, 255, 255, 0.09);
}

.inventory-event__icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text-strong);
}

html[data-theme="dark"] .inventory-event__icon {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.88);
}

.inventory-event__icon .icon {
  width: 12px;
  height: 12px;
}

.inventory-event__body {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.inventory-event__body strong {
  color: var(--text-strong);
  font-size: 9px;
  font-weight: 950;
  line-height: 1.1;
}

.inventory-event__body p {
  margin: 0;
  color: var(--muted);
  font-size: 7.8px;
  font-weight: 760;
  line-height: 1.3;
}

.inventory-event__body small {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 850;
  line-height: 1;
}

html[data-theme="dark"] .inventory-event__body strong {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .inventory-event__body p {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .inventory-event__body small {
  color: rgba(255, 255, 255, 0.36);
}

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

.inventory-import-help {
  display: grid;
  gap: 4px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.inventory-import-help strong {
  color: var(--text-strong);
  font-size: 8.5px;
  font-weight: 950;
  line-height: 1;
}

.inventory-import-help p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 760;
  line-height: 1.35;
}

/* =========================================================
   MODALES OPERATIVOS NUEVOS
   ========================================================= */

.inventory-action-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.inventory-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-solid);
}

.inventory-action-row:last-child {
  border-bottom: 0;
}

.inventory-action-row strong {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
}

.inventory-action-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 780;
  line-height: 1.35;
}

.inventory-action-row__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.inventory-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inventory-tool-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 156px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
}

.inventory-tool-card > .icon {
  width: 18px;
  height: 18px;
  color: var(--danger);
}

.inventory-tool-card strong {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
}

.inventory-tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 780;
  line-height: 1.35;
}

.inventory-tool-card .inventory-btn {
  align-self: end;
  width: 100%;
  margin-top: auto;
}

/* =========================================================
   AUDITORÍA DESCUENTOS
   ========================================================= */

.inventory-audit-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 440px;
}

.inventory-audit-list {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.inventory-audit-detail {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 10px;
  overflow: auto;
}

.inventory-mini-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.inventory-mini-head span {
  color: var(--danger);
  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.inventory-mini-head span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
  vertical-align: middle;
}

.inventory-mini-head strong {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.inventory-audit-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 52px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.inventory-audit-item:hover {
  background: var(--panel-hover);
}

.inventory-audit-item strong {
  color: var(--text-strong);
  font-size: 9.5px;
  font-weight: 950;
  line-height: 1.2;
}

.inventory-audit-item span {
  color: var(--muted);
  font-size: 7.8px;
  font-weight: 800;
  line-height: 1.2;
}

.inventory-audit-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.inventory-audit-metrics article {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.inventory-audit-metrics article:last-child {
  border-right: 0;
}

.inventory-audit-metrics span {
  color: var(--danger);
  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.inventory-audit-metrics strong {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

/* =========================================================
   REMITOS
   ========================================================= */

.inventory-remito-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.inventory-remito-types article,
.inventory-remito-types button {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.inventory-remito-types article.is-selected,
.inventory-remito-types button.is-selected {
  border-color: var(--text-strong);
  background: var(--text-strong);
}

.inventory-remito-types strong {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.inventory-remito-types p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 780;
  line-height: 1.35;
}

.inventory-remito-types article.is-selected strong,
.inventory-remito-types button.is-selected strong {
  color: var(--white);
}

.inventory-remito-types article.is-selected p,
.inventory-remito-types button.is-selected p {
  color: rgba(255, 255, 255, 0.68);
}

html[data-theme="dark"] .inventory-remito-types article.is-selected strong,
html[data-theme="dark"] .inventory-remito-types button.is-selected strong {
  color: #090b10;
}

html[data-theme="dark"] .inventory-remito-types article.is-selected p,
html[data-theme="dark"] .inventory-remito-types button.is-selected p {
  color: rgba(9, 11, 16, 0.66);
}

/* =========================================================
   BASE DE DATOS / ZONA CRÍTICA
   ========================================================= */

.inventory-critical-zone {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(230, 0, 0, 0.25);
  border-radius: 12px;
  background: rgba(230, 0, 0, 0.035);
  opacity: 0.65;
  pointer-events: none;
  transition:
    opacity var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.inventory-critical-zone.is-enabled {
  opacity: 1;
  pointer-events: auto;
  border-color: rgba(230, 0, 0, 0.45);
  background: rgba(230, 0, 0, 0.055);
}

.inventory-critical-zone__head {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.inventory-critical-zone__head .icon {
  width: 18px;
  height: 18px;
  color: var(--danger);
}

.inventory-critical-zone__head strong {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.inventory-critical-zone__head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 780;
  line-height: 1.35;
}

.inventory-db-status {
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
}

/* =========================================================
   TOAST
   ========================================================= */

.inventory-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 250;
  max-width: min(360px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--text-strong);
  color: var(--white);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--transition),
    transform var(--transition);
}

.inventory-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

html[data-theme="dark"] .inventory-toast {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.9);
  color: #090b10;
}

/* =========================================================
   RESPONSIVE · SIN BARRAS HORIZONTALES
   ========================================================= */

@media (max-width: 1380px) {
  .inventory-head {
    grid-template-columns: 1fr;
  }

  .inventory-actions {
    justify-content: flex-start;
  }

  .inventory-toolbar {
    grid-template-columns: 1fr;
  }

  .inventory-filters {
    justify-content: flex-start;
  }

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

  .inventory-event:nth-child(2n) {
    border-right: 0;
  }

  .inventory-event:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

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

  .inventory-metric:nth-child(3n) {
    border-right: 0;
  }

  .inventory-metric:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .inventory-audit-layout {
    grid-template-columns: 1fr;
  }

  .inventory-audit-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 220px;
  }

  .inventory-tools-grid {
    grid-template-columns: 1fr;
  }

  .inventory-table th,
  .inventory-table td {
    padding-left: 5px;
    padding-right: 6px;
    font-size: 7.5px;
  }

  .inventory-table th {
    font-size: 6px;
  }

  .inventory-location .icon,
  .inventory-th__sort .icon {
    display: none;
  }
}

@media (max-width: 760px) {
  .inventory-pagination {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inventory-pagination .inventory-btn {
    width: 100%;
  }

  .inventory-action-row {
    grid-template-columns: 1fr;
  }

  .inventory-action-row__buttons {
    justify-content: stretch;
  }

  .inventory-action-row__buttons .inventory-btn {
    width: 100%;
  }

  .inventory-audit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-audit-metrics article:nth-child(2n) {
    border-right: 0;
  }

  .inventory-audit-metrics article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .inventory-remito-types {
    grid-template-columns: 1fr;
  }

  .inventory-table th,
  .inventory-table td {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 6.8px;
  }

  .inventory-table th {
    font-size: 5.4px;
    letter-spacing: 0.045em;
  }

  .inventory-row-btn {
    width: 21px;
    height: 21px;
    min-width: 21px;
  }

  .inventory-bulk.is-active {
    grid-template-columns: 1fr;
    max-height: 130px;
  }

  .inventory-bulk__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .inventory-page {
    gap: 6px;
  }

  .inventory-actions,
  .inventory-filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .inventory-search {
    width: 100%;
    min-width: 0;
  }

  .inventory-btn,
  .inventory-filters select {
    width: 100%;
  }

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

  .inventory-metric {
    border-right: 1px solid var(--line);
    border-top: 1px solid var(--line);
  }

  .inventory-metric:nth-child(1),
  .inventory-metric:nth-child(2) {
    border-top: 0;
  }

  .inventory-metric:nth-child(2n) {
    border-right: 0;
  }

  .inventory-timeline {
    grid-template-columns: 1fr;
  }

  .inventory-event {
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .inventory-event:first-child {
    border-top: 0;
  }

  .inventory-brand {
    align-items: flex-start;
  }

  .inventory-brand p {
    display: none;
  }

  .inventory-audit-metrics {
    grid-template-columns: 1fr;
  }

  .inventory-audit-metrics article {
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .inventory-audit-metrics article:first-child {
    border-top: 0;
  }

  .inventory-bulk.is-active {
    min-height: 0;
    max-height: 220px;
    padding: 7px;
  }

  .inventory-bulk__actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .inventory-bulk__actions .inventory-btn {
    width: 100%;
  }

  .inventory-table th:nth-child(5),
  .inventory-table td:nth-child(5),
  .inventory-table th:nth-child(6),
  .inventory-table td:nth-child(6),
  .inventory-table th:nth-child(7),
  .inventory-table td:nth-child(7),
  .inventory-table th:nth-child(15),
  .inventory-table td:nth-child(15),
  .inventory-table th:nth-child(16),
  .inventory-table td:nth-child(16) {
    display: none !important;
  }

  .inventory-table th:nth-child(1),
  .inventory-table td:nth-child(1) {
    width: 4% !important;
  }

  .inventory-table th:nth-child(2),
  .inventory-table td:nth-child(2) {
    width: 10% !important;
  }

  .inventory-table th:nth-child(3),
  .inventory-table td:nth-child(3) {
    width: 10% !important;
  }

  .inventory-table th:nth-child(4),
  .inventory-table td:nth-child(4) {
    width: 24% !important;
  }

  .inventory-table th:nth-child(8),
  .inventory-table td:nth-child(8) {
    width: 12% !important;
  }

  .inventory-table th:nth-child(9),
  .inventory-table td:nth-child(9),
  .inventory-table th:nth-child(10),
  .inventory-table td:nth-child(10),
  .inventory-table th:nth-child(11),
  .inventory-table td:nth-child(11),
  .inventory-table th:nth-child(12),
  .inventory-table td:nth-child(12),
  .inventory-table th:nth-child(13),
  .inventory-table td:nth-child(13),
  .inventory-table th:nth-child(14),
  .inventory-table td:nth-child(14) {
    width: 7% !important;
  }

  .inventory-table th:nth-child(17),
  .inventory-table td:nth-child(17) {
    width: 10% !important;
  }

  .inventory-table th:nth-child(18),
  .inventory-table td:nth-child(18) {
    width: 9% !important;
  }
}