/* ============================================================
   UNSPSC Classifying Helper — component styles
   Uses 4EBIT design tokens from design-tokens.css.
   ============================================================ */

/* ---- Search bar ---- */
.search-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  background: var(--surface-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search-bar-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-xs);
}

input.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-strong);
  padding: 0;
}
input.search-input::placeholder { color: var(--text-muted); }

/* ---- Primary button ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 20px;
  height: 42px;
  background: var(--brand);
  color: var(--on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast);
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-active); }
.btn-primary:disabled, .btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary.size-lg { height: 48px; padding: 0 24px; font-size: 15px; }

/* ---- Secondary / ghost button ---- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 16px;
  height: 36px;
  background: var(--surface-page);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.btn-secondary:hover { background: var(--surface-subtle); color: var(--text-strong); }

/* ---- Text / nav link button ---- */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur-fast);
}
.btn-ghost:hover { color: var(--text-brand); }

/* ---- Form inputs ---- */
.input-field {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-strong);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---- Copy button (in table) ---- */
.btn-copy {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-page);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast);
}
.btn-copy:hover { background: var(--surface-subtle); color: var(--text-strong); }
.btn-copy.copied {
  background: var(--green-100);
  border-color: var(--green-500);
  color: #1C7A43;
}

/* ---- Results / drilldown table ---- */
.unspsc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 14px;
}
.unspsc-table thead tr {
  background: var(--surface-subtle);
}
.unspsc-table th {
  padding: 11px 16px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
.unspsc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-secondary);
}
.unspsc-table tr { cursor: pointer; transition: background var(--dur-fast); }
.unspsc-table tbody tr:hover td { background: var(--brand-wash); }
.unspsc-table tbody tr:last-child td { border-bottom: none; }

/* ---- Code badge ---- */
.code-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-wash);
  border: 1px solid var(--red-100);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  margin-right: 7px;
}

/* ---- Drill link ---- */
.drill-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-strong);
  cursor: pointer;
}
.drill-link .link-title {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--slate-300);
  transition: text-decoration-color var(--dur-fast);
}
.drill-link:hover .link-title { text-decoration-color: var(--text-strong); }

/* ---- Section kicker ---- */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.section-kicker-num {
  color: var(--brand);
}
.section-kicker-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--border-default);
}

/* ---- Nav lang pill ---- */
.lang-btn {
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  background: transparent;
  color: var(--text-secondary);
}
.lang-btn.active {
  background: var(--brand);
  color: var(--on-brand);
}
.lang-btn:hover:not(.active) { background: var(--surface-subtle); }

/* ---- Alert / message banners ---- */
.alert {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert-error  { background: var(--danger-bg);  border-color: var(--danger);  color: #991B1B; }
.alert-success{ background: var(--success-bg); border-color: var(--success); color: #166534; }
.alert-info   { background: var(--info-bg);    border-color: var(--info);    color: #1D4ED8; }

/* ---- Status card (import progress) ---- */
.status-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 600;
}
.status-card.running { background: var(--blue-100); border-color: var(--blue-500); color: #1D4ED8; }
.status-card.done    { background: var(--green-100); border-color: var(--green-500); color: #1C7A43; }
.status-card.error   { background: var(--danger-bg); border-color: var(--danger); color: #991B1B; }

/* ---- Compact table density (toggled via prop in design) ---- */
.unspsc-table.compact td { padding: 7px 16px; }

/* ---- File input drop zone ---- */
.file-drop-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 20px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.file-drop-zone:hover {
  border-color: var(--brand);
  background: var(--brand-wash);
}

/* ---- Checkbox ---- */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ---- Spinner animation ---- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.8s linear infinite; }
@keyframes pulse-bar { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.progress-bar-pulse { animation: pulse-bar 1.2s ease-in-out infinite; }
