/**
 * Catalog Admin Styles
 * Modern, clean design with responsive layout
 */

/* ===== Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #6b7280;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

/* ===== App Container ===== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header ===== */
.main-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo a {
  text-decoration: none;
  color: var(--primary-color);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.main-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

/* ===== Tenant Switcher ===== */
.tenant-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tenant-switcher label {
  font-weight: 500;
  color: var(--text-muted);
}

.tenant-select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  cursor: pointer;
  min-width: 200px;
}

.current-tenant-display {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Page Container ===== */
.page-container {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Dashboard ===== */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 2rem;
  border-radius: 0.5rem;
  text-align: center;
}

.stat-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.stat-card a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.stat-card a:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.quick-actions {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.quick-actions h2 {
  margin-bottom: 1.5rem;
}

.quick-action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.recent-activity {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.recent-activity h2 {
  margin-bottom: 1.5rem;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background-color: var(--bg-color);
  border-radius: 0.375rem;
}

.activity-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.activity-catalog { background-color: #dbeafe; color: #1e40af; }
.activity-brand { background-color: #dcfce7; color: #166534; }
.activity-product { background-color: #fef3c7; color: #92400e; }

.activity-name {
  font-weight: 500;
}

.activity-time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.search-input,
.filter-select,
.form-control {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
}

.search-input {
  min-width: 300px;
}

.filter-select,
.form-control {
  min-width: 150px;
}

.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.half {
  flex: 1;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.btn-icon:hover {
  background-color: var(--bg-color);
}

/* ===== Data Table ===== */
.data-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

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

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-color);
  font-weight: 600;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.data-table th.sortable:hover {
  background-color: #e5e7eb;
}

.sort-indicator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.data-table tbody tr:hover {
  background-color: var(--bg-color);
}

.loading-row,
.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ===== Status Badge ===== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-published {
  background-color: #d1fae5;
  color: #0e7490;
}

.status-unpublished {
  background-color: #f3f4f6;
  color: #4b5563;
}

.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

/* ===== Offer Count Badge ===== */
.offer-count {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #f3f4f6;
  color: #6b7280;
}

.offer-count.has-offers {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* ===== Variant Accordion ===== */
.variant-accordion {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.5rem;
  overflow: hidden;
}

.variant-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  transition: background-color 0.15s;
}

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

.variant-row:hover {
  background-color: #f9fafb;
}

.variant-row .toggle-icon {
  margin-right: 0.75rem;
  font-size: 0.7rem;
  color: #9ca3af;
  width: 1rem;
  text-align: center;
}

.variant-row .variant-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.variant-row .variant-info code {
  font-size: 0.8rem;
}

.variant-row .variant-info .variant-name {
  min-width: 120px;
}

.variant-row .variant-info .variant-price {
  min-width: 80px;
  text-align: right;
}

.variant-row .variant-info .variant-stock {
  min-width: 30px;
  text-align: center;
}

.variant-offers {
  display: none;
  background-color: #f9fafb;
  padding: 0 1rem 0.5rem 2.75rem;
}

.variant-offers.expanded {
  display: block;
}

.variant-offers table {
  width: 100%;
  font-size: 0.85rem;
}

.variant-offers table th {
  font-weight: 600;
  color: #6b7280;
  padding: 0.35rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.variant-offers table td {
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.variant-offers .no-offers {
  color: #9ca3af;
  font-style: italic;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

/* ===== Confidence Badge ===== */
.confidence-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.confidence-high {
  background-color: #d1fae5;
  color: #065f46;
}

.confidence-medium {
  background-color: #fef3c7;
  color: #92400e;
}

.confidence-low {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ===== Trust Badge ===== */
.trust-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.trust-high {
  background-color: #dbeafe;
  color: #1e40af;
}

.trust-medium {
  background-color: #e0e7ff;
  color: #3730a3;
}

.trust-low {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* ===== Actions Column ===== */
.actions {
  white-space: nowrap;
}

/* ===== Pagination ===== */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-size-selector label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background-color: white;
  color: var(--text-primary);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  min-width: 2.5rem;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

.pagination-btn.page-number {
  min-width: 2.5rem;
  padding: 0.5rem 0.75rem;
}

.pagination-ellipsis {
  padding: 0.5rem;
  color: var(--text-muted);
  user-select: none;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.modal-lg {
  max-width: 700px;
}

/* Support modal-xl on modal-content directly */
.modal-content.modal-xl {
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Support modal-xl on outer modal div (product detail page pattern) */
.modal.modal-xl .modal-content {
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-sm {
  max-width: 400px;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  line-height: 1;
}

.close-modal:hover {
  color: var(--text-color);
}

.modal h2 {
  margin-bottom: 1.5rem;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ===== Quick Add ===== */
.quick-add-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.quick-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.quick-add-row .form-control {
  flex: 1;
}

.btn-remove-row {
  color: var(--danger-color);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
}

/* ===== Notifications ===== */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0.375rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-success {
  background-color: var(--success-color);
  color: white;
}

.notification-error {
  background-color: var(--danger-color);
  color: white;
}

.notification-info {
  background-color: var(--primary-color);
  color: white;
}

.notification-warning {
  background-color: var(--warning-color);
  color: white;
}

.notification-fade-out {
  opacity: 0;
  transition: opacity 0.3s;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  margin-top: 1rem;
}

/* ===== Product Detail Page ===== */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.detail-section {
  background-color: var(--bg-color);
  padding: 1.5rem;
  border-radius: 0.375rem;
}

.detail-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.detail-section dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
}

.detail-section dt {
  font-weight: 600;
  color: var(--text-muted);
}

.detail-section dd {
  margin: 0;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

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

.image-thumbnail img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
}

.image-thumbnail p {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Form Sections ===== */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.section-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ===== FortuneSheet Container ===== */
#spreadsheet-container {
  height: 600px;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  margin: 1rem 0;
  overflow: hidden;
  position: relative; /* Add for Univer positioning */
}

/* Univer-specific overrides */
#spreadsheet-container .univer-container {
  height: 100%;
  width: 100%;
}

/* ===== Catalog Spreadsheet Container ===== */
#catalog-spreadsheet-container {
  height: 400px;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  margin: 1rem 0;
  overflow: hidden;
  position: relative; /* Required for Univer positioning */
}

#catalog-spreadsheet-container .univer-container {
  height: 100%;
  width: 100%;
}

/* ===== Bulk Image Input ===== */
.bulk-image-input {
  margin: 1.5rem 0;
}

.bulk-image-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.bulk-image-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  resize: vertical;
}

.bulk-image-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Current Images Management ===== */
.current-images-section {
  margin: 1.5rem 0;
}

.current-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.image-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5rem;
  background: var(--card-bg);
  transition: box-shadow 0.2s;
}

.image-card:hover {
  box-shadow: var(--shadow);
}

.image-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 0.25rem;
  display: block;
}

.image-card .remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-card .remove-btn:hover {
  background: #dc2626;
}

.image-card .primary-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-card .set-primary-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.25rem;
  font-size: 0.75rem;
}

/* ===== Footer ===== */
.main-footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Utility Classes ===== */
.warning {
  color: var(--warning-color);
  font-weight: 500;
}

.no-results {
  display: none;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.no-tenant-message {
  text-align: center;
  padding: 4rem 2rem;
}

.no-tenant-message h2 {
  margin-bottom: 1rem;
}

/* ===== Button Loading State ===== */
[data-loading] {
  position: relative;
}

[data-loading].loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  transform: translate(-50%, -50%);
}

/* ===== Matching Wizard ===== */
.modal-wizard {
  max-width: 650px;
}

/* Wizard Progress Bar */
.wizard-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.wizard-step span {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wizard-step.active span,
.wizard-step.completed span {
  color: var(--text-color);
  font-weight: 500;
}

.wizard-connector {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  margin: 0 0.5rem;
  margin-bottom: 1.5rem;
}

.wizard-step.completed + .wizard-connector,
.wizard-step.active + .wizard-connector {
  background: var(--primary-color);
}

.step-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 1;
  transition: all 0.2s;
}

.wizard-step.active .step-indicator {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.wizard-step.completed .step-indicator {
  background: var(--success-color);
  color: white;
}

/* Wizard Content */
.wizard-content {
  min-height: 300px;
}

.wizard-content h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.wizard-content h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
}

/* Processing Animation */
.processing-animation {
  text-align: center;
  padding: 3rem;
}

.processing-animation .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

.processing-animation h3 {
  margin-bottom: 0.5rem;
}

.processing-status {
  color: var(--text-muted);
}

/* Confidence Summary */
.confidence-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

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

.score-value {
  font-size: 2.5rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.score-value.high { color: var(--success-color); }
.score-value.medium { color: var(--warning-color); }
.score-value.low { color: var(--danger-color); }

.score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.method-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
}

.method-badge.method-auto {
  background: #d1fae5;
  border-color: var(--success-color);
  color: #065f46;
}

/* Signals Panel */
.signals-panel {
  margin-bottom: 1.5rem;
}

.signals-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signal-item {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 6px;
  border-left: 4px solid;
  align-items: center;
}

.signal-item.high { border-color: var(--success-color); background: #f0fdf4; }
.signal-item.medium { border-color: var(--warning-color); background: #fffbeb; }
.signal-item.low { border-color: var(--danger-color); background: #fef2f2; }

.signal-source {
  font-weight: 500;
  font-size: 0.875rem;
}

.signal-value {
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-confidence {
  font-weight: 600;
  font-size: 0.875rem;
  text-align: right;
}

.no-signals {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
}

/* Suggested Match Panel */
.suggested-match-panel {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid var(--success-color);
}

.suggested-match-card {
  padding: 0.5rem;
}

.match-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-row {
  display: flex;
  gap: 1rem;
}

.match-label {
  font-weight: 600;
  min-width: 80px;
  color: var(--text-muted);
}

.match-value {
  flex: 1;
}

/* Selection Form */
.selection-form {
  margin-bottom: 1.5rem;
}

.selection-form .form-group {
  margin-bottom: 1rem;
}

/* Alias Option */
.alias-option {
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.alias-hint {
  margin: 0.5rem 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Wizard Actions */
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Success Animation */
.success-animation {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  animation: successPop 0.3s ease-out;
}

@keyframes successPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.success-summary {
  margin-bottom: 1.5rem;
}

.success-details {
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 8px;
}

.success-row {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
}

.success-row:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.success-label {
  font-weight: 600;
  min-width: 100px;
  color: var(--text-muted);
}

.success-value {
  flex: 1;
}

.alias-created {
  background: #f0fdf4;
  margin: 0.5rem -1rem -0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 8px;
}

/* Matching Panel */
.matching-panel {
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 8px;
  text-align: center;
}

.btn-icon-inline {
  margin-right: 0.5rem;
}

/* Match Comparison Layout */
.match-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comparison-panel {
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg-color);
}

.comparison-panel h4 {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.comparison-panel .panel-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.source-panel {
  border: 1px solid var(--border-color);
}

.match-panel {
  border: 2px solid var(--success-color);
  background: #f0fdf4;
}

.comparison-panel .data-row {
  display: flex;
  gap: 0.5rem;
}

.comparison-panel .data-label {
  font-weight: 600;
  min-width: 70px;
  color: var(--text-muted);
}

.comparison-panel .data-value {
  flex: 1;
}

.metadata-hint {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.875rem;
}

.meta-item {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  .match-comparison {
    grid-template-columns: 1fr;
  }
}

/* ===== Offer Detail Modal ===== */
.offer-price-link {
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}

.offer-price-link:hover {
  text-decoration: underline;
}

.offer-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.offer-detail-grid > div {
  padding: 0.5rem;
  background: white;
  border-radius: 0.25rem;
}

.offer-detail-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.offer-detail-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.offer-detail-section .data-table {
  font-size: 0.875rem;
}

.offer-history-table {
  font-size: 0.875rem;
}

.offer-history-table td,
.offer-history-table th {
  padding: 0.5rem 0.75rem;
}

/* Move Offer Panel */
.move-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
}

.move-product-item:hover {
  background-color: var(--bg-color);
}

.move-product-item:last-child {
  border-bottom: none;
}

#move-product-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  background: white;
}

/* ===== Detail Hero Image ===== */
.detail-hero-image {
  margin-bottom: 1rem;
}

.detail-hero-image img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  background: white;
}

/* ===== ID Hint (name with ID on hover) ===== */
.id-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: default;
  position: relative;
}

.id-hint-icon {
  color: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
  vertical-align: middle;
}

.id-hint:hover .id-hint-icon {
  opacity: 1;
  color: var(--primary-color);
}

.id-hint[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--text-color);
  color: white;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  border-radius: 0.25rem;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* ===== Offer Move Bar ===== */
.offer-move-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--primary-color);
  border-radius: 0.375rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  bottom: 1rem;
  z-index: 50;
  margin-top: 1rem;
}

.move-bar-count {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.offer-move-bar .filter-select {
  min-width: 200px;
}

/* ===== Enrichment Banner ===== */
.enrichment-banner {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--primary-color);
  border-radius: 0.375rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

.enrichment-banner-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  user-select: none;
}

.enrichment-banner-header:hover {
  background-color: #dbeafe;
}

.enrichment-banner-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--primary-color);
}

.enrichment-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
}

.enrichment-toggle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.enrichment-banner-body {
  padding: 0 1.5rem 1.5rem;
}

.enrichment-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid #e0e7ff;
  background: white;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
}

.enrichment-suggestion-row:last-child {
  border-bottom: none;
}

.enrichment-suggestion-row .checkbox-label {
  min-width: 180px;
}

.enrichment-suggestion-row .spec-name {
  font-weight: 500;
}

.spec-suggested-value {
  font-weight: 600;
  color: var(--text-color);
  min-width: 100px;
}

.confidence-bar-container {
  position: relative;
  width: 80px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
}

.confidence-bar {
  height: 100%;
  border-radius: 0.25rem;
  transition: width 0.3s;
}

.confidence-bar-high {
  background-color: var(--success-color);
}

.confidence-bar-medium {
  background-color: var(--warning-color);
}

.confidence-bar-low {
  background-color: var(--danger-color);
}

.confidence-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: #1f2937;
}

.spec-level-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.level-product {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.level-variant {
  background-color: #fef3c7;
  color: #92400e;
}

.spec-offer-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.spec-distribution {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 100%;
  padding-left: 2rem;
}

.dist-item {
  margin-right: 0.5rem;
}

.enrichment-variant-breakdown {
  width: 100%;
  padding: 0.5rem 0 0 2rem;
  border-top: 1px dashed #e0e7ff;
  margin-top: 0.25rem;
}

.enrichment-variant-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.enrichment-variant-item .variant-label {
  font-weight: 500;
  min-width: 120px;
}

.enrichment-variant-item .variant-value {
  font-weight: 600;
  min-width: 80px;
}

.enrichment-variant-item .variant-offers {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.enrichment-variant-suggestions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #e0e7ff;
}

.enrichment-variant-suggestions h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.enrichment-warning-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  background-color: #fef3c7;
  color: #92400e;
}

.enrichment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e7ff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .header-left {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
  }

  .search-input {
    min-width: 100%;
  }

  .page-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
  }

  .filter-actions {
    margin-left: 0;
  }
}
