/* ═══════════════════════════════════════════════════════════════
   MÓDULO PRODUCTOS v2 — Catálogo Profesional con SKU y Navegación
   Apéndice a styles1.css
═══════════════════════════════════════════════════════════════ */

/* ── Contenedor principal de tarjetas / marcas ────────────────── */
.catalogo-cards {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 20px !important;
  margin-top: 14px;
}

/* ── Barra de Chips / Pills de Marcas (Acceso Rápido) ─────────── */
.catalogo-brand-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin: 4px 0 12px;
  scrollbar-width: thin;
}
.catalogo-brand-pills-bar::-webkit-scrollbar {
  height: 5px;
}
.catalogo-brand-pills-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.catalogo-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #cbd5e1);
  color: var(--ink, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.catalogo-brand-pill:hover {
  border-color: var(--primary, #059669);
  color: var(--primary, #059669);
  background: color-mix(in srgb, var(--primary, #059669) 8%, #ffffff);
}
.catalogo-brand-pill.active {
  background: var(--primary, #059669) !important;
  border-color: var(--primary, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary, #059669) 40%, transparent);
}
.catalogo-brand-pill .pill-count {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(0,0,0,0.07);
}
.catalogo-brand-pill.active .pill-count {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}
html.dark .catalogo-brand-pill {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}
html.dark .catalogo-brand-pill:hover {
  border-color: var(--primary, #10b981);
  color: #f8fafc;
}
html.dark .catalogo-brand-pill.active {
  background: var(--primary, #059669) !important;
  color: #ffffff !important;
}

/* ── Barra de Control y Resumen de Catálogo ───────────────────── */
.catalogo-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.catalogo-summary-text {
  font-size: 13px;
  color: var(--muted, #64748b);
}
.catalogo-summary-text strong {
  color: var(--ink, #0f172a);
}
html.dark .catalogo-summary-text {
  color: #94a3b8;
}
html.dark .catalogo-summary-text strong {
  color: #f8fafc;
}
.catalogo-accordion-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.catalogo-view-toggle {
  display: inline-flex;
  background: var(--surface-alt, #f1f5f9);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
html.dark .catalogo-view-toggle {
  background: #1e293b;
  border-color: #334155;
}
.btn-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-view-toggle:hover {
  color: var(--ink, #0f172a);
}
.btn-view-toggle.active {
  background: var(--surface, #ffffff);
  color: var(--primary, #059669);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
html.dark .btn-view-toggle {
  color: #94a3b8;
}
html.dark .btn-view-toggle:hover {
  color: #f8fafc;
}
html.dark .btn-view-toggle.active {
  background: #0f172a;
  color: #10b981;
}

/* ── Grupo por Marca (Tarjeta contenedor al 100% ancho) ────────── */
.catalogo-marca-group {
  width: 100%;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 16px 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}
html.dark .catalogo-marca-group {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.catalogo-marca-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary, #059669);
  user-select: none;
  cursor: pointer;
}
.catalogo-marca-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.catalogo-marca-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
html.dark .catalogo-marca-title {
  color: #f8fafc;
}
.catalogo-marca-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--primary, #059669) 12%, transparent);
  color: var(--primary, #059669);
}
.catalogo-marca-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.catalogo-marca-toggle-btn:hover {
  background: var(--surface-alt, #f1f5f9);
  color: var(--ink, #0f172a);
}
html.dark .catalogo-marca-toggle-btn {
  border-color: #475569;
  color: #94a3b8;
}
html.dark .catalogo-marca-toggle-btn:hover {
  background: #334155;
  color: #f8fafc;
}

.catalogo-cards-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)) !important;
  gap: 16px !important;
  width: 100%;
}

/* ── Tarjeta de producto ──────────────────────────────────────── */
.catalogo-card {
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #ffffff);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.catalogo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: color-mix(in srgb, var(--primary, #059669) 50%, var(--border, #e2e8f0));
}
html.dark .catalogo-card {
  background: #0f172a;
  border-color: #334155;
}
html.dark .catalogo-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border-color: var(--primary, #10b981);
}

.catalogo-media-preview {
  width: 100%;
  height: 155px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
html.dark .catalogo-media-preview {
  background: #090d16;
  border-bottom-color: #334155;
}
.catalogo-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain !important;
  display: block;
  margin: auto;
  transition: transform 0.25s ease;
}
.catalogo-card:hover .catalogo-card-img {
  transform: scale(1.05);
}
.catalogo-media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted, #94a3b8);
  font-size: 11px;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.015);
}
.catalogo-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.catalogo-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}
html.dark .catalogo-card-title {
  color: #f8fafc;
}
.catalogo-card-subtitle {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin: 0;
}
html.dark .catalogo-card-subtitle {
  color: #94a3b8;
}
.catalogo-card-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.catalogo-card-actions .btn-secondary,
.catalogo-card-actions .btn-danger,
.catalogo-card-actions .btn-soft {
  flex: 1;
  text-align: center;
  justify-content: center;
  padding: 5px 8px;
  font-size: 11px;
  min-width: 0;
}

/* ── Vista de Tabla Compacta de Catálogo ──────────────────────── */
.catalogo-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--surface, #ffffff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
html.dark .catalogo-table-wrap {
  background: #1e293b;
  border-color: #334155;
}
.catalogo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.catalogo-table th {
  padding: 10px 14px;
  background: var(--surface-alt, #f8fafc);
  color: var(--muted, #64748b);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
html.dark .catalogo-table th {
  background: #0f172a;
  color: #94a3b8;
  border-bottom-color: #334155;
}
.catalogo-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
}
html.dark .catalogo-table td {
  border-bottom-color: #334155;
}
.catalogo-table tr:hover td {
  background: color-mix(in srgb, var(--primary, #059669) 4%, transparent);
}
.catalogo-table-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}
html.dark .catalogo-table-thumb {
  background: #090d16;
  border-color: #334155;
}
.catalogo-table-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
}

/* ── SKU badge ────────────────────────────────────────────────── */
.catalogo-sku {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary, #1a73e8);
  background: color-mix(in srgb, var(--primary, #1a73e8) 10%, transparent);
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 2px;
  align-self: flex-start;
}

/* ── Stock / Inventario badges ───────────────────────────────── */
.stock-cantidad-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 4px;
}
.stock-cantidad-badge.stock-ingreso {
  background: color-mix(in srgb, #16a34a 12%, transparent);
  color: #166534;
}
.stock-cantidad-badge.stock-egreso {
  background: color-mix(in srgb, #dc2626 12%, transparent);
  color: #991b1b;
}
.stock-cantidad-badge:not(.stock-ingreso):not(.stock-egreso) {
  background: color-mix(in srgb, var(--primary, #1a73e8) 10%, transparent);
  color: var(--primary, #1a73e8);
}
html.dark .stock-cantidad-badge.stock-ingreso  { background: rgba(22,163,74,.2);  color: #86efac; }
html.dark .stock-cantidad-badge.stock-egreso   { background: rgba(220,38,38,.2);  color: #fca5a5; }

/* ── Detalles de series (collapsible) ───────────────────────── */
.stock-series-detail {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #888);
}
.stock-series-detail summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stock-series-detail summary::before {
  content: '▶';
  font-size: 10px;
  transition: transform .15s;
}
.stock-series-detail[open] summary::before { transform: rotate(90deg); }

/* ── Tablas simples (historico) ──────────────────────────────── */
.simple-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.simple-table th,
.simple-table td {
  padding: 6px 10px;
  border: 1px solid var(--border, #e2e2e2);
  text-align: left;
  vertical-align: top;
}
.simple-table thead th {
  background: var(--surface-alt, #f4f4f4);
  font-weight: 700;
  white-space: nowrap;
}

/* ── KPI mini (historial) ────────────────────────────────────── */
.kpi-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface-alt, #f4f4f4);
  border-radius: 10px;
  padding: 10px 20px;
  min-width: 100px;
}
.kpi-mini-val   { font-size: 24px; font-weight: 800; color: var(--primary, #1a73e8); }
.kpi-mini-label { font-size: 11px; color: var(--muted, #888); text-align: center; }

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .catalogo-cards-row {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .catalogo-media-preview { height: 110px; }
}


/* ═══════════════════════════════════════════════════════════════
   MÓDULO MARCAS v2 — UI Moderna, Métricas y Análisis Comercial
   Exclusivo para SUDOADMIN, GERENTE, CONTABILIDAD, ADMINISTRATIVO
═══════════════════════════════════════════════════════════════ */

/* ── Resumen de KPIs en encabezado de Marcas e Inventario ── */
.marcas-kpi-summary,
.inventario-kpi-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card-exec {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card-exec:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.kpi-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-card-icon.blue   { background: #eff6ff; color: #2563eb; }
.kpi-card-icon.green  { background: #f0fdf4; color: #16a34a; }
.kpi-card-icon.amber  { background: #fffbeb; color: #d97706; }
.kpi-card-icon.purple { background: #faf5ff; color: #9333ea; }
.kpi-card-icon.teal   { background: #f0fdfa; color: #0d9488; }
.kpi-card-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kpi-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #64748b);
  font-weight: 600;
  white-space: nowrap;
}
.kpi-card-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  line-height: 1.2;
  margin-top: 2px;
}
.kpi-card-sub {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}

/* ── Grid de Marcas Moderno ──────────────────────────────── */
.marcas-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.marca-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.marca-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}
.marca-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.marca-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.marca-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}
.marca-title-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.marca-nombre {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marca-subtext {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}
.marca-sku-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 6px;
  padding: 3px 8px;
  border: 1px solid #bfdbfe;
  flex-shrink: 0;
}

/* ── Panel Financiero de la Marca ────────────────────────── */
.marca-finanzas-box {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.marca-fin-item {
  display: flex;
  flex-direction: column;
}
.marca-fin-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.4px;
}
.marca-fin-val {
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}
.marca-fin-val.compra { color: #047857; }
.marca-fin-val.venta  { color: #1d4ed8; }
.marca-fin-val.stock  { color: #0f172a; }
.marca-fin-sub {
  font-size: 10px;
  color: #94a3b8;
}

.marca-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

/* ── Badges de Rotación en Inventario ─────────────────────── */
.badge-rotacion {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: auto;
}
.badge-rotacion-top {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}
.badge-rotacion-activa {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-rotacion-cero {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ── Desglose Financiero por SKU (Compra VS Venta) ────────── */
.inv-financial-summary {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 11px;
}
.inv-fin-col {
  display: flex;
  flex-direction: column;
}
.inv-fin-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}
.inv-fin-val {
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
}
.inv-fin-val.text-green { color: #16a34a; }
.inv-fin-val.text-blue  { color: #2563eb; }
.inv-fin-val.text-red   { color: #dc2626; }
.inv-fin-sub {
  font-size: 10px;
  color: #94a3b8;
}

/* ── Previsualización de Imágenes en Modales ──────────────── */
.catalogo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f1f5f9;
}

/* ── Modal de Detalle de Marca (Tablas Ejecutivas) ────────── */
.marca-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.marca-detail-table th {
  background: var(--surface-alt, #f1f5f9);
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.marca-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.marca-detail-table tr:hover td {
  background: rgba(241,245,249,0.5);
}


/* ── Rediseño Profesional de Inventario General (Escalabilidad 100+ Marcas / 1000+ SKUs) ── */
.inv-view-toggle {
  display: inline-flex;
  background: var(--surface-alt, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.inv-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.inv-toggle-btn:hover {
  color: #0f172a;
}
.inv-toggle-btn.active {
  background: #ffffff;
  color: var(--primary, #1a73e8);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
html.dark .inv-view-toggle {
  background: #1e293b;
  border-color: #334155;
}
html.dark .inv-toggle-btn {
  color: #94a3b8;
}
html.dark .inv-toggle-btn.active {
  background: #0f172a;
  color: #60a5fa;
}

.inv-counter-pill {
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 5px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
html.dark .inv-counter-pill {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

/* ── Vista Tabla Ejecutiva ────────────────────────────────── */
.inventario-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
html.dark .inventario-table-wrapper {
  background: #0f172a;
  border-color: #1e293b;
}

.inventario-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 13px;
}
.inventario-table th {
  background: #f8fafc;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
html.dark .inventario-table th {
  background: #1e293b;
  color: #cbd5e1;
  border-bottom-color: #334155;
}
.inventario-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
html.dark .inventario-table td {
  border-bottom-color: #1e293b;
}
.inventario-table tbody tr:hover td {
  background: rgba(248,250,252,0.85);
}
html.dark .inventario-table tbody tr:hover td {
  background: rgba(30,41,59,0.5);
}
.inventario-table tfoot td {
  background: #f8fafc;
  font-weight: 700;
  padding: 12px;
  border-top: 2px solid #e2e8f0;
  color: #1e293b;
}
html.dark .inventario-table tfoot td {
  background: #1e293b;
  border-top-color: #334155;
  color: #f1f5f9;
}

/* ── Elementos de Celda ───────────────────────────────────── */
.inv-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.inv-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.inv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.inv-thumb-empty {
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.inv-sku-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-block;
  white-space: nowrap;
}
html.dark .inv-sku-chip {
  background: rgba(29,78,216,0.18);
  color: #93c5fd;
  border-color: rgba(147,197,253,0.3);
}

.inv-brand-pill {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
html.dark .inv-brand-pill {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

.inv-stock-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.inv-stock-tag.in-stock {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.inv-stock-tag.zero-stock {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.inv-stock-tag.egresado-tag {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.inv-stock-tag.total-tag {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}
html.dark .inv-stock-tag.in-stock {
  background: rgba(22,163,74,0.2);
  color: #86efac;
  border-color: rgba(134,239,172,0.3);
}
html.dark .inv-stock-tag.zero-stock {
  background: rgba(100,116,139,0.18);
  color: #94a3b8;
  border-color: rgba(148,163,184,0.3);
}
html.dark .inv-stock-tag.egresado-tag {
  background: rgba(37,99,235,0.2);
  color: #93c5fd;
  border-color: rgba(147,197,253,0.3);
}
html.dark .inv-stock-tag.total-tag {
  background: rgba(148,163,184,0.15);
  color: #e2e8f0;
  border-color: rgba(148,163,184,0.25);
}

.inv-mov-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 3px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #475569;
  white-space: nowrap;
}
html.dark .inv-mov-tag {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.inv-margin-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}
.inv-margin-tag.positive {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.inv-margin-tag.negative {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.inv-margin-tag.neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
html.dark .inv-margin-tag.positive {
  background: rgba(4,120,87,0.2);
  color: #6ee7b7;
  border-color: rgba(110,231,183,0.3);
}
html.dark .inv-margin-tag.negative {
  background: rgba(185,28,28,0.2);
  color: #fca5a5;
  border-color: rgba(252,165,165,0.3);
}

/* ── Vista Cuadrícula Limpia (Grid Unificado) ─────────────── */
.inventario-grid-clean {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.inventario-clean-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.inventario-clean-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.07);
  border-color: #cbd5e1;
}
html.dark .inventario-clean-card {
  background: #0f172a;
  border-color: #1e293b;
}
html.dark .inventario-clean-card:hover {
  border-color: #334155;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.inventario-clean-card-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}
html.dark .inventario-clean-card-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

.inventario-clean-card-img {
  width: 100%;
  height: 140px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
  cursor: pointer;
}
html.dark .inventario-clean-card-img {
  background: #0b1329;
}
.inventario-clean-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.inventario-clean-card-img:hover img {
  transform: scale(1.05);
}

.inventario-clean-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.inventario-clean-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
html.dark .inventario-clean-card-title {
  color: #f1f5f9;
}
.inventario-clean-card-sub {
  margin: 0;
  font-size: 11px;
  color: #64748b;
}
html.dark .inventario-clean-card-sub {
  color: #94a3b8;
}

.inventario-clean-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
html.dark .inventario-clean-card-actions {
  border-top-color: #1e293b;
}

/* ── Modal de Series de Producto ──────────────────────────── */
.inv-series-section {
  margin-bottom: 14px;
}
.inv-series-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.inv-series-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
html.dark .inv-series-chips-grid {
  background: #1e293b;
  border-color: #334155;
}
.inv-series-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
html.dark .inv-series-chip {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}
.inv-series-chip.stock {
  border-left: 3px solid #16a34a;
}
.inv-series-chip.egreso {
  border-left: 3px solid #64748b;
  opacity: 0.85;
}
