/* ═══════════════════════════════════════════════════════════════
 *  TradeForge Mission System — Styles
 *  Clean, industrial, performance-focused. No gamification.
 * ═══════════════════════════════════════════════════════════════ */

/* ── Mission Progress Summary Bar ── */
.tfm-progress-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tfm-progress-stat {
  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: 12px;
}

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

.tfm-progress-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--cwapp-text, #e7edf3);
  line-height: 1.1;
}

.tfm-progress-stat-value.value-created {
  color: #6abf69;
}

.tfm-progress-stat-value.value-at-stake {
  color: #e4c89b;
}

/* ── Active Missions Panel ── */
.tfm-missions-panel {
  margin-bottom: 14px;
}

.tfm-missions-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tfm-missions-panel-head h2 {
  margin: 0;
  font-size: 15px;
  color: var(--cwapp-text, #e7edf3);
}

.tfm-missions-count {
  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: 4px 10px;
  background: rgba(19, 25, 33, 0.9);
}

.tfm-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tfm-filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 22, 31, 0.9);
  color: var(--cwapp-muted, #9ea8b3);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all 0.15s;
}

.tfm-filter-btn.active {
  color: #ebddc7;
  border-color: rgba(140, 106, 62, 0.45);
  background: rgba(140, 106, 62, 0.16);
}

.tfm-filter-btn:hover {
  border-color: rgba(140, 106, 62, 0.35);
}

/* ── Mission Cards ── */
.tfm-mission-list {
  display: grid;
  gap: 8px;
}

.tfm-mission-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--cwapp-panel, #151b23);
  border-radius: 10px;
  padding: 12px;
  transition: border-color 0.15s;
}

.tfm-mission-card:hover {
  border-color: rgba(140, 106, 62, 0.35);
}

.tfm-mission-card.status-completed {
  border-color: rgba(106, 191, 105, 0.25);
  opacity: 0.85;
}

.tfm-mission-card.priority-critical {
  border-left: 3px solid #d56666;
}

.tfm-mission-card.priority-high {
  border-left: 3px solid #e4c89b;
}

.tfm-mission-card.priority-standard {
  border-left: 3px solid rgba(140, 106, 62, 0.4);
}

.tfm-mission-card.priority-low {
  border-left: 3px solid rgba(255, 255, 255, 0.12);
}

.tfm-mission-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tfm-mission-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cwapp-text, #e7edf3);
  line-height: 1.35;
  margin: 0;
}

.tfm-mission-title.completed {
  text-decoration: line-through;
  opacity: 0.7;
}

.tfm-mission-priority {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tfm-mission-priority.critical {
  color: #f4d6cc;
  background: rgba(190, 85, 72, 0.2);
  border: 1px solid rgba(190, 85, 72, 0.36);
}

.tfm-mission-priority.high {
  color: #ead6b6;
  background: rgba(140, 106, 62, 0.2);
  border: 1px solid rgba(140, 106, 62, 0.4);
}

.tfm-mission-priority.standard {
  color: #cad8eb;
  background: rgba(86, 136, 177, 0.15);
  border: 1px solid rgba(86, 136, 177, 0.3);
}

.tfm-mission-priority.low {
  color: var(--cwapp-muted, #9ea8b3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tfm-mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.tfm-mission-meta-item {
  font-size: 11px;
  color: var(--cwapp-muted, #9ea8b3);
}

.tfm-mission-meta-item strong {
  color: #dce3eb;
}

/* ── Mission Progress Track ── */
.tfm-mission-progress {
  margin: 8px 0 6px;
}

.tfm-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.tfm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(140, 106, 62, 0.7), #8c6a3e);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.tfm-progress-fill.complete {
  background: linear-gradient(90deg, rgba(106, 191, 105, 0.6), #6abf69);
}

.tfm-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--cwapp-muted, #9ea8b3);
  margin-top: 4px;
}

/* ── Mission Impact Row ── */
.tfm-mission-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tfm-impact-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(19, 25, 33, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cwapp-muted, #9ea8b3);
}

.tfm-impact-tag.financial {
  color: #6abf69;
  border-color: rgba(106, 191, 105, 0.25);
}

.tfm-impact-tag.urgency-critical {
  color: #f4d6cc;
  border-color: rgba(190, 85, 72, 0.3);
}

.tfm-impact-tag.urgency-high {
  color: #ead6b6;
  border-color: rgba(140, 106, 62, 0.35);
}

.tfm-impact-tag.type-tag {
  color: #cad8eb;
  border-color: rgba(86, 136, 177, 0.25);
}

/* ── Milestones ── */
.tfm-milestones {
  margin-top: 8px;
  display: grid;
  gap: 3px;
}

.tfm-milestone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--cwapp-muted, #9ea8b3);
}

.tfm-milestone-check {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
}

.tfm-milestone-check.done {
  background: rgba(106, 191, 105, 0.2);
  border-color: rgba(106, 191, 105, 0.4);
  color: #6abf69;
}

.tfm-milestone-check.done::after {
  content: "\2713";
}

.tfm-milestone.done {
  color: rgba(158, 168, 179, 0.6);
  text-decoration: line-through;
}

/* ── Completion State ── */
.tfm-completion-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(106, 191, 105, 0.08);
  border: 1px solid rgba(106, 191, 105, 0.2);
  margin-top: 8px;
}

.tfm-completion-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(106, 191, 105, 0.2);
  border: 1px solid rgba(106, 191, 105, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #6abf69;
  flex-shrink: 0;
}

.tfm-completion-icon::after {
  content: "\2713";
}

.tfm-completion-text {
  font-size: 11px;
  color: #a6d4a5;
}

.tfm-completion-text strong {
  color: #6abf69;
}

/* ── Mission Actions ── */
.tfm-mission-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.tfm-action-btn {
  border: 1px solid rgba(140, 106, 62, 0.4);
  background: rgba(140, 106, 62, 0.12);
  color: #e9dbc6;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.tfm-action-btn:hover {
  background: rgba(140, 106, 62, 0.22);
}

.tfm-action-btn.complete-btn {
  border-color: rgba(106, 191, 105, 0.4);
  background: rgba(106, 191, 105, 0.1);
  color: #a6d4a5;
}

.tfm-action-btn.complete-btn:hover {
  background: rgba(106, 191, 105, 0.2);
}

.tfm-action-btn.guidance-btn {
  border-color: rgba(159, 122, 234, 0.4);
  background: rgba(159, 122, 234, 0.1);
  color: #c4b5fd;
}

.tfm-action-btn.guidance-btn:hover {
  background: rgba(159, 122, 234, 0.2);
}

/* ── War Room Compact Mission View ── */
.tfm-warroom-missions {
  margin-top: 12px;
}

.tfm-warroom-missions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tfm-warroom-missions-head h3 {
  margin: 0;
  font-size: 13px;
}

.tfm-compact-list {
  display: grid;
  gap: 6px;
}

.tfm-compact-card {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 24, 32, 0.72);
  border-radius: 8px;
  overflow: hidden;
}

.tfm-compact-priority-bar {
  width: 3px;
}

.tfm-compact-priority-bar.critical { background: #d56666; }
.tfm-compact-priority-bar.high { background: #e4c89b; }
.tfm-compact-priority-bar.standard { background: rgba(140, 106, 62, 0.5); }
.tfm-compact-priority-bar.low { background: rgba(255, 255, 255, 0.15); }

.tfm-compact-body {
  padding: 7px 9px;
  min-width: 0;
}

.tfm-compact-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--cwapp-text, #e7edf3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfm-compact-meta {
  font-size: 10px;
  color: var(--cwapp-muted, #9ea8b3);
  margin-top: 2px;
  display: flex;
  gap: 8px;
}

.tfm-compact-progress {
  display: flex;
  align-items: center;
  padding: 0 9px;
}

.tfm-compact-pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--cwapp-muted, #9ea8b3);
  min-width: 32px;
  text-align: right;
}

/* ── Company Workspace Missions Tab ── */
.tfm-section-head {
  margin-bottom: 14px;
}

.tfm-section-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.tfm-section-head p {
  margin: 0;
  font-size: 13px;
  color: var(--tfco-muted, #a3adb8);
  max-width: 720px;
}

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

/* ── Responsive ── */
@media (max-width: 840px) {
  .tfm-progress-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .tfm-mission-header {
    flex-direction: column;
    gap: 6px;
  }

  .tfm-compact-card {
    grid-template-columns: 3px 1fr;
  }

  .tfm-compact-progress {
    display: none;
  }
}

@media (max-width: 480px) {
  .tfm-progress-bar {
    grid-template-columns: 1fr;
  }

  .tfm-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .tfm-filter-btn {
    white-space: nowrap;
  }
}
