/* ═══════════════════════════════════════════════════════════════
 *  TradeForge Contributor Engine — Unified Styles
 *  Industrial, professional, construction-first. No gamification.
 * ═══════════════════════════════════════════════════════════════ */

/* ── Engine Dashboard KPIs ── */
.tce-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tce-kpi {
  border: 1px solid rgba(140, 106, 62, 0.22);
  background: linear-gradient(135deg, rgba(19, 25, 33, 0.96), rgba(14, 18, 24, 0.94));
  border-radius: 10px;
  padding: 14px;
}

.tce-kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cwapp-muted, #9ea8b3);
  margin-bottom: 4px;
}

.tce-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--cwapp-text, #e7edf3);
  line-height: 1.1;
}

.tce-kpi-value.green { color: #6abf69; }
.tce-kpi-value.amber { color: #e4c89b; }
.tce-kpi-value.red { color: #d56666; }
.tce-kpi-value.blue { color: #63b3ed; }

/* ── War Room Panels ── */
.tce-warroom-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--cwapp-panel, #151b23);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.tce-warroom-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tce-warroom-panel-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--cwapp-text, #e7edf3);
}

.tce-warroom-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cwapp-muted, #9ea8b3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(19, 25, 33, 0.9);
}

.tce-warroom-badge.alert {
  color: #d56666;
  border-color: rgba(213, 102, 102, 0.3);
  background: rgba(213, 102, 102, 0.08);
}

/* ── Contributor Overview Cards ── */
.tce-contributor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tce-contributor-row:last-child {
  border-bottom: none;
}

.tce-contributor-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--cwapp-text, #e7edf3);
}

.tce-contributor-meta {
  font-size: 10px;
  color: var(--cwapp-muted, #9ea8b3);
}

.tce-contributor-earned {
  font-size: 12px;
  font-weight: 700;
  color: #6abf69;
}

/* ── Payout Queue ── */
.tce-payout-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tce-payout-item:last-child {
  border-bottom: none;
}

.tce-payout-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--cwapp-text, #e7edf3);
}

.tce-payout-amount {
  font-size: 12px;
  font-weight: 700;
  color: #e4c89b;
}

.tce-payout-action {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(106, 191, 105, 0.4);
  background: rgba(106, 191, 105, 0.1);
  color: #a6d4a5;
  cursor: pointer;
}

.tce-payout-action:hover {
  background: rgba(106, 191, 105, 0.2);
}

/* ── Risk Flag Items ── */
.tce-risk-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tce-risk-item:last-child {
  border-bottom: none;
}

.tce-risk-severity {
  width: 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tce-risk-severity.high { background: #d56666; }
.tce-risk-severity.medium { background: #e4c89b; }
.tce-risk-severity.low { background: rgba(255, 255, 255, 0.2); }

.tce-risk-body {
  flex: 1;
  min-width: 0;
}

.tce-risk-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cwapp-muted, #9ea8b3);
  margin-bottom: 2px;
}

.tce-risk-desc {
  font-size: 11px;
  color: var(--cwapp-text, #e7edf3);
  line-height: 1.3;
}

/* ── Mission Impact Score Badge ── */
.tce-impact-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(140, 106, 62, 0.4);
  background: rgba(140, 106, 62, 0.12);
  color: #e4c89b;
  flex-shrink: 0;
}

/* ── Ranked Mission Row ── */
.tce-ranked-mission {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tce-ranked-mission:last-child {
  border-bottom: none;
}

.tce-ranked-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--cwapp-text, #e7edf3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tce-ranked-meta {
  font-size: 10px;
  color: var(--cwapp-muted, #9ea8b3);
}

.tce-ranked-impact {
  font-size: 11px;
  font-weight: 700;
  color: #6abf69;
  white-space: nowrap;
}

/* ── Earnings Dashboard ── */
.tce-earnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tce-earnings-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--cwapp-panel, #151b23);
  border-radius: 10px;
  padding: 14px;
}

.tce-earnings-card h4 {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cwapp-muted, #9ea8b3);
}

.tce-earnings-card .tce-earnings-amount {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

/* ── Action-Value Chain ── */
.tce-chain-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
}

.tce-chain-item:last-child {
  border-bottom: none;
}

.tce-chain-action {
  color: var(--cwapp-text, #e7edf3);
  font-weight: 600;
}

.tce-chain-value {
  color: var(--cwapp-muted, #9ea8b3);
}

.tce-chain-earning {
  color: #6abf69;
  font-weight: 700;
}

/* ── Pathways ── */
.tce-pathway-card {
  border: 1px solid rgba(140, 106, 62, 0.22);
  background: linear-gradient(135deg, rgba(19, 25, 33, 0.96), rgba(14, 18, 24, 0.94));
  border-radius: 10px;
  padding: 14px;
}

.tce-pathway-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cwapp-text, #e7edf3);
}

.tce-pathway-desc {
  font-size: 11px;
  color: var(--cwapp-muted, #9ea8b3);
  line-height: 1.4;
}

.tce-pathway-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tce-pathway-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(140, 106, 62, 0.12);
  border: 1px solid rgba(140, 106, 62, 0.3);
  color: #e4c89b;
}

.tce-pathways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

/* ── War Room Section Divider ── */
.tce-warroom-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 12px 0;
}

/* ── Stats Row (inline) ── */
.tce-stats-inline {
  display: flex;
  gap: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--cwapp-muted, #9ea8b3);
  margin-bottom: 8px;
}

.tce-stats-inline .green { color: #6abf69; }
.tce-stats-inline .amber { color: #e4c89b; }
.tce-stats-inline .red { color: #d56666; }

/* ── Empty State ── */
.tce-empty {
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  color: var(--cwapp-muted, #9ea8b3);
  font-size: 12px;
}

/* ── Section link ── */
.tce-section-link {
  font-size: 10px;
  font-weight: 700;
  color: var(--bronze, #8c6a3e);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tce-section-link:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 840px) {
  .tce-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .tce-pathways-grid {
    grid-template-columns: 1fr;
  }
  .tce-earnings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tce-kpis {
    grid-template-columns: 1fr;
  }
  .tce-earnings-grid {
    grid-template-columns: 1fr;
  }
}
