/* Panel QA — internal tool, desktop-first. Every selector prefixed .qa- (T-059, spine.md "Panel QA"). */

.qa-body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
}

.qa-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.qa-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
}

.qa-nav__link--active { color: var(--signal); }

.qa-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--signal);
  color: var(--paper);
  font-size: .75rem;
  font-weight: 700;
}

.qa-main {
  padding: 32px;
}

.qa-title {
  font-family: var(--display);
  margin: 0 0 24px;
}

.qa-flash {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 20px;
}

.qa-flash--alert {
  background: var(--ivory-muted);
  color: var(--signal-dark);
  font-weight: 700;
}

.qa-list {
  display: grid;
  gap: 14px;
}

.qa-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.qa-card--late { border-color: var(--signal); border-width: 2px; }
.qa-stale { color: var(--signal); font-weight: 600; }

.qa-card__thumb { flex: 0 0 96px; }
.qa-card__thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }

.qa-card__token {
  font-family: var(--display);
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.qa-card__meta {
  margin: 0 0 8px;
  color: var(--ink-muted);
  font-size: .9rem;
}

.qa-badge--late {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--signal);
  color: var(--paper);
  font-size: .75rem;
  font-weight: 700;
}

.qa-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.qa-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  font-size: .8rem;
  text-decoration: none;
  color: inherit;
}

.qa-card__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.qa-card__cost { margin: 0; font-weight: 700; }

.qa-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--signal);
  color: var(--paper);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.qa-button--outline {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

/* T-060: two-column decision screen (qa/analyses#show) and the JSON-edit-with-preview screen
   (qa/reports#edit) both use this 7fr/5fr grid; .qa-card keeps its flex-row layout everywhere
   else (the index queue rows), so it is switched to block only inside these grids. */
.qa-show {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px;
  align-items: start;
}

.qa-column,
.qa-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.qa-show .qa-card {
  display: block;
}

.qa-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.qa-table th,
.qa-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .9rem;
}

/* T-075: one scannable roster, horizontally scrollable instead of collapsing to cards. */
.qa-influencers__search { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 12px; }
.qa-influencers__search label { width: 100%; font-weight: 700; }
.qa-influencers__search input[type="search"] { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.qa-stats--influencers { margin-bottom: 20px; }
.qa-table-wrap { overflow-x: auto; }
.qa-table--influencers { min-width: 1120px; margin: 0; }
.qa-table--influencers thead th { position: sticky; top: 0; z-index: 1; background: var(--paper); white-space: nowrap; }
.qa-table--influencers th a { color: inherit; }
.qa-table__number { text-align: right !important; white-space: nowrap; }
.qa-table__actions { white-space: nowrap; }

.qa-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.qa-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
}

.qa-swatch__color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}

.qa-swatch--foreign {
  outline: 2px solid var(--signal);
}

.qa-swatch__badge {
  color: var(--signal);
  font-weight: 700;
  font-size: .75rem;
}

.qa-outfits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 12px 0;
}

.qa-outfits__item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.qa-outfits__image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

.qa-outfits__meta,
.qa-outfits__state {
  margin: 0 0 6px;
  font-size: .85rem;
}

.qa-outfits__pick {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  padding: 6px 0;
}

.qa-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0;
}

.qa-photos img {
  width: 100%;
  border-radius: 8px;
}

.qa-photos figcaption {
  margin-top: 4px;
  font-size: .8rem;
  color: var(--ink-muted);
}

.qa-decision {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: 14px;
  background: var(--deep);
  color: var(--ivory);
}

.qa-decision .qa-chip {
  background: var(--line-light);
  color: var(--ivory);
}

.qa-decision textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 8px;
  border: 1px solid var(--line-light);
  background: transparent;
  color: var(--ivory);
  padding: 10px;
  font-family: var(--sans);
}

/* T-061: dashboard — stat cards, bar funnel, attention cards, recent events. */
.qa-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.qa-stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.qa-stat__value {
  font-family: var(--display);
  font-size: 2rem;
  margin: 0;
}

.qa-stat__label,
.qa-stat__sub {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: .85rem;
}

.qa-funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.qa-funnel__row {
  display: grid;
  grid-template-columns: 130px 1fr 50px;
  align-items: center;
  gap: 14px;
}

.qa-funnel__label { font-size: .9rem; }

.qa-funnel__track {
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.qa-funnel__bar {
  height: 100%;
  border-radius: 999px;
  background: var(--signal);
}

.qa-funnel__value { text-align: right; font-weight: 700; }

.qa-attention {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.qa-attention__card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
}

.qa-attention__card--flag { border-color: var(--signal); color: var(--signal); }

.qa-attention__value {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 0;
}

.qa-attention__label,
.qa-attention__meta {
  margin: 4px 0 0;
  font-size: .85rem;
}

/* T-062: sessions list — filter chips + per-row funnel progress bar. */
.qa-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.qa-chip--active {
  background: var(--signal);
  color: var(--paper);
}

/* Shared table header/search primitives used by the new QA rosters. */
.qa-table-wrap { overflow-x: auto; }
.qa-table__number { text-align: right !important; white-space: nowrap; }

.qa-table-wrap th a,
.qa-table-wrap td a {
  color: inherit;
}

.qa-table td {
  white-space: nowrap;
}

/* Rows tagged .qa-card (tests count them) stay table rows, or headers drift off their columns. */
.qa-table tr.qa-card {
  display: table-row;
}

.qa-table th {
  white-space: nowrap;
}

.qa-json {
  width: 100%;
  min-height: 70vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

/* T-062: sessions roster */
.qa-sessions__search { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 12px; }
.qa-sessions__search label { width: 100%; font-weight: 700; }
.qa-sessions__search input[type="search"] { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.qa-sessions-table-wrap { margin-bottom: 12px; }
.qa-sessions-table { min-width: 900px; }
.qa-sessions__token { font-family: var(--display); }

/* T-075 / T-077: queue style list (still used in analyses table). */
.qa-queue__search,
.qa-failed__search,
.qa-rejected__search,
.qa-free-results__search {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 12px;
}
.qa-queue__search label,
.qa-failed__search label,
.qa-rejected__search label,
.qa-free-results__search label {
  width: 100%;
  font-weight: 700;
}

.qa-queue__search input[type="search"],
.qa-failed__search input[type="search"],
.qa-rejected__search input[type="search"],
.qa-free-results__search input[type="search"] {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.qa-queue-table-wrap,
.qa-failed-table-wrap,
.qa-rejected-table-wrap,
.qa-costs-table-wrap,
.qa-dashboard-events-wrap {
  margin-top: 12px;
}

.qa-queue-table,
.qa-failed-table,
.qa-rejected-table,
.qa-costs-table,
.qa-dashboard-events-table {
  min-width: 960px;
}

.qa-free-results__count { margin-bottom: 8px; color: var(--ink-muted); }

/* T-078: dashboard events as scroll table (class names kept for legacy assertions). */
.qa-dashboard-events-table .qa-events__row {
  vertical-align: top;
}

.qa-dashboard-events-table .qa-events__token,
.qa-dashboard-events-table .qa-events__source {
  white-space: nowrap;
}

.qa-dashboard-events-table .qa-events__stage { white-space: nowrap; }

/* T-063: costs failure counts */
.qa-cost-failed {
  color: var(--signal);
  font-weight: 700;
}

/* T-079: costs list. */
.qa-costs__count { color: var(--ink-muted); margin: 0 0 8px; }

/* T-080: failed roster (table). */
.qa-failed__row td,
.qa-rejected-table__row td { vertical-align: top; }

/* T-081: rejected thumbs keep fixed size. */
.qa-rejected__image {
  width: 96px;
  height: 96px;
  object-fit: cover;
}

/* T-082: free results gallery with controls. */
.qa-free-results__search,
.qa-free-results__count { margin-bottom: 12px; }

.qa-free-results__header {
  display: grid;
  gap: 6px;
}

.qa-free-results__meta-line,
.qa-free-results__meta-links {
  margin: 0;
  color: var(--ink-muted);
  font-size: .85rem;
}

.qa-free-results__meta-links { color: var(--ink); }
.qa-free-results__label { font-weight: 700; }

/* T-074: darmowe wyniki — selfie + warianty jak u klientki, karta pionowa. */
.qa-card--free { flex-direction: column; align-items: stretch; }
.qa-free { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0; }
.qa-free img { width: 100%; border-radius: 8px; display: block; }
.qa-free figure { margin: 0; }
.qa-free figcaption { margin-top: 4px; font-size: .8rem; color: var(--ink-muted); }
.qa-free__placeholder { aspect-ratio: 1; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-muted); }
.qa-free__observation { margin: 8px 0 0; font-style: italic; }

@media (max-width: 700px) {
  .qa-free { grid-template-columns: 1fr; }
}

/* 2026-09-24: one identity cell on every screen — token, mail, links to the other screens holding her */
.qa-session { display: grid; gap: 2px; }
.qa-session__email { font-size: .85rem; }
.qa-session__links { display: flex; flex-wrap: wrap; gap: 8px; font-size: .75rem; }
