/* === VENTAS — Estilos especficos de Monitor Ventas Generales === */

/* --- Search Bar (feature principal) --- */
.search-section {
  max-width: 900px;
}

.search-bar-wrap {
  position: relative;
  margin-bottom: var(--sp-8);
}

.search-bar-icon {
  position: absolute; left: var(--sp-5); top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: color var(--t-fast);
}

.search-bar {
  width: 100%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: var(--font-family-mono);
  font-size: 1.125rem;
  padding: var(--sp-5) var(--sp-5) var(--sp-5) 56px;
  border-radius: var(--r-xl);
  transition: all var(--t-base) var(--ease-out);
  box-shadow: var(--shadow-card);
}
.search-bar:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow-accent), var(--shadow-md);
}
.search-bar:focus ~ .search-bar-icon { color: var(--color-accent); }
.search-bar::placeholder { color: var(--color-text-disabled); font-family: var(--font-family); }

.search-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--sp-2);
  padding-left: var(--sp-2);
}
.search-hint kbd {
  background: var(--bg-badge);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  font-family: var(--font-family-mono);
  font-size: 10px;
}

/* --- SKU Panel (resultado de bsqueda) --- */
.sku-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: sectionIn 0.4s var(--ease-out) both;
}

.sku-panel-header {
  display: flex; align-items: center; gap: var(--sp-6);
  padding: var(--sp-6);
  border-bottom: 1px solid var(--color-border);
}

.sku-panel-image {
  width: 100px; height: 100px;
  border-radius: var(--r-lg);
  object-fit: cover;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sku-panel-info { flex: 1; min-width: 0; }

.sku-panel-sku {
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.sku-panel-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--sp-2);
}

.sku-panel-category {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* SKU Panel KPI strip */
.sku-kpi-strip {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}

.sku-kpi-item {
  flex: 1; padding: var(--sp-5);
  text-align: center;
  position: relative;
}
.sku-kpi-item + .sku-kpi-item::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--color-border), transparent);
}

.sku-kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.sku-kpi-value {
  font-size: var(--text-xl);
  font-weight: 800;
  font-family: var(--font-family-mono);
  color: var(--color-text-primary);
}
.sku-kpi-value.warm { color: var(--color-warm); }
.sku-kpi-value.accent { color: var(--color-accent); }

/* Channel breakdown table */
.sku-channels { padding: var(--sp-4); }

.sku-channels-table {
  width: 100%;
  border-collapse: collapse;
}

.sku-channels-table th {
  padding: var(--sp-2) var(--sp-4);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-disabled);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.sku-channels-table th.col-number { text-align: right; }

.sku-channels-table td {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--color-border);
}
.sku-channels-table td.col-number {
  text-align: right;
  font-family: var(--font-family-mono);
  font-weight: 600;
}

.sku-channels-table tr:last-child td { border-bottom: none; }

.sku-channels-table .row-total td {
  font-weight: 700;
  color: var(--color-text-primary);
  border-top: 2px solid var(--color-border-strong);
  border-bottom: none;
}

/* --- Catalog Grid --- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
}

.catalog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
}
.catalog-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.catalog-card-image {
  width: 100%; height: 160px;
  object-fit: cover;
  background: var(--color-surface-elevated);
  border-bottom: 1px solid var(--color-border);
}

.catalog-card-body { padding: var(--sp-3); }

.catalog-card-sku {
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.catalog-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--sp-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card-price {
  font-family: var(--font-family-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-warm);
}

/* --- Month selector (header) --- */
.month-selector {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.month-selector:focus {
  outline: none;
  border-color: var(--color-accent);
}
.month-selector::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* --- Import options row --- */
.import-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  max-width: 500px;
}

/* --- Import excluded SKUs --- */
.import-excluded {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.import-excluded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  gap: var(--sp-3);
}
.import-excluded-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}
.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
}

/* --- Import CSV Zone --- */
.import-zone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--r-xl);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  transition: all var(--t-base) var(--ease-out);
  cursor: pointer;
}
.import-zone:hover,
.import-zone.dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}
.import-zone.dragover { transform: scale(1.01); }

.import-zone-icon {
  width: 48px; height: 48px;
  color: var(--color-text-muted);
  margin: 0 auto var(--sp-4);
}

.import-zone-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--sp-2);
}

.import-zone-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.import-zone-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--color-accent);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.import-zone-btn:hover {
  background: var(--color-accent-soft);
}

/* Import preview table */
.import-preview {
  margin-top: var(--sp-6);
}

.import-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.import-preview-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.import-preview-count strong {
  color: var(--color-text-primary);
  font-family: var(--font-family-mono);
}

/* --- Dashboard section --- */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.dashboard-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: all var(--t-fast);
}
.dashboard-kpi-card:hover { box-shadow: var(--shadow-card-hover); }

.dashboard-kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--kpi-icon-bg);
  margin-bottom: var(--sp-3);
}
.dashboard-kpi-icon svg { width: 18px; height: 18px; }

.dashboard-kpi-value {
  font-size: var(--text-xl);
  font-weight: 800;
  font-family: var(--font-family-mono);
  color: var(--color-text-primary);
  margin-bottom: var(--sp-1);
}

.dashboard-kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Channel bar --- */
.channel-bar {
  display: flex; height: 8px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--color-surface-hover);
  margin-top: var(--sp-4);
}

.channel-bar-segment { height: 100%; transition: width var(--t-base) var(--ease-out); }
.channel-bar-segment.mavima { background: var(--color-warm); }
.channel-bar-segment.santa-fe { background: var(--color-info); }
.channel-bar-segment.mercadolibre { background: var(--color-warning); }
.channel-bar-segment.woocommerce { background: var(--color-positive); }

/* Channel legend */
.channel-legend {
  display: flex; gap: var(--sp-6);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}

.channel-legend-item {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-xs); color: var(--color-text-muted);
}

.channel-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.channel-legend-dot.mavima { background: var(--color-warm); }
.channel-legend-dot.santa-fe { background: var(--color-info); }
.channel-legend-dot.mercadolibre { background: var(--color-warning); }
.channel-legend-dot.woocommerce { background: var(--color-positive); }

/* --- ML Sync --- */
.ml-item-thumb {
  display: block;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.data-table td:has(.ml-item-thumb) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  padding: var(--sp-2);
}

.ml-sync-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
}

.ml-link-btn {
  padding: var(--sp-2) var(--sp-3);
  font-size: 12px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}
.ml-link-btn:hover { filter: brightness(1.15); }
.ml-link-btn svg { width: 14px; height: 14px; }

.ml-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
}

.ml-pagination-info {
  font-size: var(--text-sm);
  font-family: var(--font-family-mono);
  color: var(--color-text-muted);
}

.ml-sync-result {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  animation: sectionIn 0.3s var(--ease-out) both;
}

/* --- Sync status footer --- */
.sync-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  margin-top: var(--sp-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
