:root {
  --bg-color: #0f172a;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #3b82f6;
  --secondary-hover: #2563eb;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Animation */
.background-elements {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
  filter: blur(100px);
  opacity: 0.5;
}
.blob {
  position: absolute;
  border-radius: 50%;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--primary);
  top: -100px; left: -100px;
  animation: float 10s ease-in-out infinite alternate;
}
.blob-2 {
  width: 400px; height: 400px;
  background: var(--secondary);
  bottom: -50px; right: -50px;
  animation: float 12s ease-in-out infinite alternate-reverse;
}
@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}
.title { font-size: 2rem; font-weight: 700; }
.subtitle { color: var(--text-muted); margin-top: 5px; }

.header-actions { display: flex; gap: 15px; }

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--glass-bg); color: white; border: 1px solid var(--glass-border); }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.btn-icon { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; transition: color 0.2s; }
.btn-icon:hover { color: white; }

.btn-small { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); }
.stat-icon { font-size: 2.5rem; }
.text-blue { color: #38bdf8; }
.text-yellow { color: var(--warning); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; }

/* Table */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px;
}
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--glass-border); }
th { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-synced { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--danger-bg); color: var(--danger); cursor: help; }

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

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { background: rgba(255,255,255,0.05); color: white; }
.tab-btn.active {
  background: var(--primary);
  color: white;
}

/* Tabs Content */
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Toast */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-content { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--primary); }

@keyframes spin { 100% { transform: rotate(360deg); } }
.loading i { animation: spin 1s linear infinite; }

/* Console Logs Panel */
.console-panel {
  margin-top: 40px;
  background: rgba(10, 15, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  padding: 20px;
  font-family: 'Courier New', Courier, monospace;
}
.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}
.console-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.console-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.console-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-filter-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.log-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.log-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.log-filter-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 600;
}
.log-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.log-filter-btn.active .log-badge {
  background: rgba(56, 189, 248, 0.4);
  color: #fff;
}
.console-body {
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #38bdf8;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}
.console-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-line.info { color: #38bdf8; }
.console-line.warn { color: #f59e0b; }
.console-line.error { color: #ef4444; }
.console-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
}
.console-dot.active {
  animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════ */
/* SYNC PRODUCTOS — Estilos de la nueva pestaña            */
/* ═══════════════════════════════════════════════════════ */

/* Badge "NUEVO" en pestaña */
.tab-btn-products {
  position: relative;
  border: 1px solid rgba(99,102,241,0.4) !important;
}
.tab-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 2px;
}

/* Grid de stats de la pestaña de productos */
.products-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.pstat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 14px 16px;
  transition: background 0.2s;
}
.pstat-card:hover { background: rgba(255,255,255,0.07); }
.pstat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.pstat-info { display: flex; flex-direction: column; }
.pstat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.pstat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Barra de progreso */
.progress-container {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 12px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.progress-bar-wrapper {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(99,102,241,0.6);
}

/* Celda de error con truncado y tooltip */
.error-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f87171;
  font-size: 0.78rem;
  cursor: help;
}

/* Color variables extra usadas en el nuevo tab */
:root {
  --accent-cyan: #22d3ee;
}

/* ═══════════════════════════════════════════════════════ */
/* STOCK & PRECIOS (SHOPIFY) — Estilos del nuevo tab      */
/* ═══════════════════════════════════════════════════════ */
.stock-sync-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-top: 15px;
}
@media (max-width: 900px) {
  .stock-sync-grid {
    grid-template-columns: 1fr;
  }
}
.stock-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stock-card-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stock-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.stock-card-body {
  padding: 18px;
  flex: 1;
}
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-input, .form-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.form-input:focus, .form-select:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}
.form-help {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}
.form-row {
  display: flex;
  gap: 12px;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  accent-color: #a855f7;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.sub-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px;
}
.sku-result-box {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #e9d5ff;
}
.sku-result-box.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.badge-purple {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

