/* ====================================================================
   SISTEMA WEB DE GESTIÓN DE INVENTARIO - UNIMINUTO
   ESTILOS NEUMÓRFICOS MODERNOS - PALETA MORADO / FUCSIA / FONDO OSCURO
   ==================================================================== */

:root {
  /* MODO OSCURO (POR DEFECTO) */
  --bg-app: #12111a;
  --bg-sidebar: #171523;
  --bg-card: #1c1a2c;
  --bg-card-subtle: #242138;
  --bg-card-hover: #292640;
  --border-card: rgba(255, 255, 255, 0.07);
  --border-card-glow: rgba(186, 68, 255, 0.25);
  
  /* NEUMORPHIC SHADOWS (DARK) */
  --neu-shadow-outer: 6px 6px 16px rgba(0, 0, 0, 0.5), -4px -4px 12px rgba(255, 255, 255, 0.02);
  --neu-shadow-inset: inset 3px 3px 6px rgba(0, 0, 0, 0.6), inset -2px -2px 5px rgba(255, 255, 255, 0.03);
  --neu-glow-fuchsia: 0 0 20px rgba(236, 72, 153, 0.35);
  --neu-glow-purple: 0 0 25px rgba(168, 85, 247, 0.35);
  
  /* COLORES DE IDENTIDAD (MORADO & FUCSIA) */
  --primary-purple: #8b5cf6;
  --primary-purple-dark: #6d28d9;
  --primary-fuchsia: #d946ef;
  --primary-fuchsia-bright: #f0abfc;
  --accent-cyan: #06b6d4;
  --accent-cyan-dark: #0e7490;
  --accent-yellow: #facc15;
  --accent-green: #22c55e;
  --accent-red: #ef4444;

  /* TEXTOS Y CONTRASTES */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #e879f9;

  /* BORDES Y RADIOS */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* DIMENSIONES SIDEBAR */
  --sidebar-collapsed-w: 80px;
  --sidebar-expanded-w: 260px;

  /* TRANSICIONES */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PALETA MODO CLARO */
[data-theme="light"] {
  --bg-app: #f1f2f8;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8f9fe;
  --bg-card-hover: #f3f0fa;
  --border-card: rgba(139, 92, 246, 0.12);
  --border-card-glow: rgba(217, 70, 239, 0.25);

  --neu-shadow-outer: 6px 6px 18px rgba(148, 163, 184, 0.25), -4px -4px 14px #ffffff;
  --neu-shadow-inset: inset 2px 2px 5px rgba(148, 163, 184, 0.3), inset -2px -2px 5px #ffffff;
  --neu-glow-fuchsia: 0 4px 15px rgba(217, 70, 239, 0.2);
  --neu-glow-purple: 0 4px 15px rgba(139, 92, 246, 0.2);

  --primary-purple: #7c3aed;
  --primary-purple-dark: #5b21b6;
  --primary-fuchsia: #c026d3;
  --primary-fuchsia-bright: #a21caf;
  
  --text-primary: #1e1b2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-accent: #9333ea;
}

/* REINICIO GENERAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}

/* LAYOUT PRINCIPAL */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* GESTIÓN DE VISTAS (SPA - SINGLE PAGE APP) */
.view-panel {
  display: none;
  animation: fadeInView 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-panel.active {
  display: block;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================================================
   BARRA LATERAL DESPLEGABLE (SIDEBAR ON HOVER)
   ==================================================================== */
.sidebar {
  width: var(--sidebar-collapsed-w);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  z-index: 100;
  transition: width var(--transition-smooth), background-color var(--transition-smooth), border-color var(--transition-smooth);
  overflow-x: hidden;
  white-space: nowrap;
}

.sidebar:hover {
  width: var(--sidebar-expanded-w);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4), var(--neu-glow-purple);
}

.sidebar-top {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-card);
}

.user-profile-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.user-avatar-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--neu-glow-fuchsia);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.user-avatar-btn:hover {
  transform: scale(1.05);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
  pointer-events: none;
  flex-grow: 1;
}

.user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.btn-add-user {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--primary-fuchsia-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-fast);
  margin-left: auto;
}

.btn-add-user:hover {
  background: var(--primary-fuchsia);
  color: #ffffff;
  box-shadow: var(--neu-glow-fuchsia);
  transform: scale(1.05);
}

.sidebar:hover .user-info-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar:hover .btn-add-user {
  opacity: 1;
  transform: scale(1);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
  padding: 0 4px;
}

.nav-icon-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-label {
  font-size: 0.92rem;
  font-weight: 600;
  margin-left: 12px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth), color var(--transition-fast);
  pointer-events: none;
}

.sidebar:hover .nav-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-subtle);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(217, 70, 239, 0.4));
  border: 1px solid rgba(217, 70, 239, 0.5);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.35);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--primary-fuchsia);
  box-shadow: 0 0 10px var(--primary-fuchsia);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-card);
}

.nav-item-logout {
  color: var(--accent-red);
}

.logout-icon-box {
  color: var(--accent-red);
}

.nav-item-logout:hover {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ff6b6b;
}

/* ====================================================================
   CONTENEDOR PRINCIPAL Y HEADER
   ==================================================================== */
.main-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  max-width: 1700px;
  margin: 0 auto;
  width: calc(100% - var(--sidebar-collapsed-w));
  gap: 24px;
  transition: width var(--transition-smooth);
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-card);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, #ffd000, #ff8c00);
  color: #12111a;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.8px;
  box-shadow: 0 4px 12px rgba(255, 166, 0, 0.25);
}

.system-title {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* BOTONES DE INTEGRACIÓN WOOCOMMERCE & MERCADO LIBRE */
.marketplace-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-marketplace {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  box-shadow: var(--neu-shadow-outer);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.btn-marketplace:hover {
  transform: translateY(-2px);
  border-color: var(--border-card-glow);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn-marketplace:active {
  transform: translateY(1px);
  box-shadow: var(--neu-shadow-inset);
}

.market-logo-wrapper {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.market-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.market-fallback-svg {
  width: 22px;
  height: 22px;
}

.market-logo-wrapper.woo {
  background: linear-gradient(135deg, #7f54b3, #96588a);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(150, 88, 138, 0.4);
}

.market-logo-wrapper.meli {
  background: linear-gradient(135deg, #ffe600, #f5d000);
  color: #2d3277;
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.3);
}

.market-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.market-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.market-status {
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.market-status.connected .dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--accent-green);
}

.sync-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.6s ease;
}

.btn-marketplace:hover .sync-icon {
  transform: rotate(180deg);
  color: var(--primary-fuchsia);
}

/* ====================================================================
   ESTRUCTURA DEL CONTENIDO: DASHBOARD CORE & ASIDE DERECHO
   ==================================================================== */
.content-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

.dashboard-core {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* CABECERA TITULO Y SWITCH CIRCULAR DE TEMA */
.title-and-theme {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-title {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 40%, var(--primary-fuchsia-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

[data-theme="light"] .main-title {
  background: linear-gradient(135deg, #2e1065, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* BOTÓN CIRCULAR INTERRUPTOR (TEMA CLARO / OSCURO) */
.theme-toggle-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border-card-glow);
  background: var(--bg-card);
  box-shadow: var(--neu-shadow-outer);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--neu-glow-purple);
}

.toggle-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b285f, #702670);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-smooth);
  position: relative;
}

[data-theme="light"] .toggle-circle {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #1e1b2e;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
}

.icon-moon, .icon-sun {
  position: absolute;
  transition: all var(--transition-smooth);
}

.icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ====================================================================
   BOTONES DE ACCIÓN RÁPIDA (BOCETO)
   ==================================================================== */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.action-card-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  box-shadow: var(--neu-shadow-outer);
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.action-card-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.action-card-btn:hover {
  transform: translateY(-3px);
}

.action-card-btn:active {
  transform: translateY(1px);
  box-shadow: var(--neu-shadow-inset);
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-texts {
  display: flex;
  flex-direction: column;
}

.btn-main-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.btn-sub-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-arrow {
  color: var(--text-muted);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.action-card-btn:hover .btn-arrow {
  transform: translate(3px, -2px);
  color: var(--text-primary);
}

.btn-secondary-glow {
  border-color: rgba(139, 92, 246, 0.3);
}
.btn-secondary-glow .btn-icon-wrapper {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(168, 85, 247, 0.15));
  color: var(--primary-purple);
  box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.3);
}
.btn-secondary-glow:hover {
  border-color: var(--primary-purple);
  box-shadow: var(--neu-glow-purple);
}

.btn-primary-fuchsia {
  border-color: rgba(217, 70, 239, 0.4);
}
.btn-primary-fuchsia .btn-icon-wrapper {
  background: linear-gradient(135deg, var(--primary-fuchsia), #be185d);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 70, 239, 0.4);
}
.btn-primary-fuchsia:hover {
  border-color: var(--primary-fuchsia);
  box-shadow: var(--neu-glow-fuchsia);
}

.btn-primary-cyan {
  border-color: rgba(6, 182, 212, 0.3);
}
.btn-primary-cyan .btn-icon-wrapper {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}
.btn-primary-cyan:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* ====================================================================
   TARJETAS DE MÉTRICAS (KPIS)
   ==================================================================== */
.neumorphic-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-shadow-outer);
  padding: 24px;
  position: relative;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.neumorphic-card:hover {
  border-color: var(--border-card-glow);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 175px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-tag i {
  width: 14px;
  height: 14px;
}

.metric-tag.info {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.metric-tag.highlight {
  background: rgba(217, 70, 239, 0.15);
  color: var(--primary-fuchsia);
  border: 1px solid rgba(217, 70, 239, 0.3);
}

.metric-tag.warning {
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.metric-tag.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.metric-value-container {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 16px 0;
}

.metric-number {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-primary);
}

.metric-number.fuchsia-text {
  color: var(--primary-fuchsia);
  text-shadow: 0 0 25px rgba(217, 70, 239, 0.4);
}

.metric-number.warning-text {
  color: var(--accent-yellow);
}

.metric-number.danger-text {
  color: var(--accent-red);
}

.metric-growth {
  font-size: 0.8rem;
  font-weight: 600;
}

.metric-growth.positive {
  color: var(--accent-green);
}

.metric-growth.warning-sub {
  color: var(--accent-yellow);
}

.metric-growth.danger-sub {
  color: var(--accent-red);
}

.card-footer-bar {
  width: 100%;
  height: 6px;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-glow {
  height: 100%;
  border-radius: var(--radius-full);
}

.progress-bar-glow.p-total {
  width: 78%;
  background: linear-gradient(90deg, var(--primary-purple), var(--primary-fuchsia));
  box-shadow: 0 0 8px var(--primary-fuchsia);
}

.progress-bar-glow.p-unidades {
  width: 92%;
  background: linear-gradient(90deg, var(--primary-fuchsia), #ec4899);
  box-shadow: 0 0 10px var(--primary-fuchsia);
}

/* INDICADOR VERTICAL DE NIVEL */
.metric-card.with-level-indicator {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
}

.metric-inner-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.vertical-level-indicator {
  width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  margin-left: 16px;
}

.level-track {
  width: 16px;
  height: 100%;
  background-color: var(--bg-card-subtle);
  border-radius: 12px;
  border: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  box-shadow: var(--neu-shadow-inset);
}

.level-fill {
  width: 100%;
  border-radius: 0 0 10px 10px;
  transition: height 0.8s ease-in-out;
}

.level-fill.warning-fill {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.level-fill.danger-fill {
  background: linear-gradient(180deg, var(--primary-fuchsia), #be185d);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.7);
}

/* ====================================================================
   PANEL INFERIOR DE ESTADO / ASISTENTE IA
   ==================================================================== */
.live-status-panel {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, rgba(28, 26, 44, 0.8), rgba(36, 33, 56, 0.8));
}

.live-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.fuchsia-icon {
  color: var(--primary-fuchsia);
}

.live-panel-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-pill {
  font-size: 0.78rem;
  padding: 6px 12px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill.active-pill {
  color: var(--text-primary);
  border-color: rgba(34, 197, 94, 0.3);
}

.pulse-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* ====================================================================
   PANEL DERECHO: "MÁS VENDIDOS"
   ==================================================================== */
.top-selling-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  position: sticky;
  top: 24px;
  padding: 22px 18px;
}

.top-selling-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-card);
}

.panel-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.filter-and-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--neu-shadow-inset);
}

.time-filter-pill i {
  width: 14px;
  height: 14px;
  color: var(--primary-fuchsia);
}

.btn-icon-more {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon-more:hover {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
}

.products-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-top: 14px;
  padding-right: 4px;
}

.products-list-scroll::-webkit-scrollbar {
  width: 5px;
}
.products-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.products-list-scroll::-webkit-scrollbar-thumb {
  background: var(--bg-card-subtle);
  border-radius: 10px;
}
.products-list-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--primary-purple);
}

.selling-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.selling-item:hover {
  background-color: var(--bg-card-subtle);
  border-color: var(--border-card);
  transform: translateX(4px);
}

.item-img-container {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--neu-shadow-outer);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
}

.item-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.placeholder-art i {
  width: 20px;
  height: 20px;
}

.art-purple { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.art-blue { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.art-fuchsia { background: linear-gradient(135deg, #a21caf, #d946ef); }
.art-cyan { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.art-yellow { background: linear-gradient(135deg, #b45309, #f59e0b); }
.art-pink { background: linear-gradient(135deg, #be185d, #ec4899); }
.art-violet { background: linear-gradient(135deg, #4c1d95, #7c3aed); }

.item-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.stat-views, .stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-views i, .stat-trend i {
  width: 13px;
  height: 13px;
}

.stat-trend.positive {
  color: var(--accent-green);
  font-weight: 600;
}

.stat-trend.high-trend {
  color: var(--primary-fuchsia);
  font-weight: 700;
}

/* ====================================================================
   VISTA DE CONFIGURACIÓN (PHPMYADMIN / SERVER)
   ==================================================================== */
.config-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.config-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.config-title-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* BOTÓN VOLVER AL MENÚ PRINCIPAL */
.btn-back-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  color: var(--primary-fuchsia-bright);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: var(--neu-shadow-outer);
  transition: all var(--transition-fast);
  width: fit-content;
  margin-bottom: 8px;
}

.btn-back-menu:hover {
  background: var(--bg-card-subtle);
  border-color: var(--primary-fuchsia);
  transform: translateX(-4px);
  box-shadow: var(--neu-glow-fuchsia);
}

.btn-back-menu i {
  width: 18px;
  height: 18px;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

/* GRILLA 50/50 PARA CONFIGURACIÓN */
.config-two-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.config-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.config-card .config-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meli-header-icon-box {
  background: rgba(255, 230, 0, 0.15);
  border: 1px solid rgba(255, 230, 0, 0.4);
  color: #ffe600;
  box-shadow: 0 0 16px rgba(255, 230, 0, 0.25);
}

.meli-connected-card {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(34, 197, 94, 0.1);
  border: 1.5px solid rgba(34, 197, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

/* CAJA DE TOKEN MANUAL ESTILIZADA */
.meli-manual-token-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-meli-token-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(217, 70, 239, 0.25));
  border: 1.5px solid var(--primary-fuchsia);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--neu-glow-fuchsia);
  transition: all var(--transition-fast);
}

.btn-meli-token-save:hover {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.5);
}

/* BOTONES DE LA BARRA INFERIOR DE MERCADO LIBRE */
.meli-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-card);
}

.btn-meli-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffe600 0%, #ffd000 100%);
  color: #111111;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 230, 0, 0.35);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-meli-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 230, 0, 0.55);
}

.btn-meli-primary i {
  color: #111111;
}

.config-card-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 20px;
}

.config-header-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.db-icon-box {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  color: #ffffff;
  box-shadow: var(--neu-glow-fuchsia);
}

.config-header-text {
  flex-grow: 1;
}

.config-header-text h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.config-header-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.env-pill-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-purple);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

/* FORMULARIO DE BASE DE DATOS */
.config-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.col-12 { flex: 0 0 100%; }
.col-8  { flex: 0 0 calc(66.666% - 10px); }
.col-6  { flex: 0 0 calc(50% - 10px); }
.col-4  { flex: 0 0 calc(33.333% - 10px); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group label i {
  width: 16px;
  height: 16px;
  color: var(--primary-fuchsia);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  box-shadow: var(--neu-shadow-inset);
  outline: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d946ef' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

[data-theme="light"] .form-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 10px;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary-fuchsia);
  box-shadow: var(--neu-shadow-inset), 0 0 12px rgba(217, 70, 239, 0.35);
}

.input-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-input {
  padding-right: 48px;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.btn-toggle-password:hover {
  color: var(--primary-fuchsia);
}

/* BOTONES DE ACCIÓN EN CONFIGURACIÓN */
.form-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border-card);
}

.btn-test-connection {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: var(--neu-shadow-outer);
  transition: all var(--transition-fast);
}

.btn-test-connection:hover {
  background: rgba(6, 182, 212, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.3);
}

.btn-save-config {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-fuchsia), var(--primary-purple-dark));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.4);
  transition: all var(--transition-fast);
}

.btn-save-config:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(217, 70, 239, 0.6);
}

/* SIDEBAR DE CONFIGURACIÓN */
.config-sidebar-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-mini-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mini-card-desc code {
  background: var(--bg-card-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-fuchsia-bright);
  font-size: 0.82rem;
}

.server-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border-card);
  border-bottom: 1px solid var(--border-card);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.check-item.done i {
  color: var(--accent-green);
  width: 16px;
  height: 16px;
}

.quick-nav-box {
  margin-top: 8px;
}

.btn-quick-back {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-quick-back:hover {
  background: var(--primary-purple);
  color: #ffffff;
  box-shadow: var(--neu-glow-purple);
}

/* ====================================================================
   MÓDULO DE PRODUCTOS: LAYOUT, BUSCADOR, FILTROS, TABLA Y DETALLE
   ==================================================================== */
.products-module-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.products-main-area {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.products-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
  flex-wrap: wrap;
  gap: 16px;
}

.products-title-box {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.title-text-group .main-title {
  font-size: 1.8rem;
  margin-bottom: 2px;
}

.title-text-group .subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* 1. BARRA SUPERIOR DE BÚSQUEDA Y FILTROS */
.products-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-shadow-outer);
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--primary-fuchsia);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: all var(--transition-fast);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.search-input-box:focus-within {
  border-color: var(--primary-fuchsia-bright);
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.35);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-fuchsia);
}

.search-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--primary-fuchsia-bright);
  white-space: nowrap;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
}

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

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.btn-clear-search:hover {
  color: var(--accent-red);
}

/* DROPDOWNS DE FILTRO POR CATEGORÍA Y SUBCATEGORÍA */
.filter-dropdown-wrapper {
  position: relative;
}

.btn-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--primary-fuchsia);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-filter-trigger:hover,
.btn-filter-trigger.active-filter {
  background: rgba(217, 70, 239, 0.15);
  border-color: var(--primary-fuchsia-bright);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.25);
}

.btn-filter-trigger.active-filter {
  color: var(--primary-fuchsia-bright);
}

.filter-icon {
  width: 16px;
  height: 16px;
  color: var(--primary-fuchsia);
}

.dropdown-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.filter-dropdown-wrapper.open .dropdown-chevron {
  transform: rotate(180deg);
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  max-height: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-card-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45), var(--neu-glow-purple);
  padding: 12px;
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(16px);
}

.filter-dropdown-wrapper.open .filter-dropdown-menu {
  display: flex;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 6px;
}

.btn-clear-filter-mini {
  background: transparent;
  border: none;
  color: var(--primary-fuchsia);
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-clear-filter-mini:hover {
  text-decoration: underline;
}

.dropdown-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 220px;
  padding-right: 4px;
}

.filter-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.filter-option-item:hover {
  background: var(--bg-card-hover);
}

.filter-option-item input[type="checkbox"] {
  accent-color: var(--primary-fuchsia);
  cursor: pointer;
  width: 15px;
  height: 15px;
}

/* BOTONES DE ICONO PARA FILTROS AVANZADOS Y RESET */
.btn-icon-filter {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-filter i {
  width: 18px;
  height: 18px;
}

.btn-icon-filter:hover {
  border-color: var(--primary-purple);
  color: var(--primary-fuchsia-bright);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.btn-reset-filter:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

/* TOOLTIPS FLOTANTES AL HACER HOVER */
.tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #171523;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  border: 1px solid var(--border-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
}

[data-theme="light"] .tooltip-text {
  background: #1e1b2e;
  color: #fff;
}

.btn-icon-filter:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* 2. TABLA DE PRODUCTOS */
.products-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-shadow-outer);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-scroll-wrapper {
  overflow-x: auto;
  max-height: 580px;
  overflow-y: auto;
}

.products-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  text-align: left;
}

.products-table th {
  position: sticky;
  top: 0;
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  padding: 13px 14px;
  border-bottom: 2px solid var(--border-card);
  z-index: 10;
  white-space: nowrap;
  user-select: none;
}

.products-table th.th-sortable {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.products-table th.th-sortable:hover {
  background: var(--bg-card-hover);
  color: var(--primary-fuchsia-bright);
}

.products-table th.th-sorted {
  color: var(--primary-fuchsia-bright);
  border-bottom-color: var(--primary-fuchsia);
  background: rgba(217, 70, 239, 0.08);
}

.th-sort-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.th-sort-icon {
  font-size: 0.75rem;
  opacity: 0.4;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.products-table th.th-sorted .th-sort-icon {
  opacity: 1;
  color: var(--primary-fuchsia-bright);
}

.products-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-primary);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

.products-table tbody tr {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.products-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.products-table tbody tr.selected-row {
  background: rgba(217, 70, 239, 0.12) !important;
  border-left: 3px solid var(--primary-fuchsia);
}

.products-table tbody tr.row-checked {
  background: rgba(139, 92, 246, 0.08);
}

/* COLUMNAS ESPECÍFICAS DE LA TABLA */
.th-checkbox, .td-checkbox {
  width: 44px;
  text-align: center;
}

.custom-checkbox {
  accent-color: var(--primary-fuchsia);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.sku-pill {
  display: inline-block;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-fuchsia-bright);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .sku-pill {
  color: var(--primary-purple-dark);
}

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.product-name-cell {
  font-weight: 600;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-badge-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
}

.stock-badge-table.normal {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.stock-badge-table.warning {
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.stock-badge-table.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.ubicacion-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.text-center {
  text-align: center;
}

/* PIE DE TABLA */
.table-footer-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-card);
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 10px;
}

.selected-badge {
  color: var(--primary-fuchsia-bright);
  font-weight: 700;
  margin-left: 6px;
}

.table-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.legend-dot.normal { background: var(--accent-green); }
.legend-dot.warning { background: var(--accent-yellow); }
.legend-dot.danger { background: var(--accent-red); }

/* 3. PANEL LATERAL DERECHO (ACCIONES Y DETALLE) */
.products-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-shadow-outer);
  position: sticky;
  top: 20px;
}

/* BOTÓN NUEVO PRODUCTO */
.btn-action-primary.btn-new-product {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.35);
  transition: all var(--transition-fast);
}

.btn-action-primary.btn-new-product:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(217, 70, 239, 0.5);
  border-color: #ffffff;
}

/* GRILLA DE ACCIONES SECUNDARIAS */
.secondary-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.span-two-cols {
  grid-column: span 2;
}

.btn-action-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action-ghost:hover {
  border-color: var(--primary-purple);
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary-fuchsia-bright);
}

.btn-action-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action-danger:hover {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.panel-divider {
  height: 1px;
  background: var(--border-card);
  margin: 4px 0;
}

/* TARJETA DE DETALLE DEL PRODUCTO SELECCIONADO */
.selected-product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* RECUADRO DE IMAGEN / PREVIEW */
.product-preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-card-subtle);
  border: 2px dashed var(--primary-purple);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.product-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}

.placeholder-icon {
  width: 44px;
  height: 44px;
  opacity: 0.5;
  color: var(--primary-purple);
}

#placeholderText {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.preview-floating-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.4);
  backdrop-filter: blur(8px);
}

/* CAMPOS DE DETALLE */
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.detail-value-box {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FILA SKU Y BOTÓN COPIAR */
.sku-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sku-display-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sku-value {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-fuchsia-bright);
}

[data-theme="light"] .sku-value {
  color: var(--primary-purple-dark);
}

.btn-copy-sku {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  border: 1.5px solid var(--primary-purple);
  color: var(--primary-fuchsia-bright);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-sku:hover {
  background: var(--primary-purple);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.btn-copy-sku i {
  width: 13px;
  height: 13px;
}

/* FILA DE STOCK Y BOTONES INTERRUPTORES FOT / VID */
.stock-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stock-display-box {
  flex: 1;
}

.stock-badge-large {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary-fuchsia);
  background: var(--bg-card-subtle);
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  min-width: 80px;
}

.toggle-indicators-column {
  display: flex;
  gap: 8px;
}

.toggle-status-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-card);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  gap: 3px;
  transition: all var(--transition-fast);
  user-select: none;
}

.toggle-status-btn i {
  width: 18px;
  height: 18px;
}

/* ESTADO ACTIVO (COLOR VIVO SEGÚN BOCETO) */
.toggle-status-btn.active-fot {
  border-color: var(--primary-fuchsia);
  background: rgba(217, 70, 239, 0.18);
  color: var(--primary-fuchsia-bright);
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.35);
}

.toggle-status-btn.active-vid {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.18);
  color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

/* ENLACES A MARKETPLACES (WOO & MERCADO LIBRE) */
.marketplace-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-market-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.market-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-brand img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.btn-action-clone {
  border-color: rgba(217, 70, 239, 0.4);
  background: rgba(217, 70, 239, 0.08);
}

.btn-action-clone:hover {
  border-color: var(--primary-fuchsia);
  background: rgba(217, 70, 239, 0.18);
  color: var(--primary-fuchsia-bright);
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.3);
}

.btn-market-woo:hover {
  border-color: #96588a;
  background: rgba(150, 88, 138, 0.15);
  color: #be7bc2;
  box-shadow: 0 0 14px rgba(150, 88, 138, 0.3);
}

.btn-market-meli:hover {
  border-color: #ffe600;
  background: rgba(255, 230, 0, 0.12);
  color: #ffe600;
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.3);
}

.btn-market-meli-edit {
  border-color: rgba(255, 230, 0, 0.35);
  background: rgba(255, 230, 0, 0.06);
}

.btn-market-meli-edit:hover {
  border-color: #ffe600;
  background: rgba(255, 230, 0, 0.16);
  color: #ffe600;
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.35);
}

.btn-market-link.disabled-market {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.btn-market-link.disabled-market:hover {
  border-color: var(--border-card);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  box-shadow: none;
}

/* RESPONSIVE PARA EL MÓDULO DE PRODUCTOS */
@media (max-width: 1100px) {
  .products-module-layout {
    grid-template-columns: 1fr;
  }
  .products-sidebar-panel {
    position: static;
  }
}

/* ====================================================================
   NOTIFICACIÓN TOAST FLOTANTE
   ==================================================================== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--primary-fuchsia);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--neu-glow-fuchsia);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999 !important;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--accent-green);
  display: flex;
  align-items: center;
}

/* ====================================================================
   RESPONSIVIDAD
   ==================================================================== */
@media (max-width: 1200px) {
  .content-body, .config-grid, .config-two-columns-grid {
    grid-template-columns: 1fr;
  }
  .top-selling-panel {
    height: auto;
    max-height: 480px;
    position: static;
  }
  .form-row {
    flex-direction: column;
    gap: 14px;
  }
  .col-8, .col-4, .col-6, .col-12 {
    flex: 0 0 100%;
  }
}

@media (max-width: 800px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: column;
    padding: 12px;
  }
  .sidebar:hover {
    width: 100%;
  }
  .sidebar-nav {
    flex-direction: column;
  }
  .main-container {
    width: 100%;
    padding: 16px;
  }
  .quick-actions-row {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .marketplace-actions {
    width: 100%;
    justify-content: space-between;
  }
  .form-actions-bar {
    flex-direction: column;
  }
  .btn-test-connection, .btn-save-config {
    width: 100%;
    justify-content: center;
  }
}

/* ====================================================================
   ESTILOS DE MODALES (CREAR / EDITAR PRODUCTO Y SUBMODALES)
   ==================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 8, 18, 0.78);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#modalSyncVentasMeli {
  z-index: 1050 !important;
}

#modalMotivoColorear {
  z-index: 1200 !important;
}

#modalInformeCambiosVenta {
  z-index: 1250 !important;
}

.sub-modal-overlay,
#modalQuickAddOverlay {
  z-index: 1350 !important;
  background: rgba(10, 8, 18, 0.88);
}

/* Cuando se abre el modal de producto desde el modal de compra */
#modalProductEditor.on-top-of-compra {
  z-index: 1250 !important;
}

#modalProductEditor.on-top-of-compra .modal-container-custom {
  max-height: 96vh;
}

#modalProductEditor.on-top-of-compra .modal-body-custom {
  max-height: calc(96vh - 130px);
  padding: 16px 20px;
  gap: 16px;
}

/* Modales de sincronización con Mercado Libre siempre por encima de cualquier otro modal */
#modalMeliStockSync {
  z-index: 1400 !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-container-custom {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card-glow);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), var(--neu-glow-fuchsia);
  overflow: hidden;
}

.modal-header-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-card-subtle);
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-title h2, .modal-header-title h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.modal-body-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 24px;
  overflow-y: auto;
  max-height: calc(92vh - 145px);
}

.modal-col-left, .modal-col-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 1. SECCIÓN DE IMAGEN CON BOTONES LATERALES */
.image-uploader-section {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 12px;
  align-items: stretch;
}

.modal-img-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-card-subtle);
  border: 2px dashed var(--primary-fuchsia);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}

.modal-icon-lg {
  width: 44px;
  height: 44px;
  color: var(--primary-purple);
  opacity: 0.6;
}

#modalImgPlaceholderText {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.image-actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-img-action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--primary-purple);
  color: var(--primary-fuchsia-bright);
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-img-action:hover {
  background: var(--primary-purple);
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.4);
}

.btn-img-action-danger {
  padding: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-img-action-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

/* 2. CAMPOS Y GRUPOS DEL FORMULARIO MODAL */
.form-group-modal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-modal label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group-modal label i {
  width: 15px;
  height: 15px;
  color: var(--primary-fuchsia);
}

.modal-textarea {
  resize: vertical;
  min-height: 56px;
}

/* SKU DISPLAY EN MODAL */
.sku-readonly-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sku-readonly-box input {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-fuchsia-bright);
  background: rgba(139, 92, 246, 0.1);
  border: 1.5px solid var(--primary-purple);
}

.btn-copy-sku-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--primary-fuchsia);
  color: var(--primary-fuchsia-bright);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-copy-sku-modal:hover {
  background: var(--primary-fuchsia);
  color: #fff;
}

/* INPUTS CON BOTÓN '+' PARA CREAR NUEVO */
.input-with-add-btn {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-add-btn select {
  flex: 1;
}

.btn-add-quick {
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--primary-purple);
  color: var(--primary-fuchsia-bright);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add-quick:hover {
  background: var(--primary-purple);
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* 3. SUB-TARJETAS PANEL DERECHO */
.sub-card-modal {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary-fuchsia-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-card-title i {
  width: 16px;
  height: 16px;
}

.form-row-compact {
  display: flex;
  gap: 12px;
}

.col-6 {
  flex: 1 1 50%;
}

/* STOCK CON BOTÓN DE AJUSTE */
.input-with-stock-btn {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-stock-btn input {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.btn-stock-adjust {
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: rgba(217, 70, 239, 0.15);
  border: 1.5px solid var(--primary-fuchsia);
  color: var(--primary-fuchsia-bright);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-stock-adjust:hover {
  background: var(--primary-fuchsia);
  color: #fff;
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.4);
}

/* FILAS DE PLATAFORMAS (MERCADO LIBRE, FALABELLA, ETC.) */
.platform-row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-card);
}

.platform-row-item:last-child {
  border-bottom: none;
}

.platform-info-box {
  width: 125px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.platform-mini-icon {
  width: 16px;
  height: 16px;
}

.platform-select {
  width: 95px !important;
  font-size: 0.8rem !important;
  padding: 6px 26px 6px 8px !important;
  background-position: right 6px center !important;
  background-size: 13px !important;
  font-weight: 700 !important;
  transition: all var(--transition-fast) !important;
}

/* Colores para Sí / Sí está (Verde) y No / No está (Rojo) */
.platform-select.select-status-yes,
.select-status-yes {
  background-color: rgba(34, 197, 94, 0.16) !important;
  border-color: rgba(34, 197, 94, 0.6) !important;
  color: #16a34a !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .platform-select.select-status-yes,
[data-theme="dark"] .select-status-yes {
  background-color: rgba(34, 197, 94, 0.2) !important;
  border-color: rgba(34, 197, 94, 0.75) !important;
  color: #4ade80 !important;
}

.platform-select.select-status-no,
.select-status-no {
  background-color: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.55) !important;
  color: #dc2626 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .platform-select.select-status-no,
[data-theme="dark"] .select-status-no {
  background-color: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  color: #f87171 !important;
}

/* Opciones individuales para los desplegables */
.platform-select option[value="1"],
.platform-select option[value="Si"] {
  background-color: #064e3b;
  color: #4ade80;
}

[data-theme="light"] .platform-select option[value="1"],
[data-theme="light"] .platform-select option[value="Si"] {
  background-color: #f0fdf4;
  color: #16a34a;
}

.platform-select option[value="0"],
.platform-select option[value="No"] {
  background-color: #450a0a;
  color: #f87171;
}

[data-theme="light"] .platform-select option[value="0"],
[data-theme="light"] .platform-select option[value="No"] {
  background-color: #fef2f2;
  color: #dc2626;
}

/* INDICADOR VISUAL DE CAMPOS SIN DATOS / VACÍOS EN EL MODAL */
.modal-field-empty {
  border-color: rgba(245, 158, 11, 0.6) !important;
  background-color: rgba(245, 158, 11, 0.04) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25) !important;
}

[data-theme="dark"] .modal-field-empty {
  border-color: rgba(251, 191, 36, 0.55) !important;
  background-color: rgba(251, 191, 36, 0.06) !important;
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.3) !important;
}

.modal-field-empty::placeholder {
  color: rgba(245, 158, 11, 0.75) !important;
  font-style: italic;
}

.platform-link-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.platform-link-wrapper.flex-grow {
  flex: 1;
}

/* ESTILOS PARA GESTIÓN DE PUBLICACIONES MERCADO LIBRE */
.btn-search-meli-api {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #ffe600 0%, #ffd000 100%);
  color: #111;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(255, 230, 0, 0.25);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-search-meli-api:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 230, 0, 0.4);
}

.meli-pub-slot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.pub-slot-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-secondary);
  width: 40px;
}

.pub-desc-wrapper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0 4px;
  gap: 2px;
}

.desc-percent-symbol {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-fuchsia);
}

.pub-desc-input {
  width: 48px !important;
  font-size: 0.78rem !important;
  padding: 4px 2px !important;
  text-align: center;
  border: none !important;
  background: transparent !important;
}

.pub-price-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  white-space: nowrap;
  min-width: 65px;
  text-align: right;
  font-family: var(--font-mono);
}

[data-theme="dark"] .pub-price-badge {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
}

.platform-url-input {
  font-size: 0.78rem !important;
  padding: 6px 8px !important;
}

.btn-go-platform {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-go-platform:hover {
  border-color: var(--primary-purple);
  color: var(--primary-fuchsia-bright);
}

/* CHECKBOXES MODAL */
.checkboxes-grid-modal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

/* PIE DEL MODAL */
.modal-footer-custom {
  grid-column: span 2;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-card);
}

.btn-action-cancel {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action-cancel:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-action-save {
  padding: 10px 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(217, 70, 239, 0.35);
  transition: all var(--transition-fast);
}

.btn-action-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(217, 70, 239, 0.5);
}

/* SUBMODALES (STOCK ADJUST Y QUICK ADD) */
.sub-modal-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card-glow);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.sub-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sub-modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.stock-adjust-display-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
}

.radio-pill-group {
  display: flex;
  gap: 10px;
}

.radio-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-pill.active {
  border-color: var(--primary-fuchsia);
  background: rgba(217, 70, 239, 0.15);
  color: var(--primary-fuchsia-bright);
}

.radio-pill input[type="radio"] {
  display: none;
}

.sku-counter-config-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 850px) {
  .modal-body-custom {
    grid-template-columns: 1fr;
  }
  .modal-footer-custom {
    grid-column: span 1;
  }
  .image-uploader-section {
    grid-template-columns: 1fr;
  }
  .image-actions-col {
    flex-direction: row;
  }
}

/* ====================================================================
   ESTILOS ESPECÍFICOS DEL MODAL DE FILTROS AVANZADOS (SEGÚN BOCETO)
   ==================================================================== */
.adv-filters-modal {
  max-width: 880px;
}

.adv-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adv-filter-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.15);
}

.adv-filter-card:hover {
  border-color: rgba(217, 70, 239, 0.4);
}

/* FILAS DE CONDICIONES NUMÉRICAS (COSTO, STOCK, SUGERIDO, TOTAL COMPRAR) */
.numeric-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.numeric-filter-row:last-child {
  border-bottom: none;
}

.numeric-label {
  width: 95px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.num-op-select {
  flex: 1 1 140px !important;
  font-size: 0.82rem !important;
  padding: 8px 30px 8px 10px !important;
}

.num-val-input {
  width: 90px !important;
  padding: 8px 10px !important;
  font-size: 0.85rem !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-align: center;
}

.num-val2 {
  border-color: var(--primary-fuchsia) !important;
}

/* INDICADOR ACTIVO EN BOTÓN DE FILTROS AVANZADOS */
.btn-icon-filter.active-filter-badge {
  border-color: var(--primary-fuchsia);
  background: rgba(217, 70, 239, 0.2);
  color: var(--primary-fuchsia-bright);
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.4);
}

.btn-icon-filter.active-filter-badge::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-fuchsia);
  box-shadow: 0 0 8px var(--primary-fuchsia);
}

/* ====================================================================
   BANNER DE ALERTA DE CONEXIÓN A BASE DE DATOS
   ==================================================================== */
.db-connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin: 0 0 20px 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(185, 28, 28, 0.28));
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #fff;
  animation: slideDownFade 0.35s ease-out;
  z-index: 50;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.db-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.db-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fca5a5;
  flex-shrink: 0;
}

.db-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.db-banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fecaca;
  letter-spacing: 0.3px;
}

.db-banner-desc {
  font-size: 0.85rem;
  color: #fca5a5;
  line-height: 1.35;
}

.db-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-banner-config {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: #ef4444;
  color: #fff;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transition: transform var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}

.btn-banner-config:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.btn-banner-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-banner-retry:hover {
  background: rgba(255, 255, 255, 0.2);
}

.status-pill.error-pill {
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.status-pill.error-pill .pulse-circle {
  background: #ef4444 !important;
  box-shadow: 0 0 10px #ef4444 !important;
}

/* ====================================================================
   MODAL EDITAR COLUMNAS (MODO CLARO Y OSCURO)
   ==================================================================== */
.edit-columns-modal {
  width: 95vw;
  max-width: 1040px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.edit-columns-body {
  display: grid;
  grid-template-columns: 280px 1fr auto 1fr;
  gap: 16px;
  padding: 20px;
  align-items: stretch;
  background: var(--bg-card);
  max-height: calc(85vh - 130px);
  overflow-y: auto;
}

@media (max-width: 992px) {
  .edit-columns-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.edit-col-block {
  display: flex;
  flex-direction: column;
}

.block-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.block-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.block-card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.block-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.35;
}

.count-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-surface);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.layout-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-fast);
}

.btn-action-primary i, .btn-action-primary span {
  color: #ffffff !important;
}

.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 70, 239, 0.45);
  background: linear-gradient(135deg, var(--primary-purple-dark) 0%, var(--primary-fuchsia) 100%) !important;
}

[data-theme="light"] .btn-action-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

[data-theme="light"] .btn-action-primary i,
[data-theme="light"] .btn-action-primary span {
  color: #ffffff !important;
}

.btn-action-danger-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--accent-red);
}

.list-reorder-container {
  display: flex;
  gap: 10px;
  flex: 1;
  min-height: 280px;
}

.columns-multiselect {
  flex: 1;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.columns-multiselect:focus {
  border-color: var(--accent-primary);
}

.columns-multiselect option {
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.columns-multiselect option:checked {
  background: var(--accent-primary) linear-gradient(0deg, var(--accent-primary) 0%, var(--accent-primary) 100%);
  color: #ffffff;
  font-weight: 600;
}

.reorder-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.btn-tool-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tool-icon:hover {
  background: var(--accent-surface);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.05);
}

.edit-col-transfer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 0 4px;
}

@media (max-width: 992px) {
  .edit-col-transfer {
    flex-direction: row;
    justify-content: center;
  }
}

.btn-transfer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-transfer:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.edit-columns-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

/* Celdas formateadas dinámicas en tabla */
.table-badge-active {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.table-badge-inactive {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.table-channel-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.table-cell-currency {
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

/* ====================================================================
   SECCIÓN DE PRODUCTO COMBO & BUSCADOR INTELIGENTE
   ==================================================================== */
.field-combo-info-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--primary-fuchsia-bright);
  background: rgba(217, 70, 239, 0.08);
  border: 1px dashed rgba(217, 70, 239, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 6px;
  animation: fadeInDown 0.2s ease-out;
}

[data-theme="light"] .field-combo-info-hint {
  color: var(--primary-purple-dark);
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed rgba(139, 92, 246, 0.35);
}

.field-combo-info-hint i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.field-combo-readonly {
  background: rgba(217, 70, 239, 0.06) !important;
  border-color: rgba(217, 70, 239, 0.25) !important;
  cursor: not-allowed !important;
}

[data-theme="light"] .field-combo-readonly {
  background: rgba(139, 92, 246, 0.06) !important;
  border-color: rgba(139, 92, 246, 0.25) !important;
}

/* Badges de tipo en tabla de sincronización ML */
.badge-combo-table {
  background: rgba(217, 70, 239, 0.15);
  color: var(--primary-fuchsia-bright);
  border: 1px solid rgba(217, 70, 239, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
  letter-spacing: 0.03em;
}

[data-theme="light"] .badge-combo-table {
  background: rgba(192, 38, 211, 0.12);
  color: #c026d3;
  border: 1px solid rgba(192, 38, 211, 0.28);
}

.badge-indiv-table {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
  letter-spacing: 0.03em;
}

[data-theme="light"] .badge-indiv-table {
  background: rgba(8, 145, 178, 0.12);
  color: #0891b2;
  border: 1px solid rgba(8, 145, 178, 0.28);
}

.combo-config-card {
  margin-top: 14px;
  border: 1.5px solid rgba(217, 70, 239, 0.35) !important;
  background: var(--bg-surface) !important;
  animation: fadeInDown 0.25s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.combo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.combo-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-min-rule-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(217, 70, 239, 0.15);
  color: var(--primary-fuchsia-bright);
  border: 1px solid rgba(217, 70, 239, 0.35);
}

[data-theme="light"] .combo-min-rule-badge {
  color: var(--primary-fuchsia);
  background: rgba(192, 38, 211, 0.1);
  border-color: rgba(192, 38, 211, 0.25);
}

.combo-search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
}

.combo-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.combo-input-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.combo-input-search-wrapper .search-icon-inside {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.combo-input-search-wrapper input {
  padding-left: 36px;
  width: 100%;
}

.btn-clear-inline {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.btn-clear-inline:hover {
  color: var(--accent-red);
}

.combo-filters-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.combo-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.combo-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.combo-result-item:hover {
  background: var(--accent-surface);
}

.combo-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.combo-result-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.combo-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-add-to-combo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-purple);
  color: #ffffff;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.btn-add-to-combo:hover {
  opacity: 0.9;
}

.combo-items-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.combo-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.combo-items-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.combo-items-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.combo-items-table tbody tr:last-child td {
  border-bottom: none;
}

.input-combo-qty {
  width: 65px;
  padding: 4px 6px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', monospace;
}

.btn-remove-combo-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-remove-combo-item:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.combo-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 14px;
  color: var(--accent-yellow);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  background: rgba(250, 204, 21, 0.05);
}

.combo-empty-state i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ====================================================================
   MÓDULO DE VENTAS: ESTILOS, BADGES Y MODAL DE DETALLE
   ==================================================================== */
.sales-module-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sales-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-shadow-outer);
}

.sales-filters-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.sales-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-date-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-date-box i {
  width: 16px;
  height: 16px;
  color: var(--primary-fuchsia-bright);
}

.input-date-custom {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.input-date-custom::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

.btn-sync-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
}

.btn-sync-action i {
  width: 16px;
  height: 16px;
}

.btn-sync-meli {
  background: rgba(255, 230, 0, 0.12);
  border-color: rgba(255, 230, 0, 0.35);
  color: #ffe600;
}

.btn-sync-meli:hover {
  background: #ffe600;
  color: #111827;
  box-shadow: 0 0 16px rgba(255, 230, 0, 0.4);
}

.btn-sync-woo {
  background: rgba(147, 51, 234, 0.15);
  border-color: rgba(147, 51, 234, 0.35);
  color: #c084fc;
}

.btn-sync-woo:hover {
  background: #9333ea;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.4);
}

.btn-sale-manual {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  color: #ffffff;
  border: none;
  box-shadow: var(--neu-glow-fuchsia);
}

.btn-sale-manual:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.5);
}

/* Badges de Plataforma */
.badge-plat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-plat-meli {
  background: rgba(255, 230, 0, 0.15);
  color: #eab308;
  border: 1px solid rgba(255, 230, 0, 0.35);
}

.badge-plat-woo {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.35);
}

.badge-plat-manual {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

/* Badges de Estado */
.badge-status-sale {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-status-delivered {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-status-transit {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-status-pending {
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.badge-status-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Modal Detalle Venta */
.sale-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.sale-info-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sale-info-card .info-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sale-info-card .info-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sale-items-table-wrapper {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
}

.sale-totals-summary {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 16px;
  padding: 12px 18px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.sale-total-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.sale-total-item span:first-child {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
}

.sale-total-item span:last-child {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sale-total-item.highlight span:last-child {
  color: var(--primary-fuchsia-bright);
  font-size: 1.25rem;
}

/* ====================================================================
   MÓDULO DE AUTENTICACIÓN, LOGIN Y GESTIÓN DE USUARIOS
   ==================================================================== */

/* Avatar circular de barra lateral */
.user-avatar-btn {
  overflow: hidden;
  position: relative;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.avatar-badge-pending {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-sidebar);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Pantalla completa de Login / Autenticación */
.auth-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 30%, #1e1535 0%, #0d0c15 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(16px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-card-glow);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), var(--neu-glow-purple);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.auth-card-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-purple), var(--primary-fuchsia), var(--accent-cyan));
}

.auth-brand-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--primary-fuchsia-bright);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Tabs Login / Registro */
.auth-tabs-bar {
  display: flex;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-card);
  gap: 4px;
}

.btn-auth-tab {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-auth-tab.active {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  color: #fff;
  box-shadow: 0 2px 10px rgba(217, 70, 239, 0.35);
}

.auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-input-group input {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-input-group input:focus {
  border-color: var(--primary-fuchsia);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.3);
}

.auth-avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-card);
}

.avatar-preview-circle {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--primary-fuchsia);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-auth-submit {
  padding: 13px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--neu-glow-fuchsia);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(217, 70, 239, 0.6);
}

.auth-footer-notice {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Modal de Administración de Usuarios / Solicitudes */
.users-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-card);
  padding: 0 20px;
}

.tab-btn-users {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.tab-btn-users.active {
  color: var(--primary-fuchsia-bright);
  border-bottom-color: var(--primary-fuchsia);
}

.badge-tab-count {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.user-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  margin-bottom: 8px;
  gap: 12px;
}

.user-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-small {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4c1d95, #702670);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  border: 1.5px solid var(--primary-purple);
  flex-shrink: 0;
}

.user-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-role-default {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ====================================================================
   ESTILOS DE EDICIÓN MASIVA (BOTÓN Y MODAL FrmEdicionMasiva)
   Soporte completo para Modo Oscuro y Modo Claro
   ==================================================================== */

/* Botón de edición masiva en el panel lateral */
.btn-action-bulk-edit {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px !important;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28) 0%, rgba(217, 70, 239, 0.35) 100%) !important;
  border: 1.5px solid var(--primary-fuchsia) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.35), var(--neu-shadow-outer) !important;
  transition: all var(--transition-fast) !important;
  box-sizing: border-box;
}

.btn-action-bulk-edit:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%) !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: 0 6px 22px rgba(217, 70, 239, 0.55) !important;
}

.btn-action-bulk-edit i {
  color: var(--primary-fuchsia-bright) !important;
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn-action-bulk-edit:hover i {
  color: #ffffff !important;
  transform: scale(1.15) rotate(-8deg);
}

[data-theme="light"] .btn-action-bulk-edit {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(192, 38, 211, 0.18) 100%) !important;
  border-color: var(--primary-purple) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.22) !important;
}

[data-theme="light"] .btn-action-bulk-edit:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
}

/* Modal contenedor de edición masiva */
.bulk-edit-modal {
  max-width: 960px !important;
  width: 95% !important;
}

.bulk-edit-body {
  gap: 28px !important;
  padding: 26px 30px !important;
}

.bulk-edit-body .modal-col-left,
.bulk-edit-body .modal-col-right {
  gap: 22px !important;
}

/* Tarjetas de grupos en edición masiva */
.bulk-group-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px !important;
  display: flex;
  flex-direction: column;
  gap: 16px !important;
  box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.15);
  transition: border-color var(--transition-fast);
}

.bulk-group-card:hover {
  border-color: var(--border-card-glow);
}

.bulk-group-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem !important;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 12px !important;
  margin-bottom: 6px !important;
  letter-spacing: 0.3px;
}

.bulk-group-title i {
  color: var(--primary-fuchsia);
  width: 20px;
  height: 20px;
}

/* Fila de cada campo individual: Espaciosa, alineada y no amontonada */
.bulk-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px !important;
  padding: 10px 14px !important;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: transparent;
  transition: all var(--transition-fast);
}

/* Checkbox o palomitas estilizadas */
.bulk-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 12px !important;
  font-size: 0.92rem !important;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 155px !important;
  user-select: none;
  transition: color var(--transition-fast);
}

.bulk-checkbox-label:hover {
  color: var(--text-primary);
}

/* Palomita / Checkbox estilizado neumórfico */
.bulk-checkbox-label input[type="checkbox"].bulk-field-check {
  appearance: none;
  -webkit-appearance: none;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  border-radius: 6px;
  border: 1.8px solid var(--border-card-glow);
  background: var(--bg-app);
  cursor: pointer;
  display: grid;
  place-content: center;
  box-shadow: var(--neu-shadow-inset);
  transition: all var(--transition-fast);
  margin: 0 !important;
}

.bulk-checkbox-label input[type="checkbox"].bulk-field-check::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2.2px solid #ffffff;
  border-bottom: 2.2px solid #ffffff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-top: -2px;
}

.bulk-checkbox-label input[type="checkbox"].bulk-field-check:checked {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%) !important;
  border-color: var(--primary-fuchsia-bright) !important;
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.5) !important;
}

.bulk-checkbox-label input[type="checkbox"].bulk-field-check:checked::before {
  transform: rotate(-45deg) scale(1);
}

.bulk-input-container {
  flex: 1;
  width: 100%;
}

.bulk-input-container .form-select,
.bulk-input-container .form-input {
  padding: 10px 14px !important;
  font-size: 0.9rem !important;
  height: 44px !important;
}

/* ESTADO INACTIVO / OPACIDAD POR DEFECTO */
.bulk-input-control {
  opacity: 0.38 !important;
  filter: grayscale(60%);
  background: var(--bg-app) !important;
  border-color: var(--border-card) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  transition: all var(--transition-fast);
}

/* ESTADO ACTIVO E ILUMINADO (IDENTIFICADOR VISUAL SOLICITADO) */
.bulk-field-row.active {
  background: rgba(217, 70, 239, 0.08) !important;
  border-color: rgba(217, 70, 239, 0.45) !important;
  box-shadow: 0 0 16px rgba(217, 70, 239, 0.18) !important;
}

.bulk-field-row.active .bulk-checkbox-label {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

.bulk-field-row.active .bulk-input-control {
  opacity: 1 !important;
  filter: none !important;
  background: var(--bg-card) !important;
  border-color: var(--primary-fuchsia) !important;
  color: var(--text-primary) !important;
  cursor: text;
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.35), var(--neu-shadow-inset) !important;
}

[data-theme="light"] .bulk-field-row.active {
  background: rgba(192, 38, 211, 0.08) !important;
  border-color: rgba(192, 38, 211, 0.5) !important;
  box-shadow: 0 0 14px rgba(192, 38, 211, 0.18) !important;
}

[data-theme="light"] .bulk-field-row.active .bulk-input-control {
  border-color: var(--primary-purple) !important;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.25) !important;
}

/* Tarjeta informativa de contador */
.bulk-counter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
  border: 1.5px dashed var(--border-card-glow);
  border-radius: var(--radius-lg);
  padding: 16px 20px !important;
  margin-top: 4px;
}

.bulk-counter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.bulk-counter-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-fuchsia-bright);
  background: rgba(217, 70, 239, 0.15);
  border: 1px solid rgba(217, 70, 239, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

[data-theme="light"] .bulk-counter-badge {
  color: var(--primary-purple);
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
}

.bulk-footer-custom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px 30px !important;
}

/* ======================================================= */
/* MÓDULO DE COMPRAS DE MERCANCÍA                         */
/* ======================================================= */
.compras-module-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.purchase-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.purchase-status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.purchase-status-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.meli-sync-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.meli-sync-item-badge.synced {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.meli-sync-item-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-sync-item-meli {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(255, 230, 0, 0.12);
  color: #eab308;
  border: 1px solid rgba(255, 230, 0, 0.35);
  transition: all var(--transition-fast);
}

[data-theme="light"] .btn-sync-item-meli {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-sync-item-meli:hover:not(:disabled) {
  background: rgba(255, 230, 0, 0.25);
  transform: translateY(-1px);
}

.btn-sync-item-meli:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-view-compra {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  transition: all var(--transition-fast);
}

.btn-view-compra:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: #06b6d4;
  transform: translateY(-1px);
}

/* ======================================================= */
/* ESTILOS: SISTEMA DE ETIQUETAS Y TAGS                    */
/* ======================================================= */
.tags-chips-selector-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  min-height: 38px;
}

.tag-chip-selectable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid transparent;
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag-chip-selectable:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.tag-chip-selectable.selected {
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tag-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-badge-table {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.tag-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  transition: background var(--transition-fast);
}

.tag-manage-item:hover {
  background: rgba(139, 92, 246, 0.08);
}

.tag-manage-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-manage-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ====================================================================
   ASISTENTE INTELIGENTE IA (GOOGLE GEMINI) - DUAL THEME (DARK & LIGHT)
   ==================================================================== */

/* BOTÓN FLOTANTE (FAB) */
.ai-chat-fab-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9990;
}

.ai-chat-fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 9999px;
  border: 1.5px solid var(--border-card-glow);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-subtle) 100%);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.35), var(--neu-shadow-outer);
  transition: all var(--transition-bounce);
  backdrop-filter: blur(12px);
}

.ai-chat-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 36px rgba(217, 70, 239, 0.45);
  border-color: var(--primary-fuchsia);
}

.ai-chat-fab:active {
  transform: translateY(0) scale(0.98);
}

.ai-fab-glow {
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  opacity: 0.3;
  filter: blur(8px);
  z-index: -1;
  transition: opacity 0.3s;
}

.ai-chat-fab:hover .ai-fab-glow {
  opacity: 0.7;
}

.ai-fab-icon-box {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-fuchsia), var(--primary-purple));
  color: #ffffff;
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.6);
}

.ai-fab-icon-box .icon-sparkle {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  color: #facc15;
  animation: pulseGlow 2s infinite ease-in-out;
}

.ai-fab-icon-box .icon-bot {
  width: 16px;
  height: 16px;
}

.ai-fab-label {
  letter-spacing: 0.3px;
}

/* VENTANA PRINCIPAL DEL CHAT */
.ai-chat-window {
  position: fixed !important;
  bottom: 96px !important;
  right: 28px !important;
  width: 440px !important;
  max-width: calc(100vw - 36px) !important;
  height: 620px !important;
  max-height: calc(100vh - 120px) !important;
  z-index: 9995 !important;
  display: flex;
  flex-direction: column !important;
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border-card-glow) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(139, 92, 246, 0.25) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  animation: modalFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window[aria-hidden="true"] {
  display: none !important;
}

[data-theme="light"] .ai-chat-window {
  box-shadow: 0 20px 50px rgba(148, 163, 184, 0.4), 0 0 25px rgba(139, 92, 246, 0.15);
  background: #ffffff;
}

/* CABECERA DEL CHAT */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-card);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(217, 70, 239, 0.08) 100%);
  backdrop-filter: blur(8px);
}

.ai-chat-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-status-indicator {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.ai-status-indicator.online .ai-status-dot {
  animation: pulseDot 2s infinite;
}

.ai-chat-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.ai-chat-sub {
  font-size: 0.73rem;
  color: var(--text-secondary);
  display: block;
}

.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-chat-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-chat-btn-icon:hover {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border-color: var(--border-card);
}

.ai-chat-btn-icon.active {
  color: var(--primary-fuchsia);
  border-color: var(--border-card-glow);
  background: rgba(217, 70, 239, 0.12);
}

.ai-chat-btn-icon svg {
  width: 16px;
  height: 16px;
}

/* CUERPO DE MENSAJES */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
}

.ai-msg-bot {
  align-self: flex-start;
}

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-msg-bot .ai-msg-avatar {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-fuchsia));
  color: #ffffff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.ai-msg-bot .ai-msg-avatar svg {
  width: 16px;
  height: 16px;
}

.ai-msg-user .ai-msg-avatar {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}

.ai-msg-user .ai-msg-avatar svg {
  width: 15px;
  height: 15px;
}

.ai-msg-bubble {
  padding: 12px 15px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.ai-msg-bot .ai-msg-bubble {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  border-top-left-radius: 2px;
}

.ai-msg-user .ai-msg-bubble {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
  color: #ffffff;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.ai-msg-bubble p {
  margin: 0 0 8px 0;
}

.ai-msg-bubble p:last-child {
  margin-bottom: 0;
}

.ai-msg-bubble ul, .ai-msg-bubble ol {
  margin: 6px 0 6px 20px;
  padding: 0;
}

.ai-msg-bubble li {
  margin-bottom: 4px;
}

.ai-msg-bubble strong {
  font-weight: 700;
}

/* SUGERENCIAS RÁPIDAS (CHIPS) */
.ai-quick-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ai-chip-prompt {
  background: var(--bg-card);
  border: 1px solid var(--border-card-glow);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.ai-chip-prompt:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(217, 70, 239, 0.15) 100%);
  border-color: var(--primary-fuchsia);
  transform: translateY(-1px);
}

/* TARJETA INTERACTIVA DE PROPUESTA DE AJUSTE (SEGURIDAD) */
.ai-proposal-card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid var(--primary-fuchsia);
  box-shadow: 0 4px 16px rgba(217, 70, 239, 0.15);
}

.ai-proposal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-fuchsia);
  font-weight: 700;
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.ai-proposal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.ai-proposal-field {
  padding: 6px 8px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
}

.ai-proposal-field span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.ai-proposal-field strong {
  color: var(--text-primary);
}

.ai-proposal-combos-alert {
  font-size: 0.74rem;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.ai-proposal-actions {
  display: flex;
  gap: 8px;
}

.ai-btn-confirm-proposal {
  flex: 1;
  background: linear-gradient(135deg, var(--accent-green) 0%, #16a34a 100%);
  color: #ffffff;
  border: none;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.ai-btn-confirm-proposal:hover {
  opacity: 0.9;
}

.ai-btn-cancel-proposal {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
}

.ai-btn-cancel-proposal:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

/* TYPING INDICATOR */
.ai-chat-typing {
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-card);
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-fuchsia);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.ai-typing-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-left: 6px;
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* PIE: ENTRADA Y ACCIONES DE VOZ */
.ai-chat-footer {
  padding: 12px 14px !important;
  border-top: 1px solid var(--border-card) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: var(--bg-card) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  min-height: 66px !important;
}

.ai-chat-voice-btn, .ai-chat-send-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--border-card) !important;
  background: var(--bg-card-subtle) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all var(--transition-bounce) !important;
}

.ai-chat-voice-btn:hover {
  color: var(--primary-fuchsia) !important;
  border-color: var(--border-card-glow) !important;
  transform: scale(1.05) !important;
}

.ai-chat-voice-btn.recording {
  background: var(--accent-red) !important;
  color: #ffffff !important;
  border-color: var(--accent-red) !important;
  animation: pulseRecording 1s infinite !important;
}

@keyframes pulseRecording {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.ai-chat-send-btn {
  background: linear-gradient(135deg, var(--primary-fuchsia) 0%, var(--primary-purple) 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(217, 70, 239, 0.4) !important;
}

.ai-chat-send-btn:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 14px rgba(217, 70, 239, 0.6) !important;
}

.ai-chat-textarea {
  flex: 1 !important;
  min-width: 0 !important;
  height: 42px !important;
  background: var(--bg-card-subtle) !important;
  color: var(--text-primary) !important;
  border: 1.5px solid var(--border-card) !important;
  border-radius: var(--radius-md) !important;
  padding: 0 14px !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  line-height: 42px !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.ai-chat-textarea:focus {
  border-color: var(--primary-fuchsia) !important;
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.2) !important;
}


/* ENLACES INTERACTIVOS DE PRODUCTOS (SKU) Y SECCIONES EN EL CHAT */
.ai-sku-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(217, 70, 239, 0.16) 100%);
  color: var(--primary-fuchsia);
  border: 1px solid rgba(217, 70, 239, 0.4);
  padding: 2px 9px;
  margin: 1px 2px;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  vertical-align: baseline;
  text-decoration: none;
}

.ai-sku-pill-link:hover {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
  color: #ffffff;
  border-color: var(--primary-fuchsia);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(217, 70, 239, 0.35);
}

[data-theme="light"] .ai-sku-pill-link {
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary-purple-dark);
  border-color: rgba(124, 58, 237, 0.35);
}

[data-theme="light"] .ai-sku-pill-link:hover {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
  color: #ffffff;
}

.ai-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  color: var(--primary-purple);
  border: 1px solid var(--border-card-glow);
  padding: 3px 10px;
  margin: 2px 2px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-inline-link:hover {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
  color: #ffffff;
  border-color: var(--primary-fuchsia);
  transform: translateY(-1px);
}

.ai-msg-heading {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 10px 0 6px 0;
  display: block;
}

.ai-msg-divider {
  border: none;
  border-top: 1px solid var(--border-card);
  margin: 10px 0;
}


/* CONTROL DE VOZ Y SLASH DE VOLUMEN EN CABECERA DE HARI */
.ai-voice-control-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 999px;
  padding: 2px 8px 2px 3px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.ai-voice-control-group:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(217, 70, 239, 0.45);
}

.ai-voice-control-group .ai-chat-btn-icon {
  width: 28px;
  height: 28px;
}

.ai-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 68px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-fuchsia) 0%, var(--primary-purple) 100%);
  outline: none;
  cursor: pointer;
  transition: opacity var(--transition-fast), width var(--transition-fast);
}

.ai-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary-fuchsia);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 0 8px rgba(217, 70, 239, 0.65);
}

.ai-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary-fuchsia);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="light"] .ai-voice-control-group {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
}

[data-theme="light"] .ai-volume-slider {
  background: linear-gradient(90deg, var(--primary-purple) 0%, var(--primary-fuchsia) 100%);
}

/* ====================================================================
   BOTÓN PARA OBTENER FOTO DESDE MERCADO LIBRE
   ==================================================================== */
.btn-fetch-meli-img {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-fast);
}

.btn-fetch-meli-img:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.btn-fetch-meli-img:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-fetch-meli-img i,
.btn-fetch-meli-img svg {
  width: 14px;
  height: 14px;
}

.spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


