/* ===== Experts Tab ===== */

.experts-header {
  margin-bottom: 0;
}

.experts-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.experts-stats .stat-item {
  background: var(--bg-light, #ecf0f1);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.recruit-cost {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 0.3rem;
}

/* ── Recruitment Controls ─────────────────────── */

.expert-recruit-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.expert-recruit-queue {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recruit-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-light, #ecf0f1);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--secondary, #3498db);
}

.recruit-info {
  flex: 1;
}

.recruit-name {
  font-weight: 600;
}

.recruit-gender {
  opacity: 0.6;
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.recruit-timer {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--warning, #f39c12);
  min-width: 5rem;
  text-align: right;
}

/* ── Expert Roster ────────────────────────────── */

.expert-roster {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.expert-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border, #bdc3c7);
  transition: border-color 0.2s;
}

.expert-card:hover {
  border-color: var(--secondary, #3498db);
}

.expert-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.expert-portrait {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  border: 2px solid var(--border, #bdc3c7);
}

.expert-info {
  flex: 1;
}

.expert-name {
  margin: 0;
  font-size: 1rem;
}

.expert-status {
  font-size: 0.8rem;
}

.expert-status.status-assigned {
  color: var(--success, #27ae60);
}

.expert-status.status-idle {
  color: var(--warning, #f39c12);
}

.expert-actions {
  display: flex;
  gap: 0.3rem;
}

/* ── Skill Bars ───────────────────────────────── */

.expert-skills {
  margin-bottom: 0.75rem;
}

.skill-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.skill-name {
  min-width: 9rem;
  white-space: nowrap;
}

.skill-bar {
  flex: 1;
  height: 8px;
  background: var(--border, #dfe6e9);
  border-radius: 4px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary, #3498db), var(--success, #27ae60));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.skill-level {
  min-width: 2.5rem;
  text-align: center;
  font-weight: 600;
  color: var(--secondary, #3498db);
}

.skill-bonus {
  min-width: 2.5rem;
  text-align: right;
  color: var(--success, #27ae60);
  font-size: 0.8rem;
}

/* ── Knowledge Tablets ────────────────────────── */

.expert-knowledge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.knowledge-tablet {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Assignment Controls ──────────────────────── */

.expert-assignment {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border, #bdc3c7);
}

.assigned-to {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.expert-bonus {
  color: var(--success, #27ae60);
  font-weight: 600;
  font-size: 0.9rem;
}

.assigned-foreman {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
}

.assigned-secondary {
  background: rgba(142, 68, 173, 0.06);
  border: 1px dashed rgba(142, 68, 173, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
}

.dual-assign-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px dashed var(--border, #bdc3c7);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.02);
}

.dual-assign-select {
  flex: 1;
  max-width: 280px;
}

.dual-effectiveness {
  font-size: 0.75rem;
  color: var(--warning, #f39c12);
  font-weight: 600;
  margin-left: 2px;
}

.unassigned {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.assign-select {
  flex: 1;
  max-width: 250px;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border, #bdc3c7);
  background: #fff;
  color: var(--text, #2c3e50);
  font-size: 0.85rem;
}

/* ── Button Variants ──────────────────────────── */

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-secondary {
  background: var(--bg-light, #ecf0f1);
  color: var(--text, #2c3e50);
  border-color: var(--border, #bdc3c7);
}

.btn-secondary:hover {
  background: var(--border, #dfe6e9);
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 768px) {
  .experts-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .expert-card-header {
    flex-wrap: wrap;
  }

  .expert-card {
    padding: 0.75rem;
  }

  .skill-name {
    min-width: 5rem;
    font-size: 0.75rem;
  }

  .skill-bar-row {
    gap: 0.3rem;
    font-size: 0.8rem;
  }

  .assigned-to {
    flex-direction: column;
    align-items: flex-start;
  }

  .unassigned {
    flex-direction: column;
    align-items: stretch;
  }

  .assign-select {
    max-width: 100%;
    min-height: 44px;
    font-size: 0.9rem;
  }

  .expert-actions .btn-small {
    min-height: 44px;
    padding: 0.3rem 0.6rem;
  }

  .expert-recruit-controls {
    flex-direction: column;
  }

  .recruit-entry {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
}

/* ── Building Card Expert Panel ───────────────── */

.building-expert-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 5px;
  font-size: 0.85rem;
}

.building-expert-panel.expert-assigned {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.building-expert-panel.expert-empty {
  background: var(--bg-light, #ecf0f1);
  border: 1px solid var(--border, #bdc3c7);
  justify-content: space-between;
}

.expert-badge {
  font-weight: 600;
  color: var(--text, #2c3e50);
}

.expert-badge.empty {
  opacity: 0.6;
  font-weight: 400;
}

.expert-level-badge {
  font-size: 0.78rem;
  color: var(--success, #27ae60);
  font-weight: 600;
}

.btn-go-experts {
  background: var(--secondary, #3498db);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-go-experts:hover {
  background: #2980b9;
}
