/* ============================================================
   Goaltage CMS — shared page components
   Builds on tokens + shell from app.css
   ============================================================ */

/* ---------------- Utilities ---------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.full-width { grid-column: 1 / -1; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ---------------- Page header / breadcrumb ---------------- */
.page-header { margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.page-title svg, .page-title i { width: 20px; height: 20px; color: var(--color-primary); }
.page-subtitle { font-size: 13.5px; color: var(--text-tertiary); margin: 4px 0 0; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); font-weight: 600; }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb svg, .breadcrumb i { width: 13px; height: 13px; }

/* ---------------- Generic card ---------------- */
.card, .card-glass, .table-card, .user-table-card, .panel, .detail-card, .stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card, .table-card, .user-table-card, .panel, .detail-card { margin-bottom: 18px; }
.card-glass { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg-surface) 80%, transparent); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  font-size: 14.5px;
}
.card-body { padding: 20px; }

.stat-card { padding: 16px 18px; }
.stat-value {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), #6b7ef2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

/* ---------------- Toolbar / search ---------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.search-box { flex: 1; min-width: 220px; }
.toolbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.per-page-control { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-tertiary); }
.per-page-select { width: auto; }
.category-filter-select { min-width: 150px; max-width: 220px; }
.search-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: -6px 0 16px;
}
.search-info svg, .search-info i { width: 15px; height: 15px; color: var(--color-primary); }

.input-wrapper { position: relative; }
.input-wrapper .input-icon {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.input-wrapper .form-input { padding-inline-start: 38px; }

/* ---------------- Forms ---------------- */
.form-card, .pricing-form-card, .form-card.legacy-price-form {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.form-card-header, .pricing-form-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.form-card-title, .pricing-form-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.form-card-title svg, .form-card-title i,
.pricing-form-title svg, .pricing-form-title i { width: 17px; height: 17px; color: var(--color-primary); }
.pricing-form-subtitle { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; }
.form-card-body, .pricing-grid { padding: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .form-grid, .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.required { color: var(--color-danger); margin-inline-start: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  color: var(--text-primary);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-tertiary); }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.form-help { font-size: 11.5px; color: var(--text-tertiary); }
.form-error { font-size: 12px; color: var(--color-danger); font-weight: 500; }
.legacy-price-form { opacity: 0.6; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* ---------------- User form (scope-aware panels) ---------------- */
.is-hidden { display: none !important; }

.user-form-page .hero { padding: 24px 20px; }
.hero-title { font-size: 21px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.hero-subtitle { font-size: 13px; color: var(--text-tertiary); line-height: 1.6; }

.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.panel-head h2 { font-size: 15px; font-weight: 700; margin: 0; color: var(--text-primary); }
.panel-body { padding: 20px; }

.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field-grid-single { display: grid; gap: 16px; }
@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
}
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group-full { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.field-help { font-size: 11.5px; color: var(--text-tertiary); }
.field-error { font-size: 12px; color: var(--color-danger); font-weight: 500; }
.select-helper { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; }

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  cursor: pointer;
  margin-bottom: 16px;
}
.toggle-card input[type="checkbox"] { margin-top: 1px; }
.choice-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.toggle-desc { display: block; font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

.permission-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 720px) {
  .permission-grid { grid-template-columns: 1fr; }
}
.permission-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  cursor: pointer;
}
.permission-item input[type="checkbox"] { margin-top: 1px; }
.permission-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.permission-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.section-note { font-size: 12.5px; color: var(--text-tertiary); margin: 4px 0 18px; }

.date-wrapper { position: relative; }
.date-wrapper .date-icon {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.date-wrapper .date-icon svg, .date-wrapper .date-icon i { width: 15px; height: 15px; }

.file-upload {
  position: relative;
  border: 1.5px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  background: var(--bg-base);
  transition: border-color 150ms ease, background 150ms ease;
}
.file-upload:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.file-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-icon { color: var(--color-primary); margin-bottom: 8px; }
.file-upload-icon svg, .file-upload-icon i { width: 28px; height: 28px; }
.file-upload-text { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin: 0 0 4px; }
.file-upload-hint { font-size: 11.5px; color: var(--text-tertiary); margin: 0; }
.file-name { font-size: 12px; color: var(--text-secondary); margin-top: 8px; display: none; }
.file-name.show { display: block; }

.external-preview-panel { display: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.external-preview-panel.show { display: grid; }
.external-preview-card { border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-base); }
.external-preview-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: none; display: block; }
.external-preview-empty { font-size: 11px; color: var(--color-danger); padding: 10px; }
.external-preview-meta { font-size: 10.5px; color: var(--text-tertiary); padding: 6px 8px; word-break: break-all; }

/* ---------------- Buttons: extra variants ---------------- */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-ghost svg, .btn-ghost i { width: 16px; height: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------------- Badges / tags / status ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-soft { background: var(--bg-hover); color: var(--text-secondary); }
.badge-success, .detail-badge.success, .status-badge.filled { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.detail-badge, .result-badge, .status-badge, .sourcing-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.detail-badge.primary { background: var(--color-primary-light); color: var(--color-primary); }
.status-badge.empty, .accordion-status.empty { background: var(--bg-hover); color: var(--text-tertiary); }
.status-badge.partial { background: var(--color-warning-bg); color: var(--color-warning); }
.accordion-status.filled { background: var(--color-success-bg); color: var(--color-success); }
.result-badge.stock { background: var(--color-success-bg); color: var(--color-success); }
.result-badge.out { background: var(--color-danger-bg); color: var(--color-danger); }
.sourcing-status-badge.status-open, .sourcing-status-badge.status-running { background: var(--color-info-bg); color: var(--color-info); }
.sourcing-status-badge.status-completed, .sourcing-status-badge.status-done { background: var(--color-success-bg); color: var(--color-success); }
.sourcing-status-badge.status-failed, .sourcing-status-badge.status-error { background: var(--color-danger-bg); color: var(--color-danger); }

.perm-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.permission-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-tertiary);
}
.permission-pill.on { background: var(--color-success-bg); color: var(--color-success); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-tertiary); }
.status-dot.active { background: var(--color-success); }
.status-dot.inactive { background: var(--text-tertiary); }

/* ---------------- Action links (table row actions) ---------------- */
.action-list { display: flex; flex-wrap: wrap; gap: 6px; }
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  transition: background 150ms ease, color 150ms ease;
}
.action-link svg, .action-link i { width: 13px; height: 13px; }
.action-link:hover { background: var(--bg-active); }
.action-link.view { color: var(--color-info); }
.action-link.edit { color: var(--color-primary); }
.action-link.delete { color: var(--color-danger); }

/* ---------------- Tables ---------------- */
.user-table-wrap, .opportunity-table-wrap, .history-table-wrap, .source-table-wrap,
[class$="-table-wrap"] {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table thead th {
  text-align: start;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-base);
  white-space: nowrap;
}
table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: var(--bg-hover); }
table tbody td.empty-state { text-align: center; padding: 40px 16px; color: var(--text-tertiary); }

.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.table-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; margin: 0; }
.table-title i, .table-title svg { width: 16px; height: 16px; flex: none; }
.table-note { font-size: 11.5px; color: var(--text-tertiary); padding: 10px 20px; }
.table-header { padding: 16px 20px; border-bottom: 1px solid var(--border-light); }

.user-page, .table-card { display: block; }
.user-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.user-toolbar h1 { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.user-toolbar p { font-size: 13px; color: var(--text-tertiary); margin: 0; }
.user-main .user-name { font-weight: 700; color: var(--text-primary); }
.user-main .user-meta { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.stack-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-secondary); }
.user-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; }

/* ---------------- Pagination ---------------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.pagination-summary { font-size: 12.5px; color: var(--text-tertiary); }
.pagination-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination-current { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); padding: 0 4px; }

/* ---------------- Empty states ---------------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
}
.empty-icon { color: var(--text-tertiary); margin-bottom: 12px; opacity: 0.6; }
.empty-icon svg, .empty-icon i { width: 40px; height: 40px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin: 0 0 6px; }
.empty-text { font-size: 13px; color: var(--text-tertiary); margin: 0; }

/* ---------------- Product grid ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.product-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease, border-color 200ms ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-medium); }
.product-info { display: flex; gap: 12px; }
.product-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-tertiary);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb svg, .product-thumb i { width: 26px; height: 26px; }
.product-details { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.product-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-title span { color: var(--text-tertiary); font-weight: 400; font-size: 11.5px; }
.product-meta { font-size: 11.5px; color: var(--text-tertiary); }
.product-sku, .product-category { display: inline-flex; align-items: center; gap: 5px; }
.product-sku svg, .product-sku i, .product-category svg, .product-category i { width: 12px; height: 12px; }

.product-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-metrics.price-only, .product-metrics.stock-only { grid-template-columns: 1fr; }
.metric-box { background: var(--bg-base); border-radius: var(--radius-md); padding: 10px 12px; }
.metric-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-tertiary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.metric-title svg, .metric-title i { width: 12px; height: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); gap: 8px; }
.metric-pill { text-align: center; }
.metric-pill-label { font-size: 9.5px; color: var(--text-tertiary); text-transform: uppercase; }
.metric-pill-value { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.metric-pill-value.empty { color: var(--text-tertiary); font-weight: 400; }
.product-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.product-actions .btn { flex: 1; }

/* Row layout for the product list: one full-width row per product
   (thumb + details | price/stock | actions) instead of square cards. */
.product-grid.product-rows { display: flex; flex-direction: column; gap: 10px; }
.product-rows .product-card { flex-direction: row; align-items: center; gap: 20px; padding: 12px 16px; }
.product-rows .product-card:hover { transform: none; }
.product-rows .product-info { flex: 1 1 auto; min-width: 0; align-items: center; }
.product-rows .product-thumb { width: 56px; height: 56px; }
.product-rows .product-details { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.product-rows .product-title { flex: 1 1 100%; }
.product-rows .product-metrics { flex: none; display: flex; gap: 10px; }
.product-rows .metric-box { padding: 8px 12px; }
.product-rows .metric-title { margin-bottom: 4px; }
.product-rows .metric-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(56px, auto); gap: 14px; }
.product-rows .product-actions { flex: none; margin-top: 0; }
.product-rows .product-actions .btn { flex: none; }

@media (max-width: 1100px) {
  .product-rows .product-card { flex-wrap: wrap; }
  .product-rows .product-info { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .product-rows .product-metrics { flex-direction: column; width: 100%; }
  .product-rows .product-actions { width: 100%; }
  .product-rows .product-actions .btn { flex: 1; }
}

/* ---------------- Pricing bespoke system ---------------- */
.pricing-shell { display: flex; flex-direction: column; gap: 18px; margin-bottom: 18px; }
.pricing-hero {
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.14), transparent 45%),
    linear-gradient(155deg, #0c1550 0%, #16209c 45%, #192cb2 75%, #2b3fd6 100%);
  color: #fff;
}
.pricing-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.7); margin-bottom: 8px; }
.pricing-hero-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.pricing-hero-subtitle { font-size: 13.5px; color: rgba(255,255,255,0.78); line-height: 1.6; max-width: 640px; }
.pricing-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pricing-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  font-size: 12.5px; font-weight: 600;
}
.pricing-pill svg, .pricing-pill i { width: 14px; height: 14px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.price-field-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg-base);
  transition: border-color 150ms ease, transform 200ms cubic-bezier(0.22,1,0.36,1);
}
.price-field-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.price-field-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.price-field-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.price-field-desc { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; }
.price-field-icon {
  flex: none; width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.price-field-icon svg, .price-field-icon i { width: 16px; height: 16px; }
.price-wrapper { position: relative; }
.price-wrapper .price-currency {
  position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
}
.price-wrapper .form-input { padding-inline-end: 52px; }

/* ---------------- Choice chips ---------------- */
.choice-chip-group, .price-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.choice-chip:hover { border-color: var(--border-medium); }
.choice-chip.is-active { border-color: var(--color-primary); background: var(--color-primary-light); }
.choice-chip-icon { flex: none; color: var(--color-primary); display: flex; }
.choice-chip-icon svg, .choice-chip-icon i { width: 16px; height: 16px; }
.choice-chip-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.choice-chip-subtitle { font-size: 11px; color: var(--text-tertiary); }

/* ---------------- Accordion ---------------- */
.accordion-item { border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px; }
.accordion-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; background: var(--bg-surface); }
.accordion-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.accordion-meta { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.accordion-arrow { color: var(--text-tertiary); transition: transform 200ms ease; flex: none; }
.accordion-arrow svg, .accordion-arrow i { width: 16px; height: 16px; }
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-content { border-top: 1px solid var(--border-light); }
.accordion-body { padding: 14px 16px; font-size: 13px; color: var(--text-secondary); }

/* ---------------- Info / detail rows ---------------- */
.detail-card { padding: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.detail-card-body + .detail-card-head { margin-top: 20px; }
.detail-info-list { display: flex; flex-direction: column; }

.detail-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px 20px;
  margin-bottom: 18px;
}
.detail-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-hero-intro { min-width: 0; }
.detail-hero h1 { font-size: 21px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.detail-hero p { font-size: 13px; color: var(--text-tertiary); margin: 0; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }

.perm-group { margin-bottom: 18px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.perm-status-list { display: flex; flex-direction: column; }

.external-note {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 14px;
  line-height: 1.6;
}
.license-preview { margin-top: 18px; }
.license-preview img { max-width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border-light); margin-top: 8px; display: block; }

.info-item, .detail-info-row, .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.info-item:last-child, .detail-info-row:last-child, .meta-row:last-child { border-bottom: none; }
.info-label, .detail-label, .kv-label { color: var(--text-tertiary); font-size: 12px; }
.info-value, .detail-value { color: var(--text-primary); font-weight: 600; }

.perm-status { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 12.5px; }
.perm-status:last-child { border-bottom: none; }
.perm-status-value { font-weight: 700; font-size: 11.5px; padding: 3px 9px; border-radius: var(--radius-full); background: var(--bg-hover); color: var(--text-tertiary); }
.perm-status-value.on { background: var(--color-success-bg); color: var(--color-success); }
.perm-status-value.off { background: var(--bg-hover); color: var(--text-tertiary); }
.perm-status-value.poor { background: var(--color-danger-bg); color: var(--color-danger); }
.perm-status-value.watch { background: var(--color-warning-bg); color: var(--color-warning); }

/* ---------------- Delete confirmation ---------------- */
.delete-page { max-width: 760px; margin: 0 auto; }
.delete-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.delete-card-head { display: flex; gap: 14px; padding: 20px; border-bottom: 1px solid var(--border-light); background: var(--color-danger-bg); }
.delete-card-icon { flex: none; width: 42px; height: 42px; border-radius: var(--radius-md); background: rgba(220,38,38,0.16); color: var(--color-danger); display: flex; align-items: center; justify-content: center; }
.delete-card-icon svg, .delete-card-icon i { width: 20px; height: 20px; }
.delete-card-title { font-size: 15.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.delete-card-subtitle { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.delete-card-body { padding: 20px; }
.delete-target { background: var(--bg-base); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 16px; }
.delete-target-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 3px; }
.delete-target-value { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.dependency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.dependency-card { border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 14px; }
.dependency-title { font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.dependency-count { font-size: 11.5px; color: var(--color-danger); font-weight: 600; margin-bottom: 10px; }
.dependency-list { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.dependency-item { font-size: 11.5px; color: var(--text-secondary); padding: 4px 0; border-bottom: 1px solid var(--border-light); }
.dependency-item:last-child { border-bottom: none; }
.delete-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------------- Excel import/export ---------------- */
.excel-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.excel-stat { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 14px; text-align: center; }
.excel-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; flex-wrap: wrap; }
.excel-tab { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-tertiary); cursor: pointer; border-bottom: 2px solid transparent; }
.excel-tab.active { color: var(--color-primary); border-color: var(--color-primary); }
.excel-panel { display: none; }
.excel-panel.active { display: block; }

/* ---------------- Sourcing / warranty cards ---------------- */
.opportunity-card, .claim-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 200ms cubic-bezier(0.22,1,0.36,1), box-shadow 200ms ease;
}
.opportunity-card:hover, .claim-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.result-spec { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-secondary); }

/* ---------------- Order stage timeline ---------------- */
.order-stage-list { display: flex; flex-wrap: wrap; gap: 10px; }
.order-stage-card {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-tertiary);
}
.order-stage-card.is-done { background: var(--color-success-bg); color: var(--color-success); border-color: transparent; }
.order-stage-card.is-active { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); font-weight: 700; }

/* ---------------- Misc ---------------- */
.media-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: background 150ms ease;
}
.media-action-btn:hover { background: var(--bg-active); }
.media-action-btn svg, .media-action-btn i { width: 13px; height: 13px; }

@media (max-width: 640px) {
  .card-body, .form-card-body, .pricing-grid, .delete-card-body { padding: 16px; }
  .product-grid { grid-template-columns: 1fr; }
}

/* ---------------- Category tree ---------------- */
.tree-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.tree-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; margin: 0; }
.tree-title svg, .tree-title i { width: 17px; height: 17px; color: var(--color-primary); }
.tree-header > span { font-size: 12px; color: var(--text-tertiary); }
.tree-body { padding: 12px 20px 20px; }

.category-tree { list-style: none; margin: 0; padding: 0; }
.category-tree .category-tree { padding-inline-start: 28px; padding-top: 8px; }
.category-item { margin-top: 8px; }
.category-item:first-child { margin-top: 0; }

.category-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-base);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.category-node:hover { border-color: var(--border-medium); }
.category-node.dragging { opacity: 0.5; }
.category-node.drag-over { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }

.drag-handle { flex: none; color: var(--text-tertiary); cursor: grab; display: flex; }
.drag-handle svg, .drag-handle i { width: 15px; height: 15px; }

.toggle-btn, .toggle-placeholder { flex: none; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.toggle-btn { border: none; background: none; color: var(--text-tertiary); cursor: pointer; border-radius: 6px; transition: transform 200ms ease; }
.toggle-btn:hover { background: var(--bg-hover); }
.toggle-btn svg, .toggle-btn i { width: 15px; height: 15px; }
.toggle-btn.collapsed { transform: rotate(-90deg); }
html[dir="rtl"] .toggle-btn.collapsed { transform: rotate(90deg); }

.category-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.category-icon {
  flex: none; width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.category-icon svg, .category-icon i { width: 15px; height: 15px; }
.category-details { min-width: 0; }
.category-title-fa { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.category-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 11px; color: var(--text-tertiary); }
.category-count { display: inline-flex; align-items: center; gap: 4px; }
.category-count svg, .category-count i { width: 11px; height: 11px; }

.category-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.action-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); background: transparent; border: none; cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.action-btn svg, .action-btn i { width: 14px; height: 14px; }
.action-btn:hover { background: var(--bg-hover); }
.action-btn.add-child:hover { color: var(--color-success); }
.action-btn.edit:hover { color: var(--color-primary); }
.action-btn.delete:hover { color: var(--color-danger); }

.category-children { overflow: hidden; }
.category-children.collapsed { display: none; }

.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 600;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--text-primary);
  color: var(--bg-surface);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--color-success); color: #fff; }
.toast.error { background: var(--color-danger); color: #fff; }

/* ---------------- Price list builder ---------------- */
.price-hero {
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.14), transparent 45%),
    linear-gradient(155deg, #0c1550 0%, #16209c 45%, #192cb2 75%, #2b3fd6 100%);
  color: #fff;
}
.price-hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.price-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.price-subtitle { font-size: 13px; color: rgba(255,255,255,0.78); line-height: 1.6; max-width: 520px; }
.price-hero-tags { margin-top: 12px; }
.price-hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  font-size: 11.5px; font-weight: 600; margin-inline-end: 6px;
}
.price-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.price-stat-value { font-size: 22px; font-weight: 800; }
.price-stat > div:first-child { font-size: 11px; color: rgba(255,255,255,0.65); margin-bottom: 2px; }

.price-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.price-panel-body { padding: 20px; }
.filter-grid { display: flex; flex-direction: column; gap: 18px; }
.filter-section { display: flex; flex-direction: column; gap: 10px; }
.filter-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.filter-title svg, .filter-title i { width: 15px; height: 15px; color: var(--color-primary); }
.filter-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-search-row .input-wrapper { flex: 1; min-width: 200px; }
.filter-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.filter-inline-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-actions { min-width: 160px; }

.toggle-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle-strip .choice-chip { flex: 1; min-width: 190px; position: relative; }
.choice-chip input[type="radio"], .choice-chip input[type="checkbox"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

.selection-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.selection-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.selection-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--bg-hover); color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
}
.selection-pill.primary { background: var(--color-primary-light); color: var(--color-primary); }
.selection-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.format-select { width: auto; }

.result-list { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.result-card {
  display: block;
  position: relative;
  cursor: pointer;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px;
  padding-inline-end: 40px;
  transition: border-color 150ms ease, background 150ms ease;
}
.result-card:hover { border-color: var(--border-medium); }
.result-card:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-light); }
.result-check {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Desktop: result-body + result-side + result-media as a 3-column row.
   result-panels is a compact fallback, shown only on narrow screens. */
.result-panels { display: none; }
.result-card { display: grid; grid-template-columns: 1fr 200px 130px; gap: 16px; align-items: start; }
@media (max-width: 860px) {
  .result-card { display: block; }
  .result-panels { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .result-body, .result-side, .result-media { display: none; }
}
.result-panel-head { display: flex; gap: 12px; }
.result-thumb, .category-thumb {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius-md);
  background: var(--bg-base); display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--text-tertiary);
}
.result-thumb img, .category-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-thumb svg, .result-thumb i, .category-thumb svg, .category-thumb i { width: 22px; height: 22px; }
.result-panel-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.result-panel-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.result-sku-line { display: flex; gap: 12px; font-size: 11px; color: var(--text-tertiary); flex-wrap: wrap; }
.result-panel-note {
  font-size: 11.5px; color: var(--text-tertiary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stack-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.result-specs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.result-specs.compact { font-size: 11.5px; }
.result-spec { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.result-spec svg, .result-spec i { width: 13px; height: 13px; color: var(--text-tertiary); flex: none; }
.price-box { background: var(--bg-base); border-radius: var(--radius-md); padding: 8px 12px; }
.price-box-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; }
.price-box-value { font-size: 15px; font-weight: 800; color: var(--color-primary); }
.price-box-caption { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

/* Desktop three-column result row */
.result-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.result-overline { display: flex; flex-wrap: wrap; gap: 6px; }
.result-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.result-summary {
  font-size: 11.5px; color: var(--text-tertiary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.result-side { display: flex; flex-direction: column; gap: 8px; }
.result-media { display: flex; gap: 10px; }
.result-media-stack { text-align: center; }
.result-media-label { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; }

/* ============================================================
   Product Manage / Product Detail pages
   ============================================================ */
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.text-muted { color: var(--text-tertiary); font-size: 12.5px; }

.page-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.sku-badge, .category-badge, .date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.sku-badge { background: var(--color-primary-light); color: var(--color-primary); font-family: "SFMono-Regular", Consolas, monospace; }
.date-badge svg, .date-badge i { width: 12px; height: 12px; }

/* ---- Section cards (product manage) ---- */
.section-grid { display: flex; flex-direction: column; gap: 16px; }
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.section-title svg, .section-title i { width: 17px; height: 17px; color: var(--color-primary); }
.section-body { padding: 20px; }
.section-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  padding: 3px 9px;
}
.media-bulk-bar { align-items: center; }

/* ---- Info grid (key/value pairs) ---- */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.info-grid-2 { grid-template-columns: repeat(2, 1fr); }
.info-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .info-grid, .info-grid-2, .info-grid-4 { grid-template-columns: 1fr; }
}
.info-value.empty { color: var(--text-tertiary); font-weight: 500; font-style: italic; }

/* ---- Price grid / cards (read-only display) ---- */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) {
  .price-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .price-grid { grid-template-columns: 1fr; }
}
.price-card {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.price-label { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 6px; }
.price-value { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.price-value.empty { color: var(--text-tertiary); font-weight: 500; font-size: 15px; }
.price-currency { font-size: 11px; font-weight: 600; color: var(--text-tertiary); }

/* ---- Translations ---- */
.translation-list { display: flex; flex-direction: column; gap: 10px; }
.translation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.translation-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lang-flag { font-size: 22px; flex: none; }
.lang-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lang-name { font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; }
.lang-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.lang-colors { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-tertiary); }
.lang-colors svg, .lang-colors i { width: 12px; height: 12px; }
.translation-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Media grid (manage page) ---- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item, .media-thumb {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-base);
  aspect-ratio: 1 / 1;
  cursor: pointer;
}
.media-item img, .media-thumb img,
.media-item video, .media-thumb video,
.media-item iframe, .media-thumb iframe { width: 100%; height: 100%; object-fit: cover; border: none; display: block; }
.media-item.dragging { opacity: 0.5; }
.media-item.drag-over { outline: 2px dashed var(--color-primary); outline-offset: -2px; }
.media-thumb > div { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-tertiary); }
.play-icon { width: 28px; height: 28px; }
.media-select { position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; }
.media-order, .media-type, .media-type-badge {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}
.media-order { top: 6px; inset-inline-end: 6px; }
.media-type, .media-type-badge { bottom: 6px; inset-inline-end: 6px; }
.media-type { z-index: 3; min-width: 28px; text-align: center; }
.media-primary-badge, .media-cache-badge {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
}
.media-cache-badge { background: var(--color-success); }
.media-badges-overlay {
  position: absolute;
  inset-inline-start: 6px;
  bottom: 6px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  /* Keep the role badges clear of the IMG/VID badge on the opposite side. */
  max-width: calc(100% - 58px);
  pointer-events: none;
}
.media-badges-overlay .media-primary-badge,
.media-badges-overlay .media-cache-badge {
  position: static !important;
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-item .media-actions, .media-thumb .media-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  box-sizing: border-box;
  flex-wrap: wrap;
  align-content: center;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 150ms ease;
}
.media-item:hover .media-actions, .media-thumb:hover .media-actions { opacity: 1; }
.media-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--text-primary);
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}
.media-action-btn svg, .media-action-btn i { width: 14px; height: 14px; }
.media-action-btn.delete { color: var(--color-danger); }

/* Keep the image clean; status labels live in a dedicated footer row. */
.media-grid .media-item {
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 32px;
  align-items: center;
  overflow: hidden;
}
.media-grid .media-item > img,
.media-grid .media-item > video,
.media-grid .media-item > iframe {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  flex: none;
}
.media-grid .media-item > .media-type {
  position: static;
  grid-column: 2;
  grid-row: 2;
  margin: 6px;
  justify-self: end;
}
.media-grid .media-item > .media-badges-overlay {
  position: static;
  grid-column: 1;
  grid-row: 2;
  max-width: none;
  min-width: 0;
  margin: 6px;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  white-space: nowrap;
}
.media-grid .media-item > .media-badges-overlay::-webkit-scrollbar { display: none; }
.media-grid .media-item > .media-badges-overlay .media-primary-badge,
.media-grid .media-item > .media-badges-overlay .media-cache-badge {
  position: static !important;
}
.media-grid .media-item > .media-actions {
  z-index: 5;
  inset: 0 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, 30px);
  justify-content: center;
  align-content: center;
  gap: 5px;
}
.media-grid .media-item > .media-actions form { display: contents; }

/* ---- Documents ---- */
.document-list { display: flex; flex-direction: column; gap: 8px; }
.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.document-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.document-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.document-icon svg, .document-icon i { width: 18px; height: 18px; }
.document-details { min-width: 0; }
.document-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); word-break: break-word; }
.document-type { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.document-actions { display: flex; align-items: center; gap: 6px; }

.documents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.document-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color 150ms ease, background 150ms ease;
}
.document-card:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.document-card svg, .document-card i { width: 14px; height: 14px; flex: none; color: var(--text-tertiary); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon svg, .btn-icon i { width: 15px; height: 15px; }

/* ---- Features / long text ---- */
.features-list { display: flex; flex-direction: column; gap: 8px; }
.feature-item {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  font-size: 13px;
  color: var(--text-secondary);
}
.long-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; white-space: pre-wrap; }

/* ---- Modal (delete confirm) ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 90;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 91;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.modal-title svg, .modal-title i { width: 18px; height: 18px; color: var(--color-danger); }
.modal-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Lightbox (product detail media) ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 200;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-content { max-width: 90vw; max-height: 85vh; display: flex; align-items: center; justify-content: center; }
.lightbox-content img, .lightbox-content video { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius-md); }
.lightbox-content iframe { width: min(90vw, 900px); height: min(70vh, 600px); border: none; border-radius: var(--radius-md); }
.lightbox-close, .lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-close svg, .lightbox-close i,
.lightbox-nav svg, .lightbox-nav i { width: 20px; height: 20px; }
.lightbox-close { top: 20px; inset-inline-end: 20px; }
.lightbox-prev { inset-inline-start: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { inset-inline-end: 20px; top: 50%; transform: translateY(-50%); }

.accordion-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
  padding: 3px 9px;
}

/* ============================================================
   Excel import / export pages
   ============================================================ */
.excel-page, .excel-shell, .excel-default-page { max-width: 1080px; margin: 0 auto; }

.excel-hero, .excel-default-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.excel-hero-top, .excel-default-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
/* Advanced Excel page's hero has nothing to balance against on the other
   side, so its icon + title sit together at the start of the row instead
   of being pushed to opposite ends. */
.excel-hero-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.excel-hero-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.excel-hero-icon svg, .excel-hero-icon i { width: 22px; height: 22px; }
.excel-hero h1, .excel-title, .excel-default-title { font-size: 19px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.excel-hero p, .excel-subtitle, .excel-default-subtitle { font-size: 13px; color: var(--text-tertiary); margin: 0; line-height: 1.6; }
.excel-default-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.excel-stats, .excel-default-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.excel-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  padding: 6px 12px;
}
.excel-stat svg, .excel-stat i { width: 13px; height: 13px; color: var(--color-primary); }
.excel-default-stat, .excel-stat {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.excel-default-stat {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border-radius: var(--radius-full);
}
.excel-default-stat-label, .excel-stat-label { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; }
.excel-default-stat-value, .excel-stat-value { font-size: 14px; font-weight: 700; color: var(--text-primary); }

.excel-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.excel-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.excel-tab svg, .excel-tab i { width: 15px; height: 15px; }
.excel-tab.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.excel-panel { display: none; }
.excel-panel.active { display: block; }
.excel-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.excel-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.excel-panel-title { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.excel-panel-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.excel-panel-icon.import { background: var(--color-success-bg); color: var(--color-success); }
.excel-panel-icon svg, .excel-panel-icon i { width: 16px; height: 16px; }
.excel-panel-body { padding: 20px; }
.excel-panel-copy { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }

.excel-default-grid, .excel-shell .variant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 800px) {
  .excel-default-grid, .excel-shell .variant-grid { grid-template-columns: 1fr; }
}

.excel-feature-list, .variant-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.excel-feature, .variant-feature { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.excel-feature svg, .excel-feature i,
.variant-feature svg, .variant-feature i { width: 14px; height: 14px; color: var(--color-success); flex: none; }

.excel-file-box, .file-box {
  border: 1.5px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-base);
}
.excel-file-title, .file-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.excel-file-meta, .file-meta { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 10px; }
.excel-input { width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: var(--radius-md); border: 1.5px solid var(--border-light); background: var(--bg-surface); color: var(--text-primary); font-size: 13px; }
.excel-submit-row, .action-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }

.excel-advanced-note, .advanced-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
}
.excel-advanced-copy, .advanced-copy { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }

.variant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 800px) { .variant-grid { grid-template-columns: 1fr; } }
.variant-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.variant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.variant-title { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.variant-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.variant-icon svg, .variant-icon i { width: 15px; height: 15px; }
.variant-body { padding: 20px; }
.variant-copy { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }

/* ---- Advanced excel (tab/section builder) ---- */
.select-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.selected-count { font-size: 12.5px; color: var(--text-secondary); }
.selected-count strong { color: var(--color-primary); font-size: 14px; }

.toggle-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--border-medium);
  transition: background 150ms ease;
  flex: none;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}
.toggle-switch input:checked + .toggle-track { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(16px); }
[dir="rtl"] .toggle-switch input:checked + .toggle-track::after { transform: translateX(-16px); }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.excel-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.excel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-surface);
  cursor: pointer;
  flex-wrap: wrap;
}
.excel-section-title { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.excel-section-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--color-primary);
}
.excel-section-icon svg, .excel-section-icon i { width: 16px; height: 16px; }
.excel-section-icon.icon-blue { background: #3b82f6; }
.excel-section-icon.icon-green { background: #16a34a; }
.excel-section-icon.icon-purple { background: #8b5cf6; }
.excel-section-icon.icon-orange { background: #f97316; }
.excel-section-icon.icon-indigo { background: #6366f1; }
.excel-section-icon.icon-teal { background: #14b8a6; }
.excel-section-count { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.excel-section-controls { display: flex; align-items: center; gap: 12px; }
.excel-section-chevron { color: var(--text-tertiary); transition: transform 200ms ease; }
.excel-section.collapsed .excel-section-chevron { transform: rotate(-90deg); }
.excel-section.collapsed .excel-section-body { display: none; }
.excel-section-body { padding: 18px; border-top: 1px solid var(--border-light); }

.lang-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; color: var(--text-tertiary); }
.lang-pills > span { display: flex; align-items: center; gap: 5px; }
.lang-pill { cursor: pointer; }
.lang-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.lang-pill-body {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-light);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.lang-pill-body svg, .lang-pill-body i { width: 11px; height: 11px; display: none; }
.lang-pill input:checked + .lang-pill-body { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); }
.lang-pill input:checked + .lang-pill-body svg,
.lang-pill input:checked + .lang-pill-body i { display: inline-block; }

.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fancy-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-md); cursor: pointer; }
.fancy-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.fancy-check-box {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-top: 1px;
}
.fancy-check-box svg { width: 12px; height: 12px; opacity: 0; }
.fancy-check input:checked ~ .fancy-check-box { background: var(--color-primary); border-color: var(--color-primary); }
.fancy-check input:checked ~ .fancy-check-box svg { opacity: 1; }
.fancy-check-label { font-size: 12.5px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; }
.fancy-check-key { font-size: 10.5px; color: var(--text-tertiary); font-family: "SFMono-Regular", Consolas, monospace; }

.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px;
}
.help-tip { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-tertiary); max-width: 560px; }
.help-tip svg, .help-tip i { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--color-primary); }
.excel-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  color: #fff;
}
.btn-export { background: var(--color-primary); }
.btn-import { background: var(--color-success); }

.drop-zone {
  position: relative;
  border: 1.5px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-base);
  transition: border-color 150ms ease, background 150ms ease;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--color-primary); background: var(--color-primary-light); }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone-icon { color: var(--color-primary); margin-bottom: 10px; }
.drop-zone-icon svg, .drop-zone-icon i { width: 32px; height: 32px; }
.drop-zone-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.drop-zone-subtitle { font-size: 12px; color: var(--text-tertiary); }
.drop-zone-file-info { display: none; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--color-success); font-weight: 600; }
.drop-zone-file-info.visible { display: flex; }
.drop-zone-file-info svg, .drop-zone-file-info i { width: 14px; height: 14px; }

/* ============================================================
   Page section builder (product_section_form.html and friends)
   ============================================================ */
.hidden { display: none !important; }

.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) {
  .builder-layout { grid-template-columns: 1fr; }
}

/* Checkbox styled as a field: same box as .form-input, with a custom tick. */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 9px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  cursor: pointer;
  user-select: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.checkbox-wrapper:hover { border-color: color-mix(in srgb, var(--color-primary) 45%, var(--border-light)); }
.checkbox-wrapper:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.checkbox-wrapper:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--color-primary-light); border-color: var(--color-primary); }
/* True/false inputs render as a gradient toggle switch (off = grey track,
   knob at the start; on = teal-to-blue gradient, knob at the end). Item
   *selection* checkboxes (bulk rows, export columns, value chips) stay square. */
.switch,
input[type="checkbox"].switch,
.checkbox-wrapper input[type="checkbox"],
.toggle-card input[type="checkbox"],
.permission-item input[type="checkbox"],
.variant-move-warning input[type="checkbox"],
.dim-image-clear input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d5dbe6;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.switch::before,
input[type="checkbox"].switch::before,
.checkbox-wrapper input[type="checkbox"]::before,
.toggle-card input[type="checkbox"]::before,
.permission-item input[type="checkbox"]::before,
.variant-move-warning input[type="checkbox"]::before,
.dim-image-clear input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.28);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.switch:checked,
input[type="checkbox"].switch:checked,
.checkbox-wrapper input[type="checkbox"]:checked,
.toggle-card input[type="checkbox"]:checked,
.permission-item input[type="checkbox"]:checked,
.variant-move-warning input[type="checkbox"]:checked,
.dim-image-clear input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #7cf0b2 0%, #63c6c4 48%, #5b8def 100%);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
.switch:checked::before,
input[type="checkbox"].switch:checked::before,
.checkbox-wrapper input[type="checkbox"]:checked::before,
.toggle-card input[type="checkbox"]:checked::before,
.permission-item input[type="checkbox"]:checked::before,
.variant-move-warning input[type="checkbox"]:checked::before,
.dim-image-clear input[type="checkbox"]:checked::before { transform: translateX(20px); }
[dir="rtl"] .switch:checked::before,
[dir="rtl"] input[type="checkbox"].switch:checked::before,
[dir="rtl"] .checkbox-wrapper input[type="checkbox"]:checked::before,
[dir="rtl"] .toggle-card input[type="checkbox"]:checked::before,
[dir="rtl"] .permission-item input[type="checkbox"]:checked::before,
[dir="rtl"] .variant-move-warning input[type="checkbox"]:checked::before,
[dir="rtl"] .dim-image-clear input[type="checkbox"]:checked::before { transform: translateX(-20px); }
.switch:focus-visible,
input[type="checkbox"].switch:focus-visible,
.checkbox-wrapper input[type="checkbox"]:focus-visible,
.toggle-card input[type="checkbox"]:focus-visible,
.permission-item input[type="checkbox"]:focus-visible,
.variant-move-warning input[type="checkbox"]:focus-visible,
.dim-image-clear input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-primary-light); }
.switch:disabled,
input[type="checkbox"].switch:disabled,
.checkbox-wrapper input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }
[data-theme="dark"] .switch:not(:checked),
[data-theme="dark"] input[type="checkbox"].switch:not(:checked),
[data-theme="dark"] .checkbox-wrapper input[type="checkbox"]:not(:checked),
[data-theme="dark"] .toggle-card input[type="checkbox"]:not(:checked),
[data-theme="dark"] .permission-item input[type="checkbox"]:not(:checked),
[data-theme="dark"] .variant-move-warning input[type="checkbox"]:not(:checked),
[data-theme="dark"] .dim-image-clear input[type="checkbox"]:not(:checked) { background: rgba(255, 255, 255, 0.16); }
.dim-image-clear input[type="checkbox"] { width: 34px; height: 20px; }
.dim-image-clear input[type="checkbox"]::before { top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; }
.dim-image-clear input[type="checkbox"]:checked::before { transform: translateX(14px); }
[dir="rtl"] .dim-image-clear input[type="checkbox"]:checked::before { transform: translateX(-14px); }
.checkbox-label { font-size: 13.5px; color: var(--text-primary); font-weight: 600; }
.checkbox-wrapper:has(input:checked) .checkbox-label { color: var(--color-primary); }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.style-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.style-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.style-card.selected, .style-card:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.style-preview {
  display: flex;
  gap: 4px;
  height: 44px;
  background: var(--bg-base);
  border-radius: 6px;
  padding: 6px;
}
.style-preview span { flex: 1; background: var(--border-medium); border-radius: 4px; }
.style-name { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.style-desc { font-size: 11px; color: var(--text-tertiary); line-height: 1.4; }

.source-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 640px) { .source-options { grid-template-columns: 1fr; } }
.source-card {
  display: block;
  padding: 14px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.source-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.source-card.selected, .source-card:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.source-card-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.source-card-desc { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.5; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.image-item {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: var(--bg-base);
}
.image-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-item.selected, .image-item.added { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.image-item.uploading { opacity: 0.5; }
.pick-check {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.pick-check svg, .pick-check i { width: 12px; height: 12px; }
.image-item.selected .pick-check, .image-item.added .pick-check { opacity: 1; background: var(--color-primary); }
.image-remove-btn {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.image-remove-btn svg, .image-remove-btn i { width: 12px; height: 12px; }
.pick-spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.7); font-size: 11px; color: var(--text-secondary); }

.media-pick { display: block; position: relative; border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; }
.media-pick img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.media-pick button {
  width: 100%;
  padding: 8px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Live preview panel ---- */
.preview-panel {
  position: sticky;
  top: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.preview-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.preview-panel-head svg, .preview-panel-head i { width: 15px; height: 15px; color: var(--color-primary); }
.preview-frame { padding: 20px; font-size: 13px; color: var(--text-secondary); min-height: 160px; }
.pv-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.pv-empty { color: var(--text-tertiary); font-size: 12.5px; font-style: italic; }
.pv-img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-size: 11.5px;
  overflow: hidden;
}
.pv-img-box img { width: 100%; height: 100%; object-fit: cover; }
.pv-row { display: flex; gap: 10px; margin-bottom: 10px; }
.pv-row.wrap { flex-wrap: wrap; }
.pv-card { flex: 1; min-width: 100px; background: var(--bg-base); border-radius: var(--radius-md); padding: 10px 12px; font-size: 12px; }
.pv-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.pv-faq-item { padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.pv-faq-q { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pv-table td, .pv-table th { padding: 6px 8px; border-bottom: 1px solid var(--border-light); text-align: start; }

/* ---- Section type picker ---- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.type-card {
  display: block;
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, transform 150ms ease;
  color: inherit;
}
.type-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.type-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.type-card-icon svg, .type-card-icon i { width: 18px; height: 18px; }
.type-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.type-card-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }

/* ============================================================
   Order builder page
   ============================================================ */
.order-builder-page { display: flex; flex-direction: column; gap: 18px; }
.order-builder-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.order-builder-hero h1 { font-size: 19px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.order-builder-hero p { font-size: 13px; color: var(--text-tertiary); margin: 0; max-width: 480px; line-height: 1.6; }
.order-builder-overview { display: flex; gap: 20px; flex-wrap: wrap; }
.order-builder-stat { text-align: center; }
.order-builder-stat-value { font-size: 22px; font-weight: 800; color: var(--color-primary); }
.order-builder-stat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.order-builder-tools {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.order-builder-search { display: flex; flex-direction: column; gap: 6px; }
.order-builder-search label { font-size: 12.5px; font-weight: 600; }
.order-builder-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13.5px;
}
.order-builder-search input:focus { outline: none; border-color: var(--color-primary); background: var(--bg-surface); box-shadow: 0 0 0 3px var(--color-primary-light); }

.category-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.category-picker-clear {
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#categoryPicker .category-tree { display: flex; flex-direction: column; gap: 6px; }
.category-node-row { display: flex; align-items: center; gap: 6px; }
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}
.category-chip.active { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); }
.category-chip-check { opacity: 0; font-size: 11px; }
.category-chip.active .category-chip-check { opacity: 1; }
.category-chip-child { margin-inline-start: 20px; }
.category-chip-select-all { font-style: italic; }
.category-expand {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms ease;
}
.category-expand svg, .category-expand i { width: 13px; height: 13px; }
.category-expand.is-expanded { transform: rotate(180deg); }
.category-expand-spacer { width: 26px; flex: none; }
#categoryPicker .category-children { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

.order-builder-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.order-builder-meta #filterSummary { font-size: 12.5px; color: var(--text-tertiary); }

.order-builder-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
}
.order-builder-prompt svg, .order-builder-prompt i { width: 26px; height: 26px; }

.order-builder-shell.is-loading { opacity: 0.5; pointer-events: none; }
.order-builder-list { display: flex; flex-direction: column; gap: 12px; }
.order-empty { text-align: center; padding: 30px; color: var(--text-tertiary); font-size: 13px; }

.order-builder-item {
  display: grid;
  grid-template-columns: 72px 1.4fr 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
@media (max-width: 800px) {
  .order-builder-item { grid-template-columns: 60px 1fr; }
}
.order-item-media { width: 72px; height: 72px; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-base); flex: none; }
.order-item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.order-item-category { font-size: 10.5px; font-weight: 700; color: var(--color-primary); text-transform: uppercase; }
.order-item-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.order-item-sku { font-size: 11.5px; color: var(--text-tertiary); font-family: "SFMono-Regular", Consolas, monospace; }
.order-item-feature { font-size: 11.5px; color: var(--text-secondary); }
.order-item-prices { display: flex; flex-wrap: wrap; gap: 8px; }
.order-price-card { background: var(--bg-base); border-radius: var(--radius-md); padding: 6px 10px; text-align: center; }
.order-price-label { font-size: 9.5px; color: var(--text-tertiary); text-transform: uppercase; }
.order-price-value { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.order-item-qty { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.order-item-qty-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-tertiary); }
.order-item-qty-in-cart { font-size: 10.5px; font-weight: 700; color: var(--color-success); background: var(--color-success-bg); border-radius: var(--radius-full); padding: 2px 8px; }
.order-item-qty input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13.5px;
}
.order-item-min-order, .order-item-cart-note { font-size: 10px; color: var(--text-tertiary); }

.order-builder-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.order-builder-submit-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.order-builder-submit-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.order-builder-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Sourcing pages (dashboard, opportunity list/detail)
   ============================================================ */
.sourcing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
}
.sourcing-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sourcing-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sourcing-status-row > div { display: flex; align-items: center; gap: 10px; }

.progress-track { height: 8px; border-radius: var(--radius-full); background: var(--bg-hover); overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width 300ms ease; width: 0; }
.progress-label { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 16px; }

.stage-checklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.stage-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-md); font-size: 12.5px; color: var(--text-tertiary); background: var(--bg-base); }
.stage-row.state-done { color: var(--color-success); }
.stage-row.state-active { color: var(--color-primary); background: var(--color-primary-light); font-weight: 600; }
.stage-icon { flex: none; width: 18px; text-align: center; font-weight: 700; }
.stage-percent { margin-inline-start: auto; font-weight: 700; }

.sourcing-meta-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.sourcing-meta-item { text-align: center; }
.sourcing-meta-value { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.sourcing-meta-label { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.source-checklist { display: flex; flex-wrap: wrap; gap: 8px; }
.source-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; background: var(--bg-hover); color: var(--text-tertiary); }
.source-chip.source-state-done { background: var(--color-success-bg); color: var(--color-success); }
.source-chip.source-state-active { background: var(--color-primary-light); color: var(--color-primary); }
.source-chip.source-state-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.source-chip.source-state-failed { background: var(--color-danger-bg); color: var(--color-danger); }

.filters-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters-row .form-input { width: auto; min-width: 180px; }
.pagination-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

.score-pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); }
.score-pill.score-high { background: var(--color-success-bg); color: var(--color-success); }
.score-pill.score-mid { background: var(--color-warning-bg); color: var(--color-warning); }
.score-pill.score-low { background: var(--color-danger-bg); color: var(--color-danger); }
.status-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; background: var(--bg-hover); color: var(--text-secondary); }

.opportunity-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.kv-row:last-child { border-bottom: none; }

.overview-bar-row { display: flex; flex-direction: column; gap: 6px; }
.overview-bar-heading { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); }
.component-bar-track { position: relative; display: block; height: 8px; border-radius: var(--radius-full); background: var(--bg-hover); overflow: hidden; }
.component-bar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--color-primary); border-radius: var(--radius-full); }
.component-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.component-label { flex: 0 0 140px; font-size: 12px; color: var(--text-secondary); }
.component-value { flex: none; font-size: 12.5px; font-weight: 700; color: var(--text-primary); width: 34px; text-align: end; }

.kpi-header { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.kpi-score-badge {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.kpi-score-badge.band-strong, .kpi-score-badge.band-good { background: var(--color-success-bg); color: var(--color-success); }
.kpi-score-badge.band-moderate, .kpi-score-badge.band-fair { background: var(--color-warning-bg); color: var(--color-warning); }
.kpi-score-badge.band-weak, .kpi-score-badge.band-poor { background: var(--color-danger-bg); color: var(--color-danger); }

.recommendation-verdict { font-size: 14px; font-weight: 700; color: var(--text-primary); padding: 10px 14px; border-radius: var(--radius-md); background: var(--bg-hover); }
.recommendation-verdict.verdict-go, .recommendation-verdict.verdict-strong { background: var(--color-success-bg); color: var(--color-success); }
.recommendation-verdict.verdict-no-go, .recommendation-verdict.verdict-avoid { background: var(--color-danger-bg); color: var(--color-danger); }
.reco-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }

.attr-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attr-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; background: var(--bg-hover); color: var(--text-secondary); }

.status-form { display: flex; gap: 8px; flex-wrap: wrap; }

.scenario-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 560px) { .scenario-form { grid-template-columns: 1fr; } }
.scenario-error { font-size: 12px; color: var(--color-danger); margin-top: 8px; }
.scenario-result { display: none; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.scenario-result.visible { display: block; }
.scenario-score-row { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.scenario-score-block { text-align: center; }
.scenario-score-value { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.scenario-score-label { font-size: 10.5px; color: var(--text-tertiary); margin-top: 2px; }
.scenario-change-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full); background: var(--bg-hover); color: var(--text-secondary); }
.scenario-change-badge.scenario-change-positive { background: var(--color-success-bg); color: var(--color-success); }
.scenario-change-badge.scenario-change-negative { background: var(--color-danger-bg); color: var(--color-danger); }
.scenario-changed-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }

/* ============================================================
   Main dashboard
   ============================================================ */
.dashboard-page { display: flex; flex-direction: column; gap: 20px; }

.dashboard-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), #6b7ef2);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  color: #fff;
}
.dashboard-hero-orbit { position: absolute; inset: 0; pointer-events: none; opacity: 0.25; }
.dashboard-hero-orbit span {
  position: absolute;
  border: 1.5px solid #fff;
  border-radius: 50%;
}
.dashboard-hero-orbit span:first-child { width: 260px; height: 260px; top: -80px; inset-inline-end: -60px; }
.dashboard-hero-orbit span:last-child { width: 160px; height: 160px; bottom: -60px; inset-inline-end: 60px; }
.dashboard-hero-content { position: relative; z-index: 1; }
.dashboard-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; margin-bottom: 10px; }
.dashboard-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25); }
.dashboard-hero h1 { font-size: 23px; font-weight: 800; margin: 0 0 6px; }
.dashboard-hero p { font-size: 13.5px; opacity: 0.9; margin: 0; max-width: 560px; line-height: 1.6; }
.dashboard-overview-link { color: #fff; text-decoration: underline; text-underline-offset: 2px; margin-inline-start: 6px; opacity: 0.95; }
.dashboard-overview-link:hover { opacity: 1; }

.dashboard-overview { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.dashboard-overview-card { background: rgba(255,255,255,0.14); border-radius: var(--radius-md); padding: 12px 18px; }
.dashboard-overview-value { font-size: 20px; font-weight: 800; }
.dashboard-overview-label { font-size: 11px; opacity: 0.85; margin-top: 2px; }

.dashboard-badges { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.dashboard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}
.dashboard-badge svg, .dashboard-badge i { width: 13px; height: 13px; }
a.dashboard-badge:hover { background: rgba(255,255,255,0.28); }

/* ---- Accent color tokens for icon chips ---- */
.c-violet { background: #ede9fe; color: #7c3aed; }
.c-amber { background: #fef3c7; color: #b45309; }
.c-slate { background: #e2e8f0; color: #475569; }
.c-teal { background: #ccfbf1; color: #0f766e; }
.c-rose { background: #ffe4e6; color: #be123c; }
.c-green { background: var(--color-success-bg); color: var(--color-success); }
.c-cyan { background: #cffafe; color: #0e7490; }
.c-pink { background: #fce7f3; color: #be185d; }
:root[data-theme="dark"] .c-violet, :root:not([data-theme="light"]) .dashboard-page .c-violet { background: rgba(124,58,237,0.22); }

/* ---- Customer (external user) dashboard ---- */
.customer-dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 960px) { .customer-dashboard-grid { grid-template-columns: 1fr; } }
.customer-insight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.customer-insight-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.customer-insight-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.customer-insight-copy { font-size: 12px; color: var(--text-tertiary); line-height: 1.6; margin: 0; }
.customer-insight-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.customer-insight-icon svg, .customer-insight-icon i { width: 19px; height: 19px; }

.customer-finance-banner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 640px) { .customer-finance-banner { grid-template-columns: 1fr; } }
.customer-finance-pill { background: var(--bg-base); border-radius: var(--radius-md); padding: 12px 14px; }
.customer-finance-pill.warning { background: var(--color-warning-bg); }
.customer-finance-pill.danger { background: var(--color-danger-bg); }
.customer-finance-pill.success { background: var(--color-success-bg); }
.customer-finance-label { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; margin-bottom: 4px; }
.customer-finance-value { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.customer-finance-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

.customer-cheque-list, .customer-order-list { display: flex; flex-direction: column; gap: 10px; }
.customer-cheque-item, .customer-order-item { border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 12px 14px; }
.customer-cheque-head, .customer-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.customer-cheque-title, .customer-order-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.customer-cheque-sub, .customer-order-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.customer-cheque-meta, .customer-order-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--text-secondary); }
.customer-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 10.5px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); }
.customer-tag.success { background: var(--color-success-bg); color: var(--color-success); }
.customer-tag.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.customer-tag.danger { background: var(--color-danger-bg); color: var(--color-danger); }
.customer-progress { height: 6px; border-radius: var(--radius-full); background: var(--bg-hover); margin-bottom: 8px; overflow: hidden; }
.customer-progress span { display: block; height: 100%; width: 50%; background: var(--color-primary); border-radius: var(--radius-full); }

.customer-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; margin-bottom: 16px; }
.customer-status-card { text-align: center; background: var(--bg-base); border-radius: var(--radius-md); padding: 12px 8px; }
.customer-status-count { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.customer-status-label { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

.dashboard-card-empty { text-align: center; padding: 24px; color: var(--text-tertiary); font-size: 12.5px; }

/* ---- Charts + section cards grid ---- */
.dashboard-charts-grid, .dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .dashboard-charts-grid, .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .dashboard-charts-grid, .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dashboard-chart-card { grid-column: span 1; }
.dashboard-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dashboard-card-title-wrap h2 { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin: 0 0 3px; }
.dashboard-card-title-wrap p { font-size: 11px; color: var(--text-tertiary); margin: 0; line-height: 1.5; }
.dashboard-card-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.dashboard-card-icon svg, .dashboard-card-icon i { width: 16px; height: 16px; }

.dchart-canvas { min-height: 220px; width: 100%; }
.dchart-dual { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .dchart-dual { grid-template-columns: 1fr; } }
.dchart-dual-title { display: block; font-size: 11px; font-weight: 700; color: var(--text-tertiary); margin-bottom: 6px; }
.dchart-dual-item .dchart-canvas { min-height: 160px; }

.dashboard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.dashboard-list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-light); }
.dashboard-list-item:last-child { border-bottom: none; }
.dashboard-list-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dashboard-list-item-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.dashboard-list-item-sub { font-size: 11px; color: var(--text-tertiary); }
.dashboard-severity { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-full); background: var(--color-warning-bg); color: var(--color-warning); flex: none; }
.dashboard-severity svg, .dashboard-severity i { width: 11px; height: 11px; }
.dashboard-severity.critical { background: var(--color-danger-bg); color: var(--color-danger); }

.dashboard-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.dashboard-stat-value { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.dashboard-stat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.dashboard-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.dashboard-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}
.dashboard-action:hover { background: var(--color-primary-light); color: var(--color-primary); }
.dashboard-action svg, .dashboard-action i { width: 14px; height: 14px; }

/* ============================================================
   Small remaining pages: customer profile, audit log, warehouse,
   product variants, translation form, sku labels
   ============================================================ */
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.customer-page { max-width: 900px; margin: 0 auto; }
.customer-hero { margin-bottom: 18px; }
.customer-hero h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.customer-hero p { font-size: 13px; color: var(--text-tertiary); line-height: 1.6; margin: 0; }
.customer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.customer-body { display: flex; flex-direction: column; gap: 18px; }
.permission-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-box { padding: 14px; border-radius: var(--radius-md); background: var(--bg-base); }
.preview-box strong { display: block; font-size: 12.5px; color: var(--text-primary); margin-bottom: 8px; }
.preview-box img { max-width: 220px; border-radius: var(--radius-md); border: 1px solid var(--border-light); }

.audit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.audit-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.audit-toolbar input, .audit-toolbar select { width: auto; min-width: 150px; }
.model-label { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.model-subtle { font-size: 11px; color: var(--text-tertiary); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 12.5px; color: var(--text-secondary); }

.summary-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.summary-card { flex: 1; min-width: 140px; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px 18px; }
.summary-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.summary-value { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form input {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13px;
  min-width: 220px;
}
.quantity-input {
  width: 100px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13.5px;
}

/* ---------------- Warehouse stock entry (sticky save bar) ---------------- */
.stock-save-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.stock-save-bar .table-note { padding: 0; flex: 1; }
.stock-table .product-title { margin-bottom: 4px; }
.stock-damaged-input:not([value="0"]) { border-color: var(--color-danger); color: var(--color-danger); }
.stock-sellable-value { font-weight: 700; color: var(--color-success); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
.country-badge { display: inline-flex; padding: 3px 9px; border-radius: var(--radius-full); background: var(--bg-hover); color: var(--text-secondary); font-size: 11.5px; font-weight: 600; }
.muted { color: var(--text-tertiary); }

/* ---------------- Warehouse shipments ---------------- */
.shipment-route-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 14px;
  align-items: end;
}
.shipment-route-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  flex: none;
}
.shipment-route-arrow svg, .shipment-route-arrow i { width: 16px; height: 16px; }
.shipment-route-submit { white-space: nowrap; }
@media (max-width: 700px) {
  .shipment-route-picker { grid-template-columns: 1fr; }
  .shipment-route-arrow { transform: rotate(90deg); justify-self: center; }
}
.shipment-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}
.shipment-route-chip .shipment-route-code { padding: 2px 8px; border-radius: var(--radius-full); background: var(--bg-hover); }
.shipment-route-chip svg, .shipment-route-chip i { width: 14px; height: 14px; color: var(--text-tertiary); }

.variant-wrap { display: flex; flex-direction: column; gap: 16px; }
.variant-wrap > .variant-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.variant-wrap > .variant-card h2 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.variant-wrap > .variant-card h2 svg, .variant-wrap > .variant-card h2 i { width: 16px; height: 16px; color: var(--color-primary); }
.variant-wrap > .variant-card p { font-size: 12.5px; color: var(--text-tertiary); margin: 0 0 14px; line-height: 1.6; }
.variant-form-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.variant-form-row .field { display: flex; flex-direction: column; gap: 5px; }
.variant-form-row .field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.variant-form-row .field input {
  padding: 8px 11px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13px;
}
.variant-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.variant-row:last-of-type { border-bottom: none; }
.variant-row .sku { font-weight: 700; color: var(--text-primary); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.variant-row .label { font-size: 12px; color: var(--text-tertiary); }
.variant-picker { display: grid; gap: 12px; max-width: 760px; }
.variant-search-field { position: relative; display: grid; gap: 7px; }
.variant-search-field > label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.variant-search-input-wrap { display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1.5px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-base); }
.variant-search-input-wrap:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent); }
.variant-search-input-wrap svg { width: 17px; height: 17px; color: var(--text-tertiary); flex: 0 0 auto; }
.variant-search-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 11px 0; background: transparent; color: var(--text-primary); font: inherit; }
.variant-search-status { min-height: 18px; color: var(--text-tertiary); font-size: 11.5px; }
.variant-search-results { display: grid; gap: 6px; max-height: 316px; overflow-y: auto; }
.variant-search-result { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-base); color: var(--text-primary); text-align: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.variant-search-result:hover, .variant-search-result:focus-visible { border-color: var(--color-primary); background: var(--bg-hover); transform: translateY(-1px); outline: 0; }
.variant-search-result-copy { display: grid; gap: 3px; min-width: 0; }
.variant-search-result-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.variant-search-result-copy span { color: var(--text-tertiary); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variant-search-result em { flex: 0 0 auto; padding: 4px 7px; border-radius: var(--radius-full); background: var(--bg-hover); color: var(--text-secondary); font-size: 10.5px; font-style: normal; font-weight: 700; }
.variant-selected { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--border-light)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-primary) 7%, var(--bg-surface)); }
.variant-selected > div { display: grid; gap: 3px; min-width: 0; }
.variant-selected-kicker { color: var(--color-primary); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.variant-selected strong { font-size: 13px; color: var(--text-primary); }
.variant-selected span:not(.variant-selected-kicker) { color: var(--text-tertiary); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px; }
.variant-move-warning { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid #f2c777; border-radius: var(--radius-md); background: #fff8e7; color: #7a5600; font-size: 12px; line-height: 1.55; cursor: pointer; }
.variant-move-warning input { margin-top: 1px; }
.variant-search-result input[type="checkbox"], .variant-search-select-all input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.variant-search-result .variant-search-result-copy { flex: 1 1 auto; }
.variant-search-result.is-selected { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 7%, var(--bg-base)); }
.variant-search-select-all { display: flex; align-items: center; gap: 12px; padding: 4px 12px; color: var(--text-secondary); font-size: 12px; font-weight: 700; cursor: pointer; }
.variant-selected { flex-direction: column; align-items: stretch; }
.variant-selected > .variant-selected-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.variant-selected .variant-selected-kicker span { font: inherit; color: inherit; }
.variant-selected-list {display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.variant-selected-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-surface); }
.variant-selected-item > div { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.variant-selected-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variant-selected-item em { flex: 0 0 auto; padding: 3px 7px; border-radius: var(--radius-full); background: #fff8e7; color: #7a5600; font-size: 10.5px; font-style: normal; font-weight: 700; }
@media (max-width: 600px) { .variant-search-result { align-items: flex-start; } .variant-selected-item { flex-wrap: wrap; } }

.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}
.quill-editor-wrap { border: 1.5px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 8px; }
.quill-editor-wrap .ql-container { min-height: 160px; font-size: 13.5px; }
.form-textarea.large { min-height: 200px; }

.hint-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--color-danger-bg);
  color: var(--color-danger);
  margin-bottom: 18px;
}
.hint-card svg, .hint-card i { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.hint-card p { font-weight: 700; margin: 0 0 4px; }
.hint-card ul { margin: 0; padding-inline-start: 18px; font-size: 12.5px; }

/* ---- Product media / documents (public-facing media page) ---- */
.media-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.media-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
}
.media-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.media-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.media-card .media-thumb { aspect-ratio: 4 / 3; cursor: default; }
.media-meta { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 11px; color: var(--text-tertiary); }
.media-badges { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.media-badge svg, .media-badge i { width: 11px; height: 11px; }
.media-badge.primary { background: var(--color-primary-light); color: var(--color-primary); }
.media-badge.package { background: var(--color-success-bg); color: var(--color-success); }
.media-card .media-actions { position: static; background: none; opacity: 1; padding: 0 12px 12px; }

.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-light); border-radius: var(--radius-md); flex-wrap: wrap; }
.doc-info { display: flex; align-items: center; gap: 12px; }
.doc-info svg, .doc-info i { width: 18px; height: 18px; color: var(--color-primary); flex: none; }
.doc-type { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

/* ---- Warranty claims / customer order detail ---- */
.status-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); }
.status-chip.active, .status-chip.approved, .status-chip.resolved { background: var(--color-success-bg); color: var(--color-success); }
.status-chip.pending, .status-chip.submitted { background: var(--color-warning-bg); color: var(--color-warning); }
.status-chip.rejected, .status-chip.expired { background: var(--color-danger-bg); color: var(--color-danger); }

.claim-grid, .claim-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 10px; }
.claim-image { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border-light); }

.order-detail-page { display: flex; flex-direction: column; gap: 18px; }
.order-stage-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.order-stage-card { flex: 1; min-width: 120px; text-align: center; padding: 12px; border-radius: var(--radius-md); background: var(--bg-base); border: 1px solid var(--border-light); }
.order-stage-card.is-done { background: var(--color-success-bg); border-color: transparent; }
.order-stage-card.is-active { background: var(--color-primary-light); border-color: var(--color-primary); }
.order-stage-step { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; margin-bottom: 4px; }
.order-stage-label { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.order-stage-state { font-size: 10.5px; color: var(--text-tertiary); margin-top: 3px; }

.order-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .order-summary-grid { grid-template-columns: 1fr; } }
.order-summary-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.order-summary-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.order-summary-value { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.order-summary-sub { font-size: 10.5px; color: var(--text-tertiary); margin-top: 3px; }

/* ============================================================
   Parent / child product variants
   Parent rows: red left border. Child rows: blue left border.
   Independent products keep their existing look.
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.ptype-group { display: flex; flex-direction: column; gap: 6px; }
.product-card.ptype-parent { border-inline-start: 4px solid var(--color-danger); }
.product-card.ptype-child { border-inline-start: 4px solid var(--color-info); }
.ptype-children { display: flex; flex-direction: column; gap: 6px; margin-inline-start: 28px; padding-inline-start: 12px; border-inline-start: 2px dashed color-mix(in srgb, var(--color-info) 35%, var(--border-light)); }
.ptype-children[hidden] { display: none; }
.product-card.ptype-child.is-match { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-info) 30%, transparent); }
.ptype-empty { margin: 4px 0; font-size: 12.5px; color: var(--text-tertiary); }
.ptype-empty a { color: var(--color-primary); font-weight: 600; }

.ptype-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; vertical-align: middle; }
.ptype-badge.parent { background: var(--color-danger-bg); color: var(--color-danger); }
.ptype-badge.child { background: var(--color-info-bg); color: var(--color-info); }
h1 .ptype-badge { font-size: 12px; margin-inline-start: 8px; }

.ptype-toggle svg, .ptype-toggle i { transition: transform 150ms ease; }
.ptype-toggle[aria-expanded="true"] svg, .ptype-toggle[aria-expanded="true"] i { transform: rotate(180deg); }

.variant-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; color: var(--text-secondary); }
.variant-summary strong { color: var(--text-primary); font-weight: 700; }
.variant-summary-box { min-width: 180px; max-width: 320px; }

.variant-wrap > .variant-card.ptype-card.parent { border-inline-start: 4px solid var(--color-danger); }
.variant-wrap > .variant-card.ptype-card.child { border-inline-start: 4px solid var(--color-info); }
.variant-wrap > .variant-card .variant-summary { margin-top: 4px; }
.ptype-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.variant-actions { display: flex; gap: 10px; margin-top: 14px; }

/* Product type choice on the create page */
.ptype-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ptype-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-base); cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.ptype-choice:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-light); }
.ptype-choice.parent:has(input:checked) { border-color: var(--color-danger); background: var(--color-danger-bg); }
.ptype-choice input { margin-top: 3px; accent-color: var(--color-primary); }
.ptype-choice span { display: grid; gap: 3px; }
.ptype-choice strong { font-size: 13.5px; color: var(--text-primary); }
.ptype-choice small { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }

/* Dimension picker */
.dim-picker { display: grid; gap: 10px; margin-bottom: 10px; }
.dim-picker-row { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.dim-picker-values { display: flex; flex-wrap: wrap; gap: 6px; padding-inline-start: 6px; }
.dim-picker-row:not(:has([data-dim-toggle]:checked)) .dim-picker-values { opacity: 0.45; }
.dim-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1.5px solid var(--border-light); border-radius: var(--radius-full); background: var(--bg-base); font-size: 12.5px; cursor: pointer; }
.dim-chip:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.dim-chip input { margin: 0; accent-color: var(--color-primary); }
.dim-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border-medium, var(--border-light)); vertical-align: middle; }
.dim-picker-manage { margin-top: 4px; }

/* Variants table (parent page) */
.variant-table-wrap { overflow-x: auto; }
.variant-table .sku { font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; color: var(--text-primary); }
.variant-table tr.ptype-row.child td:first-child { border-inline-start: 4px solid var(--color-info); }
.variant-table-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.variant-table-actions form { margin: 0; }

/* Attach existing products */
.attach-rows { display: grid; gap: 10px; }
.attach-row { padding: 12px; border: 1px solid var(--border-light); border-inline-start: 4px solid var(--color-info); border-radius: var(--radius-md); background: var(--bg-base); display: grid; gap: 10px; }
.attach-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach-row-head strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.attach-row-head span { flex: 1 1 auto; color: var(--text-tertiary); font-size: 12.5px; }
.attach-row-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.variant-search-result.is-blocked { opacity: 0.6; cursor: not-allowed; }

/* Dimension management */
.dim-card.is-inactive { opacity: 0.7; }
.dim-card-edit > summary { list-style: none; cursor: pointer; }
.dim-card-edit > summary::-webkit-details-marker { display: none; }
.dim-card-edit[open] > summary { margin-bottom: 12px; }
.dim-meta { font-size: 11.5px; font-weight: 500; color: var(--text-tertiary); }
.dim-values { display: grid; gap: 8px; margin-top: 12px; }
.dim-value-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 80px minmax(0, 220px) auto auto auto; gap: 8px; align-items: center; }
.dim-value-row.has-color { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) 80px minmax(0, 220px) auto auto auto; }
.dim-value-row .form-input { padding: 7px 10px; }
.dim-value-new { padding-top: 8px; border-top: 1px dashed var(--border-light); }
.dim-color { width: 36px; height: 34px; padding: 2px; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-base); }
.dim-usage { font-size: 11.5px; color: var(--text-tertiary); white-space: nowrap; }
.danger-text { color: var(--color-danger) !important; }

@media (max-width: 760px) {
  .ptype-children { margin-inline-start: 10px; padding-inline-start: 8px; }
  .dim-value-row, .dim-value-row.has-color { grid-template-columns: 1fr 1fr; }
  .dim-value-row .dim-color { grid-column: 1 / -1; }
}

.legacy-convert { margin-top: 14px; padding: 14px; border: 1px dashed var(--border-light); border-inline-start: 4px solid var(--color-danger); border-radius: var(--radius-md); background: var(--bg-base); }
.legacy-convert h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; margin: 0 0 6px; color: var(--text-primary); }
.legacy-convert h3 svg, .legacy-convert h3 i { width: 15px; height: 15px; color: var(--color-danger); }
.legacy-convert ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: 12.5px; }

/* Product list bulk actions */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-base); }
.bulk-bar .bulk-action { width: auto; min-width: 190px; }
.bulk-select-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.bulk-count { font-size: 12.5px; color: var(--text-tertiary); }
.bulk-check, .bulk-select-all input { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; accent-color: var(--color-primary); cursor: pointer; }

/* Variant generator matrix */
.matrix-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.matrix-new-badge { display: inline-flex; padding: 2px 9px; border-radius: var(--radius-full); background: var(--color-success-bg, rgba(22,163,74,.12)); color: var(--color-success); font-size: 11px; font-weight: 700; }
.matrix-fill { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.matrix-fill .form-input { width: 150px; padding: 6px 9px; }
.matrix-table td { vertical-align: top; }
.matrix-table .form-input { padding: 7px 9px; min-width: 110px; }
.matrix-table .matrix-sku { min-width: 150px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.matrix-table td:nth-child(3) .form-input { min-width: 220px; }
.matrix-stock { display: flex; gap: 6px; }
.matrix-stock .form-input { min-width: 70px; width: 80px; }
.matrix-combo { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-tertiary); }
.matrix-include-col { width: 36px; text-align: center; }
.matrix-include-col input { width: 17px; height: 17px; accent-color: var(--color-primary); }
.matrix-existing-icon { width: 17px; height: 17px; color: var(--color-info); }
.matrix-row.is-new td:first-child { border-inline-start: 4px solid var(--color-success); }
.matrix-row.is-excluded { opacity: 0.45; }
.matrix-row.has-error { background: var(--color-danger-bg); }
.matrix-row .form-error { display: block; margin-top: 4px; }
.matrix-confirm { padding: 12px; border: 1px solid #f2c777; border-radius: var(--radius-md); background: #fff8e7; color: #7a5600; }
.dim-picker-count { margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); }
.dim-picker-count strong { color: var(--color-primary); font-size: 15px; }
.dim-picker-default { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); padding-inline-start: 6px; }
.dim-picker-default .form-select { width: auto; min-width: 160px; }
.dim-picker-style { margin-inline-start: 6px; font-size: 11px; font-weight: 500; color: var(--text-tertiary); }
.dim-chip-img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.inline-value { margin-top: 12px; }
.inline-value > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--color-primary); }
.inline-value > summary svg { width: 14px; height: 14px; }
.inline-value-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline-value-form .form-input, .inline-value-form .form-select { width: auto; min-width: 150px; }
.inline-value-color input[type="color"] { width: 38px; height: 36px; padding: 2px; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-base); }
.dim-image-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dim-value-thumb { width: 32px; height: 32px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border-light); }
.dim-image-input { font-size: 11.5px; max-width: 180px; }
.dim-image-clear { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
