/* Quality console — the human side of the image-quality loop.

   Its own stylesheet, so the quality module's styles never leak into the rest
   of the console and the console's styles never reach into it. Every colour
   is a token app.css already defines, so the light theme needs no second
   block here: the palette follows the console, not the other way round. */

.quality-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quality-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* One artefact: what it is, who decided, and the controls to decide. */
.quality-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}

.quality-row-main {
  flex: 1;
  min-width: 240px;
}

.quality-row-sku {
  font-family: var(--mono);
  font-size: 12px;
}

.quality-row-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 5px;
}

.quality-row-act {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.quality-reason,
.quality-note {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.quality-reason {
  max-width: 220px;
}

.quality-note {
  min-width: 150px;
}

/* The reason tags are the judge's own codes. A critical code is a rejection
   reason, not an uncertainty, so it is marked apart from the rest. */
.quality-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.quality-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-fg);
  border: 1px solid var(--badge-neutral-bd);
}

.quality-tag[data-critical="1"] {
  background: var(--badge-bad-bg);
  color: var(--danger);
  border-color: var(--badge-bad-bd);
}

/* The four decision states. The source is part of the state, so a model
   approval and a human approval never look the same. */
.badge[data-quality="pending"] {
  background: var(--badge-mute-bg);
  color: var(--badge-mute-fg);
  border-color: var(--badge-mute-bd);
}

.badge[data-quality="model_approved"] {
  background: var(--badge-info-bg);
  color: var(--badge-info-fg);
  border-color: var(--badge-info-bd);
}

.badge[data-quality="human_approved"] {
  background: var(--badge-ok-bg);
  color: var(--ok);
  border-color: var(--badge-ok-bd);
}

.badge[data-quality="rejected"] {
  background: var(--badge-bad-bg);
  color: var(--danger);
  border-color: var(--badge-bad-bd);
}
