/* Veefyed Ingestion Engine — app shell (aligned with Golden Source). */
html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: #f3f4f7;
  font-size: 14px;
}

.layout {
  display: flex;
  height: 100%;
  min-height: 0;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #0a1024;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  transition: margin-left 0.22s ease, width 0.22s ease;
}

.layout.sidebar-collapsed .sidebar {
  margin-left: -250px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 36, 0.45);
  border: 0;
  padding: 0;
  margin: 0;
  z-index: 1040;
  cursor: pointer;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }

  .layout:not(.sidebar-collapsed) .sidebar-backdrop {
    display: block;
  }
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(215, 218, 241, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

.sidebar-toggle-btn i {
  font-size: 16px;
  line-height: 1;
}

.sidebar-show-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-show-btn:hover,
.sidebar-show-btn:focus-visible {
  background: #f3f4f6;
  box-shadow: inset 0 0 0 1px #d1d5db;
  outline: none;
}

.sidebar-show-btn i {
  font-size: 20px;
  line-height: 1;
}

.layout:not(.sidebar-collapsed) .sidebar-show-btn {
  display: none;
}

@media (max-width: 991.98px) {
  .sidebar-show-btn {
    display: inline-flex !important;
  }
}

.sidebar-nav-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sidebar-nav-inner {
  padding: 8px 10px 16px;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0 10px 14px;
  background: #0a1024;
}

.sidebar-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 6px;
  opacity: 1;
}

.section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.55;
  text-transform: uppercase;
  padding: 14px 8px 6px;
  color: rgba(215, 218, 241, 0.85);
}

.sidebar .nav-link-icon {
  flex-shrink: 0;
  width: 18px;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  color: inherit;
  opacity: 0.95;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7daf1;
  text-decoration: none;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 10px;
  border-left: none;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.sidebar a.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar .nav-item.active {
  background: #5025d1;
  color: #fff;
  border-radius: 10px;
  border-left: none;
  box-shadow: none;
}

.sidebar .nav-item-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  user-select: none;
}

.sidebar .nav-tool-icon {
  flex-shrink: 0;
  width: 18px;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.sidebar .nav-tool-icon--lookup {
  color: #a78bfa;
}

.sidebar .nav-tool-icon--discovery {
  color: #60a5fa;
}

.sidebar .nav-tool-icon--scraper {
  color: #4ade80;
}

.sidebar .nav-tool-icon--processor {
  color: #fb923c;
}

.sidebar .nav-tool-icon--golden {
  color: #c4b5fd;
}

.sidebar .nav-tool-icon--ingestion {
  color: #67e8f9;
}

.sidebar .nav-tool-icon--hub {
  color: #38bdf8;
}

.sidebar .nav-tool-icon--sellers {
  color: #4ade80;
}

.sidebar .nav-tool-icon--admin {
  color: #f472b6;
}

.sidebar .nav-item.active .nav-tool-icon {
  color: #fff;
}

.sidebar .nav-parent {
  display: flex;
  align-items: stretch;
  position: relative;
  margin: 2px 0;
  border-radius: 10px;
  overflow: hidden;
}

.sidebar .nav-parent .nav-parent-link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7daf1;
  text-decoration: none;
  padding: 9px 12px;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}

.sidebar .nav-parent.active,
.sidebar .nav-parent.active .nav-parent-link {
  background: #5025d1;
  color: #fff;
}

.sidebar .nav-parent-toggle {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0 10px 0 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.2s ease;
}

.sidebar .nav-parent.active .nav-parent-toggle {
  opacity: 0.95;
}

.sidebar .nav-parent-toggle:hover {
  opacity: 1;
}

.sidebar .nav-parent.open .nav-parent-toggle i {
  transform: rotate(180deg);
}

.sidebar .nav-parent-toggle i {
  display: inline-block;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.sidebar .nav-children {
  display: none;
  padding: 2px 0 4px 8px;
}

.sidebar .nav-children.open {
  display: block;
}

.sidebar .nav-child {
  padding-left: 38px !important;
  font-size: 13px;
  font-weight: 500;
}

.sidebar .nav-logout {
  color: #f87171;
  font-weight: 600;
}

.sidebar .nav-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.sidebar .nav-logout-icon {
  color: #f87171;
  font-size: 16px;
}

.login-form-wrap {
  max-width: 420px;
}

.content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.content > .topbar {
  flex-shrink: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-left {
  min-width: 0;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title-icon {
  font-size: 26px;
  color: #6b7280;
}

.topbar-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.05;
  color: #1f2937;
}

.topbar-subtitle {
  font-size: 14px;
  color: #6b7280;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.topbar-account {
  margin-left: 4px;
  position: relative;
}

.topbar-account-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: #f9fafb;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.topbar-account-btn:hover {
  background: #f3f4f6;
  box-shadow: inset 0 0 0 1px #d1d5db;
}

.topbar-account-btn:focus-visible {
  outline: 2px solid rgba(89, 40, 223, 0.45);
  outline-offset: 2px;
}

.topbar-account-btn[aria-expanded="true"] {
  background: #fff;
  box-shadow: inset 0 0 0 1px #c4b5fd, 0 1px 2px rgba(0, 0, 0, 0.04);
}

.topbar-account-btn[aria-expanded="true"] .topbar-account-chevron {
  transform: rotate(180deg);
}

.topbar-account-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 8px;
  min-height: 48px;
}

.topbar-account-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.topbar-account-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(145deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-account-text {
  flex: 1;
  min-width: 0;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar-account-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-account-role {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-account-chevron {
  flex-shrink: 0;
  font-size: 12px;
  color: #9ca3af;
  margin-right: 2px;
  transition: transform 0.2s ease;
}

.topbar-account-menu {
  min-width: 200px;
  padding: 6px;
  margin-top: 8px !important;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  z-index: 1080;
}

/* ---- Product library panel (tabs + filters + table) ---- */
.products-library-panel {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.products-library-panel-body {
  padding: 0;
}

.products-library-toolbar,
.products-library-import,
.products-library-table {
  padding: 1rem 1.15rem;
}

.products-library-import {
  border-top: 1px solid #eef0f3;
}

.products-library-table {
  padding-top: 0.5rem;
  border-top: 1px solid #eef0f3;
}

.products-library-section-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.library-placeholder {
  padding: 3rem 1.25rem;
}

.library-placeholder-title {
  font-size: 1.1rem;
  font-weight: 650;
  color: #111827;
}

/* ---- Product library tabs ---- */
.library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.35rem;
  align-items: flex-end;
  margin: 0;
  padding: 0.85rem 1.15rem 0;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.library-tab {
  display: inline-block;
  padding: 0.45rem 0.05rem 0.75rem;
  color: #374151;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.library-tab:hover {
  color: #7c3aed;
}

.library-tab.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
}



/* ---- Labeled filter fields (floating label on top border) ---- */
.filter-field {
  position: relative;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem 0.45rem;
  min-height: calc(1.5em + 0.875rem + 2px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Selects use a full form-select (same as skincare) — wrapper is label anchor only */
.filter-field:has(.filter-field-select) {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
}

.filter-field:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.filter-field:has(.filter-field-select):focus-within {
  border-color: transparent;
  box-shadow: none;
}

.filter-field-label {
  position: absolute;
  top: 0;
  left: 0.75rem;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 0.35rem;
  background: #fff;
  font-size: 0.72rem;
  line-height: 1;
  color: #6b7280;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

.filter-field-select {
  width: 100%;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  box-shadow: none !important;
  padding: 1rem 2.25rem 0.375rem 0.75rem !important;
  min-height: calc(1.5em + 0.875rem + 2px);
  font-size: 0.875rem;
  font-weight: 400;
  color: #111827;
  background-color: #fff !important;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.filter-field:has(.filter-field-select:focus) .filter-field-select,
.filter-field-select:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

.filter-field-select option {
  padding: 0.375rem 0.75rem;
}

.filter-field-input {
  width: 100%;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  box-shadow: none !important;
  padding: 1rem 0.75rem 0.375rem !important;
  min-height: calc(1.5em + 0.875rem + 2px);
  font-size: 0.875rem;
  font-weight: 400;
  color: #111827;
  background-color: #fff !important;
}

.filter-field:has(.filter-field-input) {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
}

.filter-field:has(.filter-field-input):focus-within {
  border-color: transparent;
  box-shadow: none;
}

.filter-field:has(.filter-field-input:focus) .filter-field-input,
.filter-field-input:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

.filter-field-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.filter-field--locked {
  background: #fafafa;
}

.filter-field--locked .filter-field-label {
  background: #fafafa;
}

.filter-field-value {
  font-size: 0.875rem;
  font-weight: 400;
  color: #111827;
  line-height: 1.5;
  padding: 0.125rem 0;
}

/* Multi-select filter dropdown (check toggle, compact trigger text) */
.filter-field.filter-multi {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
}

.filter-field.filter-multi:focus-within {
  border-color: transparent;
  box-shadow: none;
}

.filter-multi {
  position: relative;
}

.filter-multi-trigger {
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.filter-multi-trigger .filter-multi-display {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.25rem;
}

.filter-multi-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 16rem;
  overflow: auto;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

/* Review Center / AI rails: keep the menu above scrolling card chrome. */
.products-ai-sidebar .filter-multi.is-open {
  z-index: 40;
  position: relative;
}

.products-ai-sidebar .filter-multi-menu {
  z-index: 50;
}

.filter-multi-option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #111827;
  line-height: 1.35;
}

.filter-multi-option:hover,
.filter-multi-option:focus-visible {
  background: #f5f3ff;
  outline: none;
}

.filter-multi-check {
  flex: 0 0 1rem;
  width: 1rem;
  margin-top: 0.1rem;
  color: #7c3aed;
  opacity: 0;
  visibility: hidden;
}

.filter-multi-check.is-visible {
  opacity: 1;
  visibility: visible;
}

.filter-multi-option-label {
  flex: 1 1 auto;
  min-width: 0;
}

.filter-multi.is-open .filter-multi-trigger {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

.products-toolbar-form {
  min-width: 0;
  width: 100%;
}

.products-toolbar-row {
  min-width: 0;
  --bs-gutter-y: 0.85rem;
}

/* ---- Search + Filters toolbar ---- */
.products-search-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.15rem;
  min-width: 0;
  width: 100%;
}

.products-search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 18rem;
  min-width: 0;
  min-height: 2.6rem;
  padding: 0 0.85rem 0 2.55rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  margin: 0;
  cursor: text;
}

.products-search-field:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.products-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
  pointer-events: none;
}

.products-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #111827;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 0.55rem 0;
}

.products-search-input::placeholder {
  color: #9ca3af;
  font-weight: 450;
}

.products-search-input::-webkit-search-decoration,
.products-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.products-search-shortcut {
  flex: 0 0 auto;
  margin-left: 0.65rem;
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

.products-sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.5rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
  flex: 0 0 auto;
}

.products-sf-btn > i {
  font-size: 1rem;
  line-height: 1;
  color: #111827;
}

.products-sf-btn:hover,
.products-sf-btn:focus {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.products-sf-btn-filters.is-open,
.products-sf-btn-filters:not(.collapsed) {
  border-color: #a78bfa;
  background: #f5f3ff;
  color: #5b21b6;
}

.products-sf-btn-filters.is-open > i,
.products-sf-btn-filters:not(.collapsed) > i {
  color: #7c3aed;
}

.products-filters-panel {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eef0f3;
}

.products-filters-panel.collapsing {
  margin-top: 0.85rem;
}

.products-filter-sort .products-toolbar-sort {
  min-width: 10rem;
}

@media (max-width: 767.98px) {
  .products-search-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .products-search-field,
  .products-sf-btn {
    width: 100%;
  }

  .products-search-shortcut {
    display: none;
  }
}

/* ---- Automated Ingestion: Sources registry ---- */
.ingestion-sources-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.ingestion-sources-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.ingestion-sources-heading-icon {
  flex-shrink: 0;
  font-size: 2.15rem;
  line-height: 1;
  color: #4b5563;
}

.ingestion-sources-heading-text {
  min-width: 0;
}

.ingestion-sources-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

.ingestion-sources-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #6b7280;
}

.ingestion-sources-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 55%, #6d28d9 100%);
  border: 0;
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  box-shadow: 0 1px 2px rgba(109, 40, 217, 0.2);
}

.ingestion-sources-add-btn:hover,
.ingestion-sources-add-btn:focus {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  border: 0;
}

.ingestion-sources-table {
  --bs-table-bg: transparent;
}

.ingestion-sources-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  background: #fafbfc;
  border-bottom-color: #eef0f4;
  padding: 0.75rem 1.1rem;
  white-space: nowrap;
}

.ingestion-sources-table tbody td {
  padding: 0.9rem 1.1rem;
  border-bottom-color: #f1f3f7;
  color: #374151;
  vertical-align: middle;
}

.ingestion-sources-table tbody tr:last-child td {
  border-bottom: 0;
}

.ingestion-source-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #111827;
  text-decoration: none;
  font-weight: 600;
}

.ingestion-source-cell:hover {
  color: #7c3aed;
}

.ingestion-source-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f3f4f6;
}

.ingestion-source-domain {
  line-height: 1.2;
}

.ingestion-source-flag {
  display: inline-flex;
  color: #d97706;
  font-size: 0.85rem;
}

.ingestion-source-actions {
  padding: 0.15rem 0.35rem;
  text-decoration: none;
  line-height: 1;
}

.ingestion-source-actions:hover,
.ingestion-source-actions:focus {
  color: #7c3aed !important;
}

.ingestion-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.ingestion-status-pill--active {
  background: #dff6e8;
  color: #15803d;
}

.ingestion-status-pill--paused {
  background: #fff1df;
  color: #c2410c;
}

.ingestion-status-pill--needs_attention {
  background: #ffedd5;
  color: #c2410c;
}

.ingestion-status-pill--failed {
  background: #fee2e2;
  color: #b91c1c;
}

.ingestion-status-pill--exhausted {
  background: #e5e7eb;
  color: #4b5563;
}

.ingestion-scraper-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: lowercase;
}

.ingestion-scraper-pill--none {
  background: #f3f4f6;
  color: #6b7280;
}

.ingestion-scraper-pill--generating {
  background: #ede9fe;
  color: #6d28d9;
}

.ingestion-scraper-pill--ready {
  background: #dff6e8;
  color: #15803d;
}

.ingestion-scraper-pill--failed {
  background: #fee2e2;
  color: #b91c1c;
}

.ingestion-sources-bulk-bar {
  border-top: 1px solid #eef0f3;
  padding-top: 0.65rem;
  margin-top: 0.15rem;
}

.bulk-action-bar {
  padding: 10px 14px;
  border-bottom: 1px solid #eef1f6;
  background: #fafbff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bulk-action-bar .bulk-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bulk-action-bar .bulk-action-buttons .btn {
  white-space: nowrap;
}

/* Action menus in tables use Popper strategy "fixed" (see table_action_dropdowns.js)
   so they are not clipped by .table-responsive overflow. Do not set overflow:visible
   while open — that resets horizontal scrollLeft to 0. */
.dropdown-menu.show {
  z-index: 1055;
}

@media (max-width: 767.98px) {
  .bulk-action-bar {
    align-items: stretch;
  }

  .bulk-action-bar .bulk-action-buttons {
    width: 100%;
  }

  .bulk-action-bar .bulk-action-buttons .btn {
    flex: 1 1 auto;
  }
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.table-pagination-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #eef1f6;
  background: #fff;
  min-width: 0;
}

.table-pagination-summary {
  color: #6b7280;
  font-size: 13px;
  min-width: 0;
  flex: 1 1 160px;
}

.table-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1 1 200px;
}

.pager-number,
.pager-arrow {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 13px;
}

.pager-number.active {
  background: #f3efff;
  border-color: #e5defd;
  color: #6d35ec;
  font-weight: 600;
}

.pager-arrow.disabled {
  pointer-events: none;
  opacity: 0.4;
}

.pager-ellipsis {
  color: #9ca3af;
  font-size: 13px;
  padding: 0 2px;
}

.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
}

.pager-jump-input {
  width: 56px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  text-align: center;
  font-size: 13px;
  padding: 0 6px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.pager-jump-input::-webkit-outer-spin-button,
.pager-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pager-jump-input:focus {
  outline: none;
  border-color: #c9b8fb;
  box-shadow: 0 0 0 3px rgba(109, 53, 236, 0.12);
}

.per-page-form {
  margin-left: 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.per-page-select {
  min-width: 0;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  border-color: #e5e7eb;
}

@media (max-width: 767.98px) {
  .table-pagination-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .table-pagination-summary,
  .table-pagination-controls {
    width: 100%;
  }

  .table-pagination-controls {
    justify-content: flex-start;
  }
}

/* ---- Jobs / candidates / source detail ---- */
.ingestion-job-id {
  font-weight: 650;
  color: #4f46e5;
  text-decoration: none;
}

.ingestion-job-id:hover {
  text-decoration: underline;
}

.ingestion-job-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: capitalize;
  white-space: nowrap;
}

.ingestion-job-pill--completed,
.ingestion-job-pill--completed_with_errors {
  background: #dff6e8;
  color: #15803d;
}

.ingestion-job-pill--running,
.ingestion-job-pill--queued {
  background: #ede9fe;
  color: #6d28d9;
}

.ingestion-job-pill--failed,
.ingestion-job-pill--cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.ingestion-decision-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  background: #f3f4f6;
  color: #4b5563;
}

.ingestion-decision-pill--auto-approve,
.ingestion-decision-pill--new {
  background: #dff6e8;
  color: #15803d;
}

.ingestion-decision-pill--auto-correct,
.ingestion-decision-pill--enrichment {
  background: #fef3c7;
  color: #b45309;
}

.ingestion-decision-pill--manual-review,
.ingestion-decision-pill--create-variant,
.ingestion-decision-pill--review {
  background: #ede9fe;
  color: #6d28d9;
}

.ingestion-decision-pill--duplicate {
  background: #fee2e2;
  color: #b91c1c;
}

.ingestion-decision-pill--no-action,
.ingestion-decision-pill--pending {
  background: #e5e7eb;
  color: #4b5563;
}

.ingestion-candidate-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #eef0f4;
  background: #f8fafc;
  display: block;
}

.ingestion-candidate-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1rem;
}

.ingestion-candidate-detail-hero {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

.ingestion-candidate-detail-hero--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 1.5rem;
  background: #f3f4f6;
}

.ingestion-candidate-gallery-item {
  display: block;
  width: 88px;
  height: 88px;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eef0f4;
  background: #f8fafc;
  cursor: zoom-in;
}

.ingestion-candidate-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ingestion-candidate-thumb.ingestion-image-preview,
.ingestion-candidate-detail-hero.ingestion-image-preview {
  cursor: zoom-in;
}

.ingestion-candidate-thumb.ingestion-image-preview:hover,
.ingestion-candidate-detail-hero.ingestion-image-preview:hover,
.ingestion-candidate-gallery-item:hover {
  outline: 2px solid #d7c9ff;
  outline-offset: 1px;
}

.ingestion-image-preview-modal .modal-body {
  background: #f5f7fb;
}

.ingestion-image-preview-viewport {
  min-height: min(70vh, 640px);
  max-height: min(80vh, 820px);
  overflow: auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ingestion-image-preview-viewport.is-zoomed {
  display: block;
  cursor: grab;
}

.ingestion-image-preview-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}

.ingestion-image-preview-stage {
  display: inline-block;
  line-height: 0;
}

.ingestion-image-preview-viewport img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.ingestion-image-preview-viewport.is-panning img {
  pointer-events: none;
}

.ingestion-candidate-dl dt {
  color: #6b7280;
  font-weight: 600;
}

.ingestion-candidate-dl dd {
  color: #111827;
  margin-bottom: 0.65rem;
}

.ingestion-clamp-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ingestion-clamp.is-collapsed .ingestion-clamp-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.ingestion-clamp-toggle {
  font-weight: 650;
  text-decoration: none;
  color: #7c3aed;
}

.ingestion-clamp-toggle:hover,
.ingestion-clamp-toggle:focus {
  color: #6d28d9;
  text-decoration: underline;
}

.ingestion-discovery-barcode {
  color: #6d28d9;
  font-weight: 600;
}

.ingestion-history-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
  background: #f3f4f6;
  color: #4b5563;
}

.ingestion-history-pill--approve-new {
  background: #dff6e8;
  color: #15803d;
}

.ingestion-history-pill--enrich-existing {
  background: #fef3c7;
  color: #b45309;
}

.ingestion-history-pill--reject,
.ingestion-history-pill--quarantine {
  background: #fee2e2;
  color: #b91c1c;
}

.job-log-terminal {
  min-height: 16rem;
  max-height: 50vh;
  overflow: auto;
  background: #0b1220;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.job-log-terminal .log-meta {
  color: #94a3b8;
}

.job-log-terminal .log-error {
  color: #fca5a5;
}

.job-log-terminal .log-warn {
  color: #fde68a;
}

.ingestion-source-detail-favicon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  object-fit: contain;
  flex-shrink: 0;
}

.ingestion-source-detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ingestion-source-detail-crumb a:hover {
  color: #4c1d95 !important;
}

.ingestion-source-overview {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.25rem;
  padding-top: 0.75rem;
}

@media (max-width: 991.98px) {
  .ingestion-source-overview {
    grid-template-columns: 1fr;
  }
}

.ingestion-source-overview-stats {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.25rem 0.15rem;
}

.ingestion-source-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.92rem;
}

.ingestion-source-stat-row:last-child {
  border-bottom: 0;
}

.ingestion-source-overview-chart {
  border-color: #eef0f4;
  box-shadow: none;
}

.ingestion-source-chart-wrap {
  position: relative;
  height: 260px;
}

.ingestion-source-chart-wrap--tall {
  height: 320px;
}

.ingestion-stat-card {
  border-color: #eef0f4;
  box-shadow: none;
}

/* ---- Automated Ingestion: Overview ---- */
.ingestion-overview-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ingestion-overview-beta {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #6d28d9;
  background: #f3e8ff;
}

.ingestion-overview-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: default;
}

.ingestion-overview-range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  color: #374151;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 42px;
}

.ingestion-overview-range-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 0;
  box-shadow: none !important;
  padding: 0 1.55rem 0 0.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: transparent;
  line-height: 1.2;
}

.ingestion-overview-range-select:focus {
  outline: none;
}

.ingestion-overview-date-btn:disabled {
  opacity: 1;
}

.ingestion-overview-date-chevron {
  font-size: 0.75rem;
  color: #9ca3af;
}

.ingestion-overview-metric {
  border: 1px solid #eef0f4;
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background: #fff;
}

.ingestion-overview-metric .card-body {
  padding: 1rem 1.15rem 1.1rem;
}

.ingestion-overview-metric-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.ingestion-overview-metric-copy {
  min-width: 0;
  flex: 1;
}

.ingestion-overview-metric-icon,
.ingestion-overview-pipeline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 999px;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.ingestion-overview-pipeline-icon {
  width: 3.4rem;
  height: 3.4rem;
  font-size: 1.55rem;
}

.ingestion-overview-metric-icon--blue {
  background: #dbeafe;
  color: #2563eb;
}

.ingestion-overview-metric-icon--green {
  background: #dcfce7;
  color: #16a34a;
}

.ingestion-overview-metric-icon--purple {
  background: #ede9fe;
  color: #7c3aed;
}

.ingestion-overview-metric-icon--sky {
  background: #e0f2fe;
  color: #0284c7;
}

.ingestion-overview-metric-icon--red {
  background: #fee2e2;
  color: #dc2626;
}

.ingestion-overview-metric-icon--violet {
  background: #f3e8ff;
  color: #9333ea;
}

.ingestion-overview-delta {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  flex-shrink: 0;
}

.ingestion-overview-delta.is-up {
  background: #dcfce7;
  color: #15803d;
}

.ingestion-overview-delta.is-down {
  background: #fee2e2;
  color: #b91c1c;
}

.ingestion-overview-metric-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.ingestion-overview-metric-value-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ingestion-overview-metric-value {
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1.15;
  color: #111827;
  letter-spacing: -0.02em;
}

.ingestion-overview-metric-sub {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

.ingestion-overview-pipeline {
  border: 1px solid #eef0f4;
  border-radius: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background: #fff;
}

.ingestion-overview-pipeline-title {
  margin: 0 0 1.15rem;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.ingestion-overview-pipeline-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 0.35rem;
}

.ingestion-overview-pipeline-step {
  flex: 1 1 6.5rem;
  min-width: 5.5rem;
  text-align: center;
}

.ingestion-overview-pipeline-arrow {
  color: #d1d5db;
  font-size: 1rem;
  flex-shrink: 0;
}

.ingestion-overview-pipeline-value {
  margin-top: 0.55rem;
  font-size: 1.35rem;
  font-weight: 750;
  color: #111827;
  letter-spacing: -0.02em;
}

.ingestion-overview-pipeline-label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}

.ingestion-overview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  font-weight: 700;
  color: #111827;
  padding: 0.9rem 1.1rem;
}

.ingestion-overview-panel-header a {
  color: #7c3aed;
}

.ingestion-overview-panel-header a:hover {
  color: #6d28d9;
}

.ingestion-overview-discovery-list .list-group-item {
  border-color: #f1f3f7;
  padding: 0.85rem 1.1rem;
}

@media (max-width: 991.98px) {
  .ingestion-overview-pipeline-arrow {
    display: none;
  }

  .ingestion-overview-pipeline-step {
    flex: 1 1 calc(33.333% - 0.5rem);
  }
}

@media (max-width: 575.98px) {
  .ingestion-overview-pipeline-step {
    flex: 1 1 calc(50% - 0.5rem);
  }

  .ingestion-overview-metric-value {
    font-size: 1.4rem;
  }
}

